Add Update Resources

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

NameLocationOptionsDescription
Authorization tokenHeaderSee Login Authentication API documentation
RequestNoBodyRecommended unique for each request, visible within the UI.
ResourceNameBodyName visible within the UI
CategoryNameBodyFull path of the Resource Category hierarchy level
LocationsBodyFull path of the one or more Locations for this Resource
Field ValuesBodyUse GetResources to view list of all fields.Additional information about the one or more Fields associated with this resource.
OperationBody"Add","Update"Flag used to indicate if you are adding resources or updating resources.
StatusBody"True","False"Enable and Disable Flag for the resource. Enable = True, Disable = False.
PartialSuccessBody"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


NameDescription
RequestIDUse 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.
RequestStatusIf no syntax errors are present the default response is Pending until the request can be processed.
RequestErrorError object providing information if an error occurs
StatusIndicating 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 OptionsDescription
SelectOneValues will be in a drop down option
SingleLineTextValue will be an open free text entry
NumericValues will be restricted to numerical integers
SelectMultipleMultiple values can be selected from a drop down option