workitems/batch
The new WorkItems are always placed on the queue and later picked up by an engine.
The following limits apply:
Per-engine. These limits are enforced when the engine processes the workitem.
- Processing time (LimitProcessingTime)
- Total size of uncompressed bits for all referenced appbundles (LimitTotalUncompressedAppsSizePerActivity).
Service wide. These limits are enforced during workitem submission.
- Total processing time per month (LimitMonthlyProcessingTimeInHours).
- Maximum number of WorkItems in the request is 100.
- Activity has to be the same for all WorkItems.
Resource Information
Method and URI | POST https://developer.api.autodesk.com/da/us-east/v3/workitems/batch |
Authentication Context | user context optional |
Required OAuth Scopes | code:all |
Data Format | JSON |
Request
Headers
Authorization* string | Must be Bearer <token> , where <token> is obtained via either a two-legged or three-legged OAuth flow. |
Content-Type* string | Must be application/json |
Request
Body Structure
id string | Id. | |||||||||||||||||||||||||||||||||||||||||||||
activityId* string | Reference to the Activity that this WorkItem will invoke. Examples: MyPlot+Prod (an Activity created by the caller) or Autodesk.PlotToPdf (an Activity created by someone else and shared with this caller). | |||||||||||||||||||||||||||||||||||||||||||||
arguments object | Arguments of the WorkItem. Named parameters of an Activity have corresponding named arguments of a WorkItem. | |||||||||||||||||||||||||||||||||||||||||||||
* any of | Type: dictionary<string, *> | |||||||||||||||||||||||||||||||||||||||||||||
StringArgument object | Simple string argument. This class represents string argument both in the workitem and job. | |||||||||||||||||||||||||||||||||||||||||||||
value string | ||||||||||||||||||||||||||||||||||||||||||||||
XrefTreeArgument object | Represents an HTTP request argument in the workitem (see also BoundXrefTreeArgument). Note that when specifying the Activity with the parameter onDemand=’true’ this XrefTreeArgument will be ignored. | |||||||||||||||||||||||||||||||||||||||||||||
optional boolean | Argument optionality.
Failure to download optional input arguments is OK. Failure to find or upload optional output arguments is OK. Defaults to false. | |||||||||||||||||||||||||||||||||||||||||||||
localName string | Provides default name of the file or folder on the processing server for this argument. The “local name” of an argument is determined by the following algorithm:
| |||||||||||||||||||||||||||||||||||||||||||||
pathInZip string | Denotes the “main file” in a zip. This attribute together with the Autodesk.Das.Shared.Models.Parameter.Zip attribute determine how zip files are handled.
The following table describes the behavior:
| |||||||||||||||||||||||||||||||||||||||||||||
references array: XrefTreeArgument | ||||||||||||||||||||||||||||||||||||||||||||||
requestContent string | Define request content.
For example, to receive data, POST/PUT requires request body which can be passed by ‘requestContent’. | |||||||||||||||||||||||||||||||||||||||||||||
url* string | Url. | |||||||||||||||||||||||||||||||||||||||||||||
headers object | Headers. | |||||||||||||||||||||||||||||||||||||||||||||
* string | Type: dictionary<string, *> | |||||||||||||||||||||||||||||||||||||||||||||
verb enum:string | Defines the operation for a parameter. get, put, post, patch imply an HTTP operation on the url in the parameter. read implies that the string value of parameter should be read. get and read imply input parameters all others are output.
Possible values: get , head , put , post , patch , read | |||||||||||||||||||||||||||||||||||||||||||||
multiparts object | Provide multipart post method to upload the results and multiparts can be empty if there is no “parameter” to provide.
It supports Box, Google Drive and Amazon Simple Storage Service (S3) services. Examples of using argument “multiparts”: Box:
Google Drive:
Amazon Simple Storage Service (S3):
| |||||||||||||||||||||||||||||||||||||||||||||
* object | Type: dictionary<string, *> | |||||||||||||||||||||||||||||||||||||||||||||
signatures object | Signatures for various WorkItem attributes. | |||||||||||||||||||||||||||||||||||||||||||||
activityId string | Digital signature of the ActivityId. The client must supply this when using a 3-legged oauth token for submitting a WorkItem. | |||||||||||||||||||||||||||||||||||||||||||||
baseUrls array: object | Digitally signed base urls that are allowed in the WorkItem. The client may supply these when using a 3-legged oauth token for submitting a WorkItem. | |||||||||||||||||||||||||||||||||||||||||||||
url* string | The Url value. | |||||||||||||||||||||||||||||||||||||||||||||
signature* string | The signature calculated for Url. | |||||||||||||||||||||||||||||||||||||||||||||
limitProcessingTimeSec int | Max duration of processing in seconds per workitem (includes download and upload time). |
Response
HTTP Status Code Summary
200 OK | Successfully create a batch of new WorkItems. |
400 Bad Request | The request is invalid. |
403 Forbidden | The user is not authorized to create the WorkItem. |
413 | Payload is too large. |
Response
Body Structure (200)
status enum:string | Status value of a WorkItem.
Possible values: pending , inprogress , cancelled , failedLimitProcessingTime , failedDownload , failedInstructions , failedUpload , failedUploadOptional , success |
progress string | The current status of the workitem. |
reportUrl string | The detailed report about the workitem, report url is valid for 24 hours from first receiving it. |
stats object | Basic statistics about workitem processing. |
timeQueued datetime: ISO 8601 | The time in UTC when the workitem was queued. |
timeDownloadStarted datetime: ISO 8601 | The time in UTC when the system started processing the workitem by transferring input data to the processing node. |
timeInstructionsStarted datetime: ISO 8601 | The time in UTC when the system finished downloading input and started processing instructions from the Activity associated with this workitem. |
timeInstructionsEnded datetime: ISO 8601 | The time in UTC when the system finished executing instructions and started uploading outputs. |
timeUploadEnded datetime: ISO 8601 | The time in UTC when the system finished uploading outputs. |
timeFinished datetime: ISO 8601 | The time in UTC when the system finished the workitem and reported the status. |
bytesDownloaded int | The file size of bytes the job downloads for input. |
bytesUploaded int | The file size of bytes the job uploads for output. |
id string | A GUID used to identify the WorkItem submitted successfully. |
Example
Successfully create a batch of new WorkItems.
Request
curl -v 'https://developer.api.autodesk.com/da/us-east/v3/workitems/batch' \
-X 'POST' \
-H 'Authorization: Bearer AuIPTf4KYLTYGVnOHQ0cuolwCW2a' \
-H 'Content-Type: application/json' \
-d '[
{
"activityId": "owner.ChangeParams+prod",
"arguments": {
"InventorDoc": {
"url": "https://s3-us-east-1.amazonaws.com/inventorio-prod/documentation/APIBasics/Box.ipt"
},
"InventorParams": {
"url": "data:application/json,{\"height\":\"16 in\", \"width\":\"10 in\"}"
},
"OutputIpt": {
"url": "https://developer.api.autodesk.com/oss/v2/signedresources/2922c578-da22-4a35-a943-6cfeb4484009?region=US",
"headers": {
"Authorization": "",
"Content-type": "application/octet-stream"
},
"verb": "put"
},
"OutputBmp": {
"url": "https://developer.api.autodesk.com/oss/v2/signedresources/a4717873-88db-49c1-9f41-98705a199622?region=US",
"headers": {
"Authorization": "",
"Content-type": "application/octet-stream"
},
"verb": "put"
}
}
}
]'
Response
[
{
"status": "pending",
"stats": {
"timeQueued": "2022-01-01T00:00:00Z"
},
"id": "wi1234"
}
]