Allows a Workflow Import process to be started via an API call, rather than uploading a file via the UI.
Introduced in 11.0.33.
This API is intended for internal use only at this time.
We will probably open it up for 3rd party access in the future, after we’ve finished internal evaluation.
Overview
The Workflow Import Queue is a Workflow-enabled bulk import tool that lets users upload CSV files through the web UI to import/update data.
This API is an alternative way of starting an import process; instead of a user uploading a CSV file through the browser, and API client sends a JSON payload to the API endpoint.
The end result is the same: in both cases, a WORKFLOW_IMPORT_QUEUE_BATCH
is created with one row per imported data record and is then processed on a background queue.
Supported features
This is an alternative way of getting data into the import queue, but once the data is in the queue it supports the full set of Workflow Import Queue functionality.
The main difference is that the UI validates the data, gives the user a summary of what operations will be performed, and waits for user confirmation before actually processing the data.
There is no “prompt for confirmation” element to this API call; the posted data is added directly to the processing queue.
Using the API
Calling this API requires an API Key with the BeginWorkflowImportProcess
permission.
The key should be passed using the “apikey” authorization scheme.
Authorization: apikey xxxxxxxxxxxxxxxxx
HTTP Request
For implementation reasons, this API endpoint uses querystring parameters AND a request body.
The querystring parameters provide some control data, and the request body contains the data to be imported.
The URI provides control data:
POST /API/WorkflowImportQueue/CreateBatch ?importProcessId={id} &creationPath={string} &sendSuccessEmailTo={email} &sendFailureEmailTo={email}
importProcessId
- the ID of the Workflow Import Queue "file type" to use;creationPath
- (optional) a string, up to 10 characters in length, that identifiers the system calling the API. This is used to track which Batches were created through which integrations. This value, if provided, is prefixed with “IMPORT_QUEUE_API:” before being saved in the database.sendSuccessEmailTo
- (optional) an email address to notify of a successful import processsendFailureEmailTo
- (optional) an email address to notify in any records fail to process
The request body contains the data to import, using the JSON Lines format.
{ JSON data row 1, on single line } { JSON data row 2, on single line } ...
Each element in that array is the equivalent to a data row in an uploaded CSV file.
In order to support large number of records in an API call, the request body must use the JSON Lines format or the request will fail.
HTTP Response
The HTTP response contains the WORKFLOW_IMPORT_QUEUE_BATCH_ID
that can be used to locate it in the system, as well as a hyperlink to the results in the UI.
{ queueBatchId: "abc-def-123", queueBatchDetails: "https://www.someLB.com/Admin/Whatever?batchId=abc-def-123" }
Error messages
Error | Reason / How to fix |
---|---|