Introduction
This API will be used to add new or modify existing Resources in the system. Category and location data can also be linked using this API. Implementation best practice to call GetResources to review fields required in your request for AddUpdateResources.
Getting Started
All API requests require an authorization token – reference our Authentication page for more information
API Structure
POST api/integration/AddUpdateResources
Required Request Parameters
Name | Location | Options | Description |
---|---|---|---|
Authorization token | Header | See Login Authentication API documentation | |
RequestNo | Body | Recommended unique for each request, visible within the UI. | |
ResourceName | Body | Name visible within the UI | |
CategoryName | Body | Full path of the Resource Category hierarchy level | |
Locations | Body | Full path of the one or more Locations for this Resource | |
Field Values | Body | Use GetResources to view list of all fields. | Additional information about the one or more Fields associated with this resource. |
Operation | Body | "Add","Update" | Flag used to indicate if you are adding resources or updating resources. |
Status | Body | "True","False" | Enable and Disable Flag for the resource. Enable = True, Disable = False. |
PartialSuccess | Body | "True","False" | Flag to allow a partial commit of the changes, recommended setting True |
Request JSON: Creating a new Resource
{
"RequestNo": "API-batch-ss-004",
"Data": {
"InstanceList": [
{
"ResourceName": "Oatmeal",
"CategoryName": "Items > Items > Ingredients",
"Locations": [
"Locations > Locations > Jacksonville, FL",
"Locations > Locations > San Francisco, CA"
],
"FieldValues": [
{
"FieldName": "Item Number",
"Value": "1001"
},
{
"FieldName":"Item Category",
"Value":"Ingredient"
},
{
"FieldName":"Status",
"Value":"True"
}
]
}
]
},
"Operation": "Add",
"PartialSuccess": true
}
Request JSON: Updating an Existing Resource with itemcode defined
{
"RequestNo": "ItemcodeUpdate",
"Data": {
"InstanceList": [{
"ResourceName": "test_item",
"CategoryName": "Items > Poultry",
"ItemCode": "12345687",
"Locations": [
"Locations > Poultry > Novato, CA"
],
"FieldValues": [{
"FieldName": "Status",
"Value": "true"
}
]
}
],
"UpdateByField": "itemcode"
},
"Operation": "Update",
"PartialSuccess": true
}
Request JSON: Updating a Resource with Select Multiple attributes
{
"RequestNo": "API-batch-ss-004",
"Data": {
"InstanceList": [
{
"ResourceName": "Oatmeal",
"CategoryName": "Items > Items > Ingredients",
"Locations": [
"Locations > Locations > Jacksonville, FL",
"Locations > Locations > San Francisco, CA"
],
"FieldValues": [
{
"FieldName": "Item Number",
"Value": "1001"
},
{
"FieldName":"Item Category",
"Value":"Ingredient,Packaging"
},
{
"FieldName":"Status",
"Value":"True"
}
]
}
]
},
"Operation": "Update",
"PartialSuccess": true
}
Response Parameters
Name | Description |
---|---|
RequestID | Use this GUID within our GetBatchStatus API to request updates on when the request will be processed outside of the UI. See Request Status API documentation. |
RequestStatus | If no syntax errors are present the default response is Pending until the request can be processed. |
RequestError | Error object providing information if an error occurs |
Status | Indicating the success of the API request |
Response JSON
{
"RequestId": "91d9ad28-8759-4ccd-b401-a4ea0c32ed19",
"RequestStatus": "Pending",
"RequestError": null,
"Status": true,
"Errors": null,
"RefreshToken": false
}
Note: Response JSON is formatted the same for creating or updating resources.
Visit the Get Batch Status Page to obtain the final status of the request.
Miscellaneous
Field Values are pulled from within the Resource Designer area of the UI, an example of Field Type and Field behavior is annotated below. All request must include the FieldName for Status this indicates if the resource is enabled/disabled.
FieldTypeName Options | Description |
---|---|
SelectOne | Values will be in a drop down option |
SingleLineText | Value will be an open free text entry |
Numeric | Values will be restricted to numerical integers |
SelectMultiple | Multiple values can be selected from a drop down option |
