[POST] Create Task
Use this request to create a new Task and add it to the processing queue.
Create Task
POST
/api/v1.0/external/sdtask/process
Body application/json CreateTaskRequest
CreateTaskRequest
displayName
string
(optional)
An optional display name for your task. A random one will be generated automatically if not provided.
description
string
(optional)
An optional description for your task.
workspaceId
integer
(optional)
batchId
integer
(optional)
The ID of the Batch to add this task to. Note that the Batch must belong to the workspace specified in this request (or the default workspace, if none is specified). To find the ID of your Batch, access the Batches screen and click Import -> API on the relevant Batch.
priority
integer
(optional)
Optional, automatically set to 1 (low). Either 1 or larger than 1, where 1 represents low priority, and > 1 high priority. There are only two priorities: low and high. Higher values for priority do not represent higher priority. High priority is only available for certain Organizations, and with intervention by the SmartDocumentor development team.
context
object
taskAssignment
object
(optional)
customFormValues
object
(optional)
An untyped object, used to pass custom form data to the Document Viewer in Advanced Edit mode. Only available to certain Organizations, and with intervention by the SmartDocumentor development team.
Working with context
context
The context object is fed directly to our AI algorithm during processing, and directly influences the detection results.
The context
property supports the following configuration values:
url
string
A required property, must point to either a public or SAS secured URL that grants sufficient access permissions to SmartDocumentor during the task's lifetime.
Any valid public or SAS secured URL.
transcriptLanguage
string
(optional, only in Transcription Workspaces)
Explicitely set the document language for transcription purposes, improving model performance. If this value is not included, then the model defaults to the language configured for the Workspace, under Advanced Settings.
pt-PT
, en-US
, fr-FR
, de-DE
, es-ES
splitTaskInChunks
boolean
(optional, not available in Template Workspaces)
true
or false
splitChunkDurationMinutes
integer
(optional, only in Transcription Workspaces)
Only when splitTaskInChunks
is set to true
. Maximum approximate duration of each split part, defaults to 10 minutes. Silence detection is used to check where it is safe to split audio and video. Each split part is only split when a suficiently large enough chunk of silence is detected, thus the effective duration may exceed the configured value.
Any integer above 0.
splitChunkNumberPages
integer
(optional, in all Workspaces except Transcripts and Templates)
Only when splitTaskInChunks
is set to true
. Maximum size, in pages, that each split document must have.
Any integer above 0.
Note that other data within context
or customFormValues
is validated. Only supported fields can be included.
Working with taskAssignment
taskAssignment
The taskAssignment
object defines which users can review a task and the order in which they must do so before the task being finished.
The taskAssignment
property supports the following configuration values:
assignedUsers
string[]
A required property, must contain a list of user email addresses to be added as task reviewers. Their order in the list will determine the sequence when a sequential review process is required.
Array of strings containing valid email address.
order
int
A required property, that determines what type of assignment order should be applied to the task.
Working with metadata
metadata
The metadata
object defines textual key-value pairs of information that the user may want to store. What is stored is up to the user however the following properties cause the application to trigger specific behavior.
SentByEmail
string
Email address of the user that has inserted the document/task in the system
Any valid email address
None
Document Size Limits
For text documents, the following limits apply:
Images must be larger than 50x50 pixels and smaller than 10000x10000 pixels.
PDFs must be smaller than 17x17 inches.
A document may begin processing before these limits are verified. It will transition to the ValidationErrorInvalidDimensions
status if it does not comply with these limits.
Additionally, when dealing with PDFs and OCR-enabled Workspaces, only the first 200 pages of the document will be processed. The remaining pages will contain no detections.
Uploading your own files
You can now upload your own files using the TUS Protocol - https://tus.io.
TUS is an open-source file upload protocol with widespread adoption by the community. It facilitates resumable uploads, with simple client and server implementations in many languages and frameworks.
To begin uploading content to SmartDocumentor, please choose a TUS Client in your language or framework of choice from the following page: https://tus.io/implementations. You may also find additional community client implementations around the web.
Here is an example implementation in C#, using the Tus.Net.Client
.NET Client (https://github.com/hoss-green/Tus.Net.Client).
Regardless of your client choice, you must always include the following details in your request:
A custom header,
Authorization
, in the format"Bearer {token}"
to authenticate the request with your access token.A metadata dictionary, containing two entries:
workspaceid
: the Workspace ID you wish to upload to. If null, will upload to the default workspace in your Organization.filetype:
the content type / MIME type of the file you are uploading, i.e application/pdf, image/png, image/jpeg, etc.
This example implementation only supports uploads up to 100MB, which is the server's maximum allowed upload chunk size. When working with other clients and/or larger files, you may set chunk size to a value under 100MB. For best performance, we recommend 95MB.
Other client implementations may differ from the example above in the way these properties are passed to the request.
Example Request
Responses
Response Body CreateTaskResponse
taskId
integer
The unique identifier assigned to your Task.
displayName
string
The display name you assigned to your Task, or an auto-generated one in case you did not provide a name.
description
string
(optional)
The description you provided to your Task.
externalId
string
(optional)
The External ID you assigned to your Task.
taskStatus
The processing status of this Task. The initial Task status is QueuedForPreProcessing
.
taskStatusText
string
A textual representation of the Task Status value for ease of use.
integrationStatus
The integration status of this Task. The initial Task integration status is Never
.
integrationStatusText
string
A textual representation of the Task Integration Status value for ease of use.
workspaceId
integer
The workspace ID you assigned to this Task, or the ID of the default Workspace in your Organization, if none was provided.
requestId
guid
Issued by the system and unique to the request just performed.
batchId
integer
(optional)
The ID of the Batch this task belongs to.
taskAssignment
object
(optional)
Last updated