Skip to main content
Unlisted page
This page is unlisted. Search engines will not index it, and only users having a direct link can access it.

Publish Data API v2

This document describes the v2 SourcingData endpoints for publishing data to the DataService input queue.

Overview

The v2 API provides an improved interface for publishing data to the input queue. The key differences from v1:

  • Uses agentId query parameter instead of sourceId path parameter for agent identification
  • Supports optional clientId query parameter for client-specific filtering
  • Simplified URL structure without BySourceId suffix
  • Enhanced authorization with 401 Unauthorized and 403 Forbidden responses

For general concepts like status flow, data types, and input queue events, see Publish Data v1 Documentation.

Base URL

https://{hostname}/api/asol/ds

Endpoints

1. Get Input Queue Status

Retrieves the status of input queue items sorted from the latest to history.

Endpoint: GET /api/v2/SourcingData/EnqueueData

Query Parameters:

ParameterTypeRequiredDescription
agentIdIntegrationAgentIdNoThe identifier of the integration agent
clientIdstringNoThe client identifier for filtering
offsetintNoNumber of records to skip (default: 0)
limitintNoMaximum number of records to return (default: 100)

Response Statuses:

Status CodeDescription
200 OKSuccessfully retrieved collection
400 Bad RequestInvalid request parameters
401 UnauthorizedAuthentication required
403 ForbiddenAccess denied
404 Not FoundAgent not found

Response Body:

PropertyTypeDescription
queueItemIdGuidThe identifier of queue-item
operationIdGuidThe identifier of virtual operation, see Operating log
createdOnDateTimeThe datetime in UTC when queue-item was created
completedOnDateTimeThe datetime in UTC when queue-item was completed and ready to process
finishedOnDateTimeThe datetime in UTC when processing of queue-item was finished
statusstringThe status of queue-item
wasSuccessboolThe flag if queue-item was successfully processed and data has been updated
wasFailureboolThe flag if queue-item was unsuccessfully processed (i.e. failed or canceled)
errorMessagestringThe error message with failure details (available for Failed and Canceled statuses)
{
"totalCount": 49,
"items": [
{
"queueItemId": "35d5d447-b500-4828-8099-a26845c85cb8",
"operationId": "4ca3fe2c-d164-4621-bb6c-b8da412e43b5",
"createdOn": "2023-07-25T20:20:33.919Z",
"completedOn": "2023-07-25T20:20:33.919Z",
"finishedOn": "2023-07-25T20:21:09.718Z",
"status": "Success"
}
]
}

Example Request:

GET /api/v2/SourcingData/EnqueueData?agentId=my-agent&offset=0&limit=10

2. Add New Item to Input Queue

Creates a new item in the input queue with data records.

Endpoint: POST /api/v2/SourcingData/EnqueueData/start

Query Parameters:

ParameterTypeRequiredDescription
agentIdIntegrationAgentIdYesThe identifier of the integration agent
operationIdstringNoThe identifier of virtual operation, see Operating log
clientIdstringNoThe client identifier

Request Body Properties:

PropertyTypeRequiredDescription
entityMappingIdstringNoThe identifier for entity mapping of transformation, the entityId is used when not defined
entityIdstringYesThe identifier of source entity (e.g. table name/id), used to build externalId
recordIdstringYesThe identifier of source record (e.g. primary key), used to build externalId
referenceIdGuidNoThe reference identifier of original record from primary data-source
mandantCodestringNoThe code of organization representing mandant in tenant context (or null for non-mandant data-record)
fieldsarrayNoThe data (i.e. payload) of data-record, array of key(string)+value(any) pairs processed by data-transformation(s). Only one of the fields or data can be set at the same time.
dataobjectNoThe data (i.e. payload) of data-record, object containing fields and their values processed by data-transformation(s). Only one of the fields or data can be set at the same time.
customDataobjectNoThe data (i.e. payload) of data-record specific for the current tenant and organization, object containing fields and their values processed by data-transformation(s), Only one of the fields or data can be set at the same time.
isDeletedboolNoThe flag if data-record will be upserted or deleted
incompleteDataboolNoThe flag if data are complete or incomplete, see Status Flow

Request Body:

{
"items": [
{
"entityMappingId": "OrganizationUnit-Deps",
"entityId": "ORG_DEPT",
"recordId": "1234",
"referenceId": "4998966b-d957-4bab-97e0-33863b322d19",
"mandantCode": "64949541|CZ",
"isDeleted": false,
"data": {
"Code": "Montovna",
"Name": "Montážní hala",
"Type": "Workroom.OrganizationUnitType.00000000-0000-0000-0000-000000000000"
},
"customData": {
"CEO": "Robert Vrátník"
}
}
],
"incompleteData": false
}

Response Statuses:

Status CodeDescription
201 CreatedQueue-item created and processed synchronously
202 AcceptedQueue-item created and will be processed asynchronously
400 Bad RequestInvalid request parameters or body
401 UnauthorizedAuthentication required
403 ForbiddenAccess denied
404 Not FoundAgent not found

Response Body:

{
"sourceId": "6a06af09-3d17-4bae-a9f4-37ebcaf7a873",
"queueItemId": "35d5d447-b500-4828-8099-a26845c85cb8",
"operationId": "4ca3fe2c-d164-4621-bb6c-b8da412e43b5",
"createdOn": "2023-07-25T20:20:33.919Z",
"completedOn": "2023-07-25T20:20:33.919Z",
"finishedOn": "2023-07-25T20:21:09.718Z",
"status": "Success",
"wasSuccess": true,
"wasFailure": null,
"errorMessage": null
}

Example Request:

POST /api/v2/SourcingData/EnqueueData/start?agentId=my-agent&operationId=4ca3fe2c-d164-4621-bb6c-b8da412e43b5

3. Append Records to Existing Queue Item

Appends additional records to an existing item in the input queue. The queue-item must be in Pending state.

Endpoint: POST /api/v2/SourcingData/EnqueueData/append/{queueItemId}

Path Parameters:

ParameterTypeRequiredDescription
queueItemIdstringYesThe identifier of queue-item (obtained by start method)

Query Parameters:

ParameterTypeRequiredDescription
agentIdIntegrationAgentIdYesThe identifier of the integration agent
clientIdstringNoThe client identifier

Request Body Properties:

PropertyTypeRequiredDescription
entityMappingIdstringNoThe identifier for entity mapping of transformation, the entityId is used when not defined
entityIdstringYesThe identifier of source entity (e.g. table name/id), used to build externalId
recordIdstringYesThe identifier of source record (e.g. primary key), used to build externalId
referenceIdGuidNoThe reference identifier of original record from primary data-source
mandantCodestringNoThe code of organization representing mandant in tenant context (or null for non-mandant data-record)
fieldsarrayNoThe data (i.e. payload) of data-record, array of key(string)+value(any) pairs processed by data-transformation(s). Only one of the fields or data can be set at the same time.
dataobjectNoThe data (i.e. payload) of data-record, object containing fields and their values processed by data-transformation(s). Only one of the fields or data can be set at the same time.
customDataobjectNoThe data (i.e. payload) of data-record specific for the current tenant and organization, object containing fields and their values processed by data-transformation(s), Only one of the fields or data can be set at the same time.
isDeletedboolNoThe flag if data-record will be upserted or deleted
incompleteDataboolNoThe flag if data are complete or incomplete, see Status Flow

Request Body:

{
"items": [
{
"entityMappingId": "OrganizationUnit-Deps",
"entityId": "ORG_DEPT",
"recordId": "1234",
"referenceId": "d16ef9d6-c0c6-4ac6-8140-4608531b4e99",
"mandantCode": "64949541|CZ",
"isDeleted": true,
"fields": null
}
],
"incompleteData": false
}

Response Statuses:

Status CodeDescription
201 CreatedLast chunk processed synchronously
202 AcceptedChunk appended and will be processed asynchronously
400 Bad RequestInvalid request parameters or body
401 UnauthorizedAuthentication required
403 ForbiddenAccess denied
404 Not FoundQueue-item or agent not found

Response Body:

{
"sourceId": "6a06af09-3d17-4bae-a9f4-37ebcaf7a873",
"queueItemId": "35d5d447-b500-4828-8099-a26845c85cb8",
"operationId": "4ca3fe2c-d164-4621-bb6c-b8da412e43b5",
"createdOn": "2023-07-25T20:20:33.919Z",
"completedOn": "2023-07-25T20:20:33.919Z",
"status": "Completed"
}

Example Request:

POST /api/v2/SourcingData/EnqueueData/append/35d5d447-b500-4828-8099-a26845c85cb8?agentId=my-agent

4. Get Queue Item Status

Retrieves the status of a specific queue-item in the input queue.

Endpoint: GET /api/v2/SourcingData/EnqueueData/status/{queueItemId}

Path Parameters:

ParameterTypeRequiredDescription
queueItemIdstringYesThe identifier of queue-item (obtained by start method)

Query Parameters:

ParameterTypeRequiredDescription
agentIdIntegrationAgentIdYesThe identifier of the integration agent
clientIdstringNoThe client identifier

Response Statuses:

Status CodeDescription
200 OKSuccessfully retrieved queue-item status
400 Bad RequestInvalid request parameters
401 UnauthorizedAuthentication required
403 ForbiddenAccess denied
404 Not FoundQueue-item or agent not found

Response Body:

{
"sourceId": "f74f0f97-c999-42ce-8e96-b74daeceaf5c",
"queueItemId": "b6f450c3-46de-4e8c-85de-b9ab11b221ab",
"operationId": "478661db-5567-4d99-b484-cb405d29d327",
"createdOn": "2023-09-04T16:51:29.61Z",
"completedOn": "2023-09-04T16:51:29.61Z",
"finishedOn": "2023-09-04T16:51:31.728Z",
"status": "Failed",
"wasFailure": true,
"errorMessage": "Value 'None,Branch,Department,Team,,Workshop,Workroom' doesn't fit to expected format. (Parameter 'value')"
}

Example Request:

GET /api/v2/SourcingData/EnqueueData/status/b6f450c3-46de-4e8c-85de-b9ab11b221ab?agentId=my-agent

5. Cancel Queue Item

Cancels a queue-item in the input queue.

Endpoint: DELETE /api/v2/SourcingData/EnqueueData/cancel/{queueItemId}

Path Parameters:

ParameterTypeRequiredDescription
queueItemIdstringYesThe identifier of queue-item (obtained by start method)

Query Parameters:

ParameterTypeRequiredDescription
agentIdIntegrationAgentIdYesThe identifier of the integration agent
clientIdstringNoThe client identifier

Response Statuses:

Status CodeDescription
204 No ContentSuccessfully canceled the queue-item
400 Bad RequestInvalid request parameters
401 UnauthorizedAuthentication required
403 ForbiddenAccess denied
404 Not FoundQueue-item or agent not found

Example Request:

DELETE /api/v2/SourcingData/EnqueueData/cancel/35d5d447-b500-4828-8099-a26845c85cb8?agentId=my-agent

Migration from v1 to v2

Key Changes

Aspectv1v2
Agent IdentificationPath parameter sourceId (Guid)Query parameter agentId (IntegrationAgentId)
Client SupportNot availableOptional clientId query parameter
URL Structure/EnqueueDataBySourceId/{sourceId}/.../EnqueueData/...
AuthorizationBasic authorization responsesEnhanced with 401 and 403 responses

Example Migration

v1 Request:

POST /api/v1/SourcingData/EnqueueDataBySourceId/6a06af09-3d17-4bae-a9f4-37ebcaf7a873/start

v2 Request:

POST /api/v2/SourcingData/EnqueueData/start?agentId=my-agent

Notes

  • It is recommended to send larger data using multiple requests (e.g. use approximately 500 data-records in a single request) to avoid timeouts. You can use start/append methods to create and append data into a single queue-item.
  • Each queue-item represents a unit of work which is processed together, i.e. all data must be successfully transformed first, then data-records are stored. Otherwise the complete queue-item is finished with failure and no data are updated.
  • There is a technical limit for maximal size of data in queue-item: approximately 3000-4000 items (depending on JSON size).
  • When a queue-item contains less than 500 data-records, the queue-item can be processed synchronously (depending on statuses of other queue-items and current workload of processing engine). Otherwise the queue-item will be processed asynchronously. Check the response status code (201/202).