Upload a File and Check the Status

You create a solution that allows your customer to use a client to connect to your partner application, and then use REST API to upload demand data for demand collaboration.

Let's discuss this scenario:
  • Upload a file and check for errors.

Here's a typical application processing flow for the scenario:

  • You upload customer demand.

  • You check the status along with any errors so they can be corrected.

  • You create a solution that enables your customer to use a client to connect to your partner application.

Upload Customer Demand

To upload customer demand:

  1. Authenticate as an enterprise or customer demand collaborator.
  2. Run the POST operation against the Collaboration Customer Demand Uploads resource to upload a file in Base64 format.

    The response payload includes details that describe the results of the request.

Your partner application extracts the values for these attributes from the response payload, and then displays them in the client.

Attribute Description Required User Key
collaborationCustomerDemandUploads.DocumentTypeCode Abbreviation that identifies the type of document used for collaboration. Yes N/A
collaborationCustomerDemandUploads.IncrementalFlag Contains one of the following values: true or false. If true, then the data is processed as an incremental change within the editable date range. If false, then the data is processed as a full replace within the editable date range. The default value is false. Yes N/A
collaborationCustomerDemandUploads.Attachment Value that identifies the Base64-encoded customer demand file. Yes N/A
collaborationCustomerDemandUploads.Filename Name of the uploaded customer demand file. Optional N/A
collaborationCustomerDemandUploads.InitiateProcessingFlag Contains one of the following values: true or false. If true, then the data will be processed. If false, then the data will not be processed. The default value is false. Optional N/A
collaborationCustomerDemandUploads.Notes Notes associated with the upload request. Optional N/A

Example URL

Use this resource URL format:

POST collaborationCustomerDemandUploads
curl -u username:password -X POST -H "Content-Type:application/json" -d 'request payload' "https://servername/fscmRestApi/resources/version/collaborationCustomerDemandUploads"

Example Request

Here's an example of the request body in JSON format:pre
{
    "DocumentTypeCode": "VCS_FORECAST",
    "IncrementalFlag":true,
    "Attachment": "UEsDBBQAAAAAAOViI1MAAAAAAAAAAAAAAAAEAAAAYmFkL1BLAwQUAAAACADiYiNTQzOffc0AAABMAwAACwAAAGJhZC9iYWQuY3N2rY5BCsIwEEX3gjeZpklqbXQnsYKgFpso7krEQQq2lZoIenpTUPAAWQzz/188nnQP2zXY71xzxh5+VdUWv9PaYrPBJ96O5uYQiv5q2vptbN21f/MWzcP1qF93lN0FYe9Ma2v7gqWxOB4pKSt5ULqijMFfqdRa5/4PW5SfdJQOae5vy6Aol3lZrYoylwulgQkGLBYxp5yFInLggYkJJIGJE5gQQQISZymkZOGuIZliCpzFVMTTUMAMBr3Ie0ZZKKbwkiShRIQCZvBVpN7xA1BLAQI/ABQAAAAAAOViI1MAAAAAAAAAAAAAAAAEACQAAAAAAAAAEAAAAAAAAABiYWQvCgAgAAAAAAABABgAgGMfXeig1wF2VkRe6KDXAVt/NTLooNcBUEsBAj8AFAAAAAgA4mIjU0Mzn33NAAAATAMAAAsAJAAAAAAAAAAgAAAAIgAAAGJhZC9iYWQuY3N2CgAgAAAAAAABABgAKmRBWeig1wHwg6Jf6KDXAVt/NTLooNcBUEsFBgAAAAACAAIAswAAABgBAAAAAA==",
    "Filename":"myDemand.zip",
    "Notes":"Latest demand requirements for the next 6 months."
}

Example Response

Here's an example of the response body in JSON format:pre
{
    "ImportRequestId": 300100550433053,
    "LoadProcessId": null,
    "ProcessId": null,
    "DocumentTypeCode": "VCS_FORECAST",
    "DocumentTypeName": "Forecast",
    "Filename": "myDemand.zip",
    "DocumentId": 248681,
    "StatusCode": "IN_PROCESS",
    "Status": null,
    "PublishedByPartyCode": "ORA_VCS_ENTERPRISE",
    "PublishedByParty": null,
    "Notes": "Latest demand requirements for the next 6 months.",
    "CreatedBy": "COLLABPLANNER",
    "CreationDate": "2021-09-03T17:34:52+00:00",
    "LastUpdatedBy": "COLLABPLANNER",
    "LastUpdateDate": "2021-09-03T17:34:52.881+00:00",
    "ErrorFlag": false,
    "IncrementalFlag": "true",
    "InitiateProcessingFlag": "false",
    "MessageId": null,
    "B2BUser": null,
    "B2BFlag": "false",
    "PartnerId": null,
    "links": [
        {
            "rel": "self",
            "href": "https://servername/fscmRestApi/resources/version/collaborationCustomerDemandUploads/300100550433050",
            "name": "collaborationCustomerDemandUploads",
            "kind": "item",
            "properties": {
                "changeIndicator": "ACED0005737200136A6176612E7574696C2E41727261794C6973747881D21D99C7619D03000149000473697A65787000000001770400000001737200116A6176612E6C616E672E496E746567657212E2A0A4F781873802000149000576616C7565787200106A6176612E6C616E672E4E756D62657286AC951D0B94E08B02000078700000000178"
            }
        },
        {
            "rel": "canonical",
            "href": "https://servername/fscmRestApi/resources/version/collaborationCustomerDemandUploads/300100550433050",
            "name": "collaborationCustomerDemandUploads",
            "kind": "item"
        },
        {
            "rel": "child",
            "href": "https://servername/fscmRestApi/resources/version/collaborationCustomerDemandUploads/300100550433050/child/statusDetails",
            "name": "statusDetails",
            "kind": "collection"
        },
        {
            "rel": "enclosure",
            "href": "https://servername/fscmRestApi/resources/version/collaborationCustomerDemandUploads/300100550433050/enclosure/Attachment",
            "name": "Attachment",
            "kind": "other"
        }
    ]
}

Check Status of Upload

To check the status of your upload:

  1. Authenticate as an enterprise or customer demand collaborator.
  2. Run the GET operation against the Collaboration Customer Demand Uploads resource to retrieve the status, errors, and supplemental information needed for troubleshooting.

    The response payload includes details that describe the results of the request.

Your partner application extracts the values for these attributes from the response payload, and then displays them in the client.

Attribute Description Required User Key
collaborationCustomerDemandUploads.ImportRequestId Value that uniquely identifies the user's request to import data. Yes, finder N/A
collaborationCustomerDemandUploads.Status Current state of the upload request. N/A N/A
collaborationCustomerDemandUploads.LoadProcessId Value that uniquely identities the running Load Collaboration Customer Demand scheduled process. N/A N/A
collaborationCustomerDemandUploads.ProcessId Value that uniquely identifies the running Process Collaboration Customer Demand scheduled process. N/A N/A
collaborationCustomerDemandUploads.ErrorFlag Contains one of the following values: true or false. If true, then errors occurred when processing the import data request. If false, then errors did not occur. This attribute does not have a default value. N/A N/A
statusDetails.RowNumber Number that identifies the row in the comma-separated values file if using file import. N/A N/A
statusDetails.MessageCode Abbreviation that identifies the message related to the import request. N/A N/A
statusDetails.MessageToken Value that identifies the first token of the message. N/A N/A
MessageTokenValue Value of the first token of the message. N/A N/A
statusDetails.MessageToken2 Value that identifies the second token of the message. N/A N/A
statusDetails.MessageTokenValue2 Value of the second token of the message. N/A N/A
statusDetails.MessageToken3 Value that identifies the third token of the message. N/A N/A
statusDetails.MessageTokenValue3 Value of the third token of the message. N/A N/A

Example URL

Use this resource URL format:

GET collaborationCustomerDemandUploads

curl -u username:password -X POST -H "Content-Type:application/json" -d 'request payload' "https://servername/fscmRestApi/resources/version/collaborationCustomerDemandUploads/300100550433053?expand=statusDetails&onlyData=true"

Example Response

Here's an example of the response body in JSON format:
{
    "ImportRequestId": 300100550433053,
    "LoadProcessId": 200914,
    "ProcessId": 200915,
    "DocumentTypeCode": "VCS_FORECAST",
    "DocumentTypeName": "Forecast",
    "Filename": "myDemand.zip",
    "DocumentId": 248699,
    "StatusCode": "FAILURE",
    "Status": "Failure",
    "PublishedByPartyCode": "ORA_VCS_ENTERPRISE",
    "PublishedByParty": "Enterprise",
    "Notes": "Latest demand requirements for the next 6 months.",
    "CreatedBy": "COLLABPLANNER",
    "CreationDate": "2021-09-03T17:41:01+00:00",
    "LastUpdatedBy": "COLLABPLANNER",
    "LastUpdateDate": "2021-09-03T17:41:29+00:00",
    "ErrorFlag": true,
    "IncrementalFlag": "true",
    "InitiateProcessingFlag": "true",
    "MessageId": null,
    "B2BUser": null,
    "B2BFlag": "false",
    "PartnerId": null,
    "statusDetails": {
        "items": [
            {
                "RowNumber": 1,
                "MessageCode": "VCS_INVLD_FILE_FORMAT3",
                "ImportRequestId": 300100550433053,
                "MessageToken": null,
                "MessageTokenValue": null,
                "MessageToken2": null,
                "MessageTokenValue2": null,
                "MessageToken3": null,
                "MessageTokenValue3": null,
                "ErrorId": 300100550429729
            }
        ],
        "count": 1,
        "hasMore": false,
        "limit": 24,
        "offset": 0,
        "links": [
            {
                "rel": "self",
                "href": "https://servername/fscmRestApi/resources/version/collaborationCustomerDemandUploads/300100550433053/child/statusDetails",
                "name": "statusDetails",
                "kind": "collection"
            }
        ]
    }
}