Skip to main content

Ingestion record API & Template API

Overview

The Ingestion Record API can be used to retrieve all ingestion records for your account. Since uploading and processing codes is an ASYNC process by design, it is important to check on the status of your records after uploading. When successful, the staus will be completed with no errors present in the result_data.

Additionally, when a record fails during the ASYNC process, an email will be sent to the account admins containing the errors.

API Design

Ingestion Record

GET /api/v2/ingestion/

Gets a list of Ingestion Records.

Response 200

{
"count": 18,
"next": null,
"previous": null,
"results": [
{
"id": 22,
"key": "ym0mse71lc7t",
"description": "Code ingestion file upload",
"status": "error",
"type": "code",
"ingestion_mode": "api",
"created_at": "2022-10-19T17:17:11.750258Z",
"created_by": 1,
"status_updated_at": "2022-10-26T13:51:15.701033Z",
"parameters": {
"default_scm_data": {},
"use_serial_number": false
},
"result_data": {
"errors": [
{
"duplicate_id_error": [
"iE4Mw…",
"Bc2m6…"
]
}
]
},
"template": "",
},
{
"id": 34,
"key": "3k59jyrwznhp",
"description": "Code ingestion file upload",
"status": "completed",
"type": "code",
"ingestion_mode": "api",
"created_at": "2024-01-24T16:00:40.058486Z",
"created_by": {
"id": 4,
"email": "brand@..."
},
"status_updated_at": "2024-01-24T16:00:40.675917Z",
"parameters": {
"id_format": "default",
"url_prefix": "https://...",
"default_scm_data": {
"activation_status": "1"
},
"printing_partner": 3,
"allow_posted_duplicates": false
},
"result_data": {
"workorder_id": 53
},
"template": {
"id": 1,
"key": "template1",
"name": "Ingestion template 1",
"description": ""
},
"uploaded_file": "http://..."
},
...
]
}

Filters

Usage example:

/api/v2/ingestion/?type=code

Supported filter fields:

  • type
  • status
  • ingestion_mode

GET /api/v2/ingestion/{key}/

Gets a single record based on the key

Response 200

{
"id": 22,
"key": "ym0mse71lc7t",
"description": "Code ingestion file upload",
"status": "error",
"type": "code",
"ingestion_mode": "api",
"created_at": "2022-10-19T17:17:11.750258Z",
"created_by": 1,
"status_updated_at": "2022-10-26T13:51:15.701033Z",
"parameters": {
"default_scm_data": {},
"use_serial_number": false
},
"result_data": {
"errors": [
{
"duplicate_id_error": [
"iE4Mw…",
"Bc2m6…"
]
}
]
},
"template": "",
}

Code Ingestion Templates

GET /api/v2/ingestion/codes/templates/

Gets a a list of Ingestion Templates

Response 200

{
"count": 18,
"next": null,
"previous": null,
"results": [
{
"key": "sg-code-ingestion-template",
"name": "SG Code Ingestion Template",
"description": "",
"image": None,
"workorder_template": {
"id": any_int(),
"name": "SG test template",
"description": "",
"ingestion_mode": "none",
},
"is_archived": False,
"allow_posted_duplicates": False,
"id_format": "default",
"frontend_settings": {},
"default_scm_data": {},
},
...
]
}

GET /api/v2/ingestion/codes/templates/{key}/

Gets a a single Ingestion Templates based on key

Response 200

{
"key": "sg-code-ingestion-template",
"name": "SG Code Ingestion Template",
"description": "",
"image": None,
"workorder_template": {
"id": any_int(),
"name": "SG test template",
"description": "",
"ingestion_mode": "none",
},
"is_archived": False,
"allow_posted_duplicates": False,
"id_format": "default",
"frontend_settings": {},
"default_scm_data": {},
}