Request

Response

    WorkItems
    POST

    WorkItems

    ../../../../_images/v2_retired2.png

    Creates a new WorkItem.

    Resource Information

    Method and URI
    POST
    https://developer.api.autodesk.com/autocad.io/us-east/v2/WorkItems
    Authentication Context
    app only
    Required OAuth Scopes
    code:all
    Data Format
    JSON

    Request

    Headers

    Authorization*
    string
    Must be Bearer <token>, where <token> is obtained via OAuth
    Content-Type*
    string
    Must be application/json
    * Required

    Request

    Body Structure

    A WorkItem JSON object is passed as the request body.

    Expand all
    ActivityId*
    string
    Activity to be executed

    The value must match the Id attribute of the Activity object.
    Arguments*
    object
    Defines references to input and output arguments

    An Argument is a container of two sub-containers: InputArguments and OutputArguments.
    InputArguments
    object
    An array of Argument objects

    Each Argument object defines a set of input parameters that the service uses to prepare a logic “input” item (drawing, supporting file, script file, ...) along with specifying where and how to get the input.
    Resource
    string: URL
    Specifies the location of the resource; the value is generally a URL to download

    The URL needs to be pre-signed or you have to provide the Authorization header with a valid token via Headers.
    Name
    string
    Unique name of the input argument; must be unique in this InputArguments array

    Note: The special input argument named “$(HostDwg)” instructs the service to treat the downloaded resource of the argument as the host drawing in the AutoCAD core engine session.
    Headers
    array: string
    An array of “Name” - “Value” pairings that will be applied as HTTP request headers when the service tries to retrieve the input for a WorkItem.

    For example, if you specify {"Name":"Authorization", "Value":"Bearer xxxxxyyyyyzzz"}, the GET request sends Authorization="Bearer xxxxxyyyyyzzz" to the HTTP header.
    ResourceKind
    enum: string
    Specifies the kind of resource used; when left empty “Simple” is used

    Simple: Single remote resource is downloaded as-is; no further unpacking is performed.
    EtransmitPackage: Single remote resource is an AutoCAD eTransmit package. After the resource is downloaded locally, the contents are unpacked.
    RemoteFileResource: A cluster of remote resources, described as a RemoteFileResource object with relationships between these resources. The service walks-through the relationship graph and downloads all the resources described.
    ZipPackage: Remote resource is a single compressed file. After the resource is downloaded locally, the contents are unpacked to a working folder.
    Embedded: The “Resource” attribute is an in-line resource that conforms with the Data URI scheme. When such a resource is encountered, the file identified by the Resource field is downloaded locally. The Resource field should be of the form
    data:[<media-type>][;base64],<data>, and at present <media-type> must be application/json.
    Variadic: A partial resource to be completed on use. The Resource attribute is a base URI for one or more delay-downloaded resources when access is required, typically from within the underlying application (AutoCAD core engine).
    When access is requested, the application supplies missing URI fragments and/or query strings.
    StorageProvider
    string
    Type of storage in which the input resource come from; can be left empty

    Generic is currently the only valid value.
    HttpVerb
    enum: string
    HTTP operation for this input argument; valid values are GET or HEAD
    OutputArguments
    object
    An array of Argument objects that represent the output of the WorkItem after execution

    Each output item is typically uploaded to the location specified by the Resource field.
    Resource
    string: URL
    URL to publish a given output argument
    Name
    string
    Unique name of the output argument; must be unique in this OutputArguments array
    Headers
    array: string
    An array of “Name” - “Value” pairings that defines the HTTP header to use when publishing this output arguments.
    ResourceKind
    enum: string
    Specifies the kind of resource to be used; when left empty “Simple” is used

    Simple: Single remote resource is downloaded as-is; no further unpacking is performed.
    EtransmitPackage: Single remote resource is an AutoCAD eTransmit package. After the resource is downloaded locally, the contents are unpacked.
    RemoteFileResource: A cluster of remote resources, described as a RemoteFileResource object with relationships between these resources. The service walks-through the relationship graph and downloads all the resources described.
    ZipPackage: Remote resource is a single compressed file. After the resource is downloaded locally, the contents are unpacked to a working folder.
    Embedded: The “Resource” attribute is an in-line resource that conforms with the Data URI scheme. When such a resource is encountered, the file identified by the Resource field is downloaded locally. The Resource field should be of the form:
    data:[<media-type>][;base64],<data>, and at present <media-type> must be application/json.
    Variadic: A partial resource to be completed on-use. The Resource attribute is a base URI for one or more delay-downloaded resources when access is required, typically from within the underlying application (AutoCAD core engine).
    When access is requested, the application supplies missing URI fragments and/or query strings.
    StorageProvider
    string
    Type of storage to use for output; can be left empty

    Generic is currently the only valid value.
    HttpVerb
    enum: string
    HTTP operation for this output argument; valid values are PUT or POST
    Status
    enum: string
    Result of the executed task

    FailedEnvironmentSetup (-5): Indicates that the required Engine cannot be installed
    FailedUpload (-4): Indicates that any of the outputs have failed to upload
    FailedMissingOutput (-3): Indicates when any of the outputs are missing after the AcCoreConsole.exe has successfully returned
    FailedExecution (-2): Indicates that the AcCoreConsole.exe exited with a non-zero exit code

    This includes the following cases:
    1. Timeout; exit code is passed to Kill(<exitcode>)
    2. Crash; exit code is non-zero
    3. Input drawing fails to open; produces various non-zero exit codes

    FailedDownload (-1): Indicates that any of the inputs have failed to download
    Pending (0): Indicates that the WorkItem is still in the queue, no worker has started processing the WorkItem
    InProgress (1): Indicates that the WorkItem is being processed
    Succeeded (256): Indicates that execution of the WorkItem was successful
    StatusDetails
    object
    Wrapper object that contains a S3 item path for the internal reporting of the WorkItem
    Report
    string: URL
    URL to a downloadable report about the executed task
    AvailabilityZone
    string
    Geographical region in which the WorkItem is executed

    Note: This attribute is currently ignored.
    TimeQueued
    datetime: ISO 8601
    Time when the request entered the queue of the service; read-only

    Note: This attribute is automatically set by the server and cannot be specified in API requests.
    TimeInputTransferStarted
    datetime: ISO 8601
    Time when the request was picked up by the service “worker” to be executed; read-only

    Note: This attribute is automatically set by the server and cannot be specified in API requests.
    TimeScriptStarted
    datetime: ISO 8601
    Time when all the necessary resources were downloaded and the AutoCAD core engine was about to start; read-only

    Note: This attribute is automatically set by the server and cannot be specified in API requests.
    TimeScriptEnded
    datetime: ISO 8601
    Time when the AutoCAD core engine finished executing; read-only

    Note: This attribute is automatically set by the server and cannot be specified in API requests.
    TimeOutputTransferEnded
    datetime: ISO 8601
    Time when all the generated output was published; read-only

    Note: This attribute is automatically set by the server and cannot be specified in API requests.
    BytesTranferredIn
    int
    Total number of bytes that were downloaded as a result of executing the WorkItem request; read-only

    Note: This attribute is automatically set by the server and cannot be specified in API requests.
    BytesTranferredOut
    int
    Total number of bytes that were uploaded; read-only

    Note: This attribute is automatically set by the server and cannot be specified in API requests.
    Id*
    string
    Unique identifier for the WorkItem

    The value is generated by the API and is a GUID. The API does not assign the ID to the WorkItem until the WorkItem has been accepted by the API.
    Version
    int
    Version number of the WorkItem; should always be 1
    Timestamp
    datetime: ISO 8601
    Timestamp of the last modification, YYYY-MM-DDThh:mm:ss.ssZ format; read-only

    Note: This attribute is automatically set by the server and cannot be specified in API requests.
    * Required

    Response

    HTTP Status Code Summary

    201
    Created
    WorkItem successfully created
    400
    Bad Request
    Request could not be understood by the server due to malformed syntax
    401
    Unauthorized
    Access token is invalid
    404
    Not Found
    Resource cannot be found
    429
    Too Many Requests
    Rate limit exceeded; wait some time before retrying
    500
    Internal Server Error
    An unexpected error occurred on the server

    Response

    Body Structure (201)

    The new WorkItem JSON object is returned.

    Expand all
    ActivityId
    string
    Activity to be executed

    The value must match the Id attribute of the Activity object.
    Arguments
    object
    Defines references to input and output arguments

    An Argument is a container of two sub-containers: InputArguments and OutputArguments.
    InputArguments
    object
    An array of Argument objects

    Each Argument object defines a set of input parameters that the service uses to prepare a logic “input” item (drawing, supporting file, script file, ...) along with specifying where and how to get the input.
    Resource
    string: URL
    Specifies the location of the resource; the value is generally a URL to download

    The URL needs to be pre-signed or you have to provide the Authorization header with a valid token via Headers.
    Name
    string
    Unique name of the input argument; must be unique in this InputArguments array

    Note: The special input argument named “$(HostDwg)” instructs the service to treat the downloaded resource of the argument as the host drawing in the AutoCAD core engine session.
    Headers
    array: string
    An array of “Name” - “Value” pairings that will be applied as HTTP request headers when the service tries to retrieve the input for a WorkItem.

    For example, if you specify {"Name":"Authorization", "Value":"Bearer xxxxxyyyyyzzz"}, the GET request sends Authorization="Bearer xxxxxyyyyyzzz" to the HTTP header.
    ResourceKind
    enum: string
    Specifies the kind of resource used; when left empty “Simple” is used

    Simple: Single remote resource is downloaded as-is; no further unpacking is performed.
    EtransmitPackage: Single remote resource is an AutoCAD eTransmit package. After the resource is downloaded locally, the contents are unpacked.
    RemoteFileResource: A cluster of remote resources, described as a RemoteFileResource object with relationships between these resources. The service walks-through the relationship graph and downloads all the resources described.
    ZipPackage: Remote resource is a single compressed file. After the resource is downloaded locally, the contents are unpacked to a working folder.
    Embedded: The “Resource” attribute is an in-line resource that conforms with the Data URI scheme. When such a resource is encountered, the file identified by the Resource field is downloaded locally. The Resource field should be of the form data:[<media-type>][;base64],<data>, and at present <media-type> must be application/json.
    Variadic: A partial resource to be completed on use. The Resource attribute is a base URI for one or more delay-downloaded resources when access is required, typically from within the underlying application (AutoCAD core engine). When access is requested, the application supplies missing URI fragments and/or query strings.
    StorageProvider
    string
    Type of storage in which the input resource come from; can be left empty

    Generic is currently the only valid value.
    HttpVerb
    enum: string
    HTTP operation for this input argument; valid values are GET or HEAD
    OutputArguments
    object
    An array of Argument objects that represent the output of the WorkItem after execution

    Each output item is typically uploaded to the location specified by the Resource field.
    Resource
    string: URL
    URL to publish a given output argument
    Name
    string
    Unique name of the output argument; must be unique in this OutputArguments array
    Headers
    array: string
    An array of “Name” - “Value” pairings that defines the HTTP header to use when publishing this output arguments.
    ResourceKind
    enum: string
    Specifies the kind of resource to be used; when left empty “Simple” is used

    Simple: Single remote resource is downloaded as-is; no further unpacking is performed.
    EtransmitPackage: Single remote resource is an AutoCAD eTransmit package. After the resource is downloaded locally, the contents are unpacked.
    RemoteFileResource: A cluster of remote resources, described as a RemoteFileResource object with relationships between these resources. The service walks-through the relationship graph and downloads all the resources described.
    ZipPackage: Remote resource is a single compressed file. After the resource is downloaded locally, the contents are unpacked to a working folder.
    Embedded: The “Resource” attribute is an in-line resource that conforms with the Data URI scheme. When such a resource is encountered, the file identified by the Resource field is downloaded locally. The Resource field should be of the form: data:[<media-type>][;base64],<data>, and at present <media-type> must be application/json.
    Variadic: A partial resource to be completed on-use. The Resource attribute is a base URI for one or more delay-downloaded resources when access is required, typically from within the underlying application (AutoCAD core engine).
    When access is requested, the application supplies missing URI fragments and/or query strings.
    StorageProvider
    string
    Type of storage to use for output; can be left empty

    Generic is currently the only valid value.
    HttpVerb
    enum: string
    HTTP operation for this output argument; valid values are PUT or POST
    Status
    enum: string
    Result of the executed task

    FailedEnvironmentSetup (-5): Indicates that the required Engine cannot be installed
    FailedUpload (-4): Indicates that any of the outputs have failed to upload
    FailedMissingOutput (-3): Indicates when any of the outputs are missing after the AcCoreConsole.exe has successfully returned
    FailedExecution (-2): Indicates that the AcCoreConsole.exe exited with a non-zero exit code

    This includes the following cases:
    1. Timeout; exit code is passed to Kill(<exitcode>)
    2. Crash; exit code is non-zero
    3. Input drawing fails to open; produces various non-zero exit codes

    FailedDownload (-1): Indicates that any of the inputs have failed to download
    Pending (0): Indicates that the WorkItem is still in the queue, no worker has started processing the WorkItem
    InProgress (1): Indicates that the WorkItem is being processed
    Succeeded (256): Indicates that execution of the WorkItem was successful
    StatusDetails
    object
    Wrapper object that contains a S3 item path for the internal reporting of the WorkItem
    Report
    string: URL
    URL to a downloadable report about the executed task
    AvailabilityZone
    string
    Geographical region in which the WorkItem is executed

    Note: This attribute is currently ignored.
    TimeQueued
    datetime: ISO 8601
    Time when the request entered the queue of the service; read-only

    Note: This attribute is automatically set by the server and cannot be specified in API requests.
    TimeInputTransferStarted
    datetime: ISO 8601
    Time when the request was picked up by the service “worker” to be executed; read-only

    Note: This attribute is automatically set by the server and cannot be specified in API requests.
    TimeScriptStarted
    datetime: ISO 8601
    Time when all the necessary resources were downloaded and the AutoCAD core engine was about to start; read-only

    Note: This attribute is automatically set by the server and cannot be specified in API requests.
    TimeScriptEnded
    datetime: ISO 8601
    Time when the AutoCAD core engine finished executing; read-only

    Note: This attribute is automatically set by the server and cannot be specified in API requests.
    TimeOutputTransferEnded
    datetime: ISO 8601
    Time when all the generated output was published; read-only

    Note: This attribute is automatically set by the server and cannot be specified in API requests.
    BytesTranferredIn
    int
    Total number of bytes that were downloaded as a result of executing the WorkItem request; read-only

    Note: This attribute is automatically set by the server and cannot be specified in API requests.
    BytesTranferredOut
    int
    Total number of bytes that were uploaded; read-only

    Note: This attribute is automatically set by the server and cannot be specified in API requests.
    Id
    string
    Unique identifier for the WorkItem

    The value is generated by the API and is a GUID. The API does not assign the ID to the WorkItem until the WorkItem has been accepted by the API.
    Version
    int
    Version number of the WorkItem; should always be 1
    Timestamp
    datetime: ISO 8601
    Timestamp of the last modification, YYYY-MM-DDThh:mm:ss.ssZ format; read-only

    Note: This attribute is automatically set by the server and cannot be specified in API requests.

    Example

    WorkItem Successfully Created (201)

    Request

    curl -v 'https://developer.api.autodesk.com/autocad.io/us-east/v2/WorkItems'
      -X 'POST'
      -H 'Content-Type: application/json'
      -H 'Authorization: Bearer Jt43z2DJnsYuaAxI4R2iT84b3UPy'
      -d '
        {
          "@odata.type": "#ACES.Models.WorkItem",
          "Arguments": {
            "InputArguments": [{
              "Resource": "https://s3.amazonaws.com/AutoCAD-Core-Engine-Services/TestDwg/makeall.dwg?AWSAccessKeyId=AKIAIJFIKBQ63LIX6C2Q&Expires=1420099140&Signature=M08cnEcwClGjyNwwSll1GnaHhLw%3D",
              "Name": "HostDwg",
              "StorageProvider": "Generic"
            }],
            "OutputArguments": [{
              "Name": "Result",
              "StorageProvider": "Generic",
              "HttpVerb": "POST"
            }]
          },
          "ActivityId": "PlotToPDF",
          "Id": ""
        }'
    
    Show More

    Response

    HTTP/1.1 201 Created
    Cache-Control: no-cache
    Content-Type: application/json; charset=utf-8
    Date: Fri, 09 May 2014 23:14:49 GMT
    Expires: -1
    Location: https://developer.api.autodesk.com/autocad.io/us-east/v2/Activities('CreateALine')
    Pragma: no-cache
    Server: Microsoft-IIS/8.0
    X-AspNet-Version: 4.0.30319
    X-Powered-By: ASP.NET
    Content-Length: 579
    Connection: keep-alive
    
    {
      "@odata.context": "https://developer.api.autodesk.com/autocad.io/us-east/v2/$metadata#WorkItems/$entity",
      "ActivityId": "PlotToPDF",
      "Arguments": {
        "InputArguments": [{
          "Resource": "https://s3.amazonaws.com/AutoCAD-Core-Engine-Services/TestDwg/makeall.dwg",
          "Name": "HostDwg",
          "Headers": [],
          "ResourceKind": null,
          "StorageProvider": "Generic",
          "HttpVerb": null
        }],
        "OutputArguments": [{
          "Resource": null,
          "Name": "Result",
          "Headers": [],
          "ResourceKind": null,
          "StorageProvider": "Generic",
          "HttpVerb": "POST"
        }]
      },
      "Status": "Pending",
      "StatusDetails": {
        "Report": null
      },
      "AvailabilityZone": null,
      "TimeQueued": "2015-05-20T18:09:47.957112Z",
      "TimeInputTransferStarted": null,
      "TimeScriptStarted": null,
      "TimeScriptEnded": null,
      "TimeOutputTransferEnded": null,
      "BytesTranferredIn": null,
      "BytesTranferredOut": null,
      "Id": "9688d314d6e94bc682f901b468ca8dbc",
      "Version": 1,
      "Timestamp": "0001-01-01T00:00:00Z"
    }
    
    Show More