Activities
POST
Activities
Creates a new Activity.
Resource Information
| Method and URI | POST https://developer.api.autodesk.com/autocad.io/us-east/v2/Activities |
| 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
Expand all
| AppPackages* array: string | IDs of the AppPackages to reference
If a custom Activity uses only native AutoCAD commands, this attribute should be empty.
|
| HostApplication* string | Name of the application to execute a specified WorkItem
By default, this field should be empty. When the field is empty, the AutoCAD core engine (accoreconsole.exe) is used. A client can specify a RealDWG host application to carry out a WorkItem. Host applications are typically submitted via custom AppPackages
|
| RequiredEngineVersion* enum: string | Version of the AutoCAD core engine to execute the Activity. Possible values:
20.1, 21.0, 22.0.Note: Use the
ACADVER system variable within your local install of the AutoCAD program to see which version you are using locally. |
| Parameters* object | Input and output parameters that map the names of actual drawings to the drawing names specified in the
Instruction objectParameters is a container object that contains two sub-containers: InputParameters and OutputParameters. Each container is an array of Parameter objects. A Parameter object is closely related to an Argument object in a WorkItem that defines the general in
and output setup of a WorkItem.
For example, if an Activity specifies an input Parameter with a name of “MyParameter” and it’s not optional, then any WorkItem that targets this Activity has to have an input Argument with the same name.
|
| InputParameters* array:object | Array of input Argument objects
|
| InputParameters[i]* object | The ith element of the array: an input argument object.
|
| Name* string | Name of an input Argument object; must be unique within this InputParameters array
|
| LocalFileName* string | File name for a locally saved WorkItem input Argument after the resource has been downloaded
|
| Optional bool | Specifies whether an input Argument can be missing
If the value is
true, the missing Argument with the same name of this Parameter is allowed. |
| OutputParameters* array:object | Array of output Argument objects
|
| OutputParameters[i]* object | The ith element of the array: an output argument object.
|
| Name* string | Name of an output Argument object; must be unique within this OutputParameters array
|
| LocalFileName* string | Name of a locally available file that the Publish process is looking for to upload for this output Argument
|
| Optional bool | Specifies whether an output Argument can be missing
If the value is
true, the missing Argument with the same name of this Parameter is allowed. |
| Instruction* object | Describes the actions to be taken
|
| CommandLineParameters string | Additional command line parameters that are passed from the service worker to the new session of the AutoCAD core engine
|
| Script* string | Contents that the service worker uses to create an AutoCAD script file locally for the AutoCAD core engine to execute
|
| AllowedChildProcesses* array: object | Child processes that will be spawned by the Activity
Note: Any spawned child processes not specified here are disabled.
|
| IsPublic* bool | Specifies whether the Activity can be publicly targeted
A public Activity can be used by clients outside of your account.
Note: Only one Activity with the same “Id” (or name) can be public.
|
| Version* int | Version number of the Activity
|
| Description string | Additional details about the Activity; optional
|
| Id* string | Name of the Activity
The name is used to associate the Activity to a WorkItem. The name of the Activity must be assigned to the WorkItem’s ActivityId attribute.
|
* Required
Response
HTTP Status Code Summary
| 201 Created | Activity successfully created |
| 302 Found | An activity with the same ID already exists; use PUT or PATCH to update it |
| 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)
Expand all
| AppPackages array: string | IDs of the AppPackages to reference
If a custom Activity uses only native AutoCAD commands, this attribute should be empty.
|
| HostApplication string | Name of the application to execute a specified WorkItem
By default, this field should be empty. When the field is empty, the AutoCAD core engine (accoreconsole.exe) is used. A client can specify a RealDWG host application to carry out a WorkItem. Host applications are typically submitted via custom AppPackages
|
| RequiredEngineVersion enum: string | Version of the AutoCAD core engine to execute the Activity. Possible values:
20.1, 21.0, 22.0.Note: Use the
ACADVER system variable within your local install of the AutoCAD program to see which version you are using locally. |
| Parameters object | Input and output parameters that map the names of actual drawings to the drawing names specified in the
Instruction objectParameters is a container object that contains two sub-containers: InputParameters and OutputParameters. Each container is an array of Parameter objects. A Parameter object is closely related to an Argument object in a WorkItem that defines the general in
and output setup of a WorkItem.
For example, if an Activity specifies an input Parameter with a name of “MyParameter” and it’s not optional, then any WorkItem that targets this Activity has to have an input Argument with the same name.
|
| InputParameters array:object | Array of input Argument objects
|
| InputParameters[i] object | The ith element of the array: an input argument object.
|
| Name string | Name of an input Argument object; must be unique within this InputParameters array
|
| LocalFileName string | File name for a locally saved WorkItem input Argument after the resource has been downloaded
|
| Optional bool | Specifies whether an input Argument can be missing
If the value is
true, the missing Argument with the same name of this Parameter is allowed. |
| OutputParameters array:object | Array of output Argument objects
|
| OutputParameters[i] object | The ith element of the array: an output argument object.
|
| Name string | Name of an output Argument object; must be unique within this OutputParameters array
|
| LocalFileName string | Name of a locally available file that the Publish process is looking for to upload for this output Argument
|
| Optional bool | Specifies whether an output Argument can be missing
If the value is
true, the missing Argument with the same name of this Parameter is allowed. |
| Instruction object | Describes the actions to be taken
|
| CommandLineParameters string | Additional command line parameters that are passed from the service worker to the new session of the AutoCAD core engine
|
| Script string | Contents that the service worker uses to create an AutoCAD script file locally for the AutoCAD core engine to execute
|
| AllowedChildProcesses array: object | Child processes that will be spawned by the Activity
Note: Any spawned child processes not specified here are disabled.
|
| IsPublic bool | Specifies whether the Activity can be publicly targeted
A public Activity can be used by clients outside of your account.
Note: Only one Activity with the same “Id” (or name) can be public.
|
| Version int | Version number of the Activity
|
| Timestamp datetime: ISO 8601 | Timestamp of the last modification,
YYYY-MM-DDThh:mm:ss.ssZ format; read-onlyNote: This attribute is automatically set by the server and cannot be specified in API requests.
|
| Description string | Additional details about the Activity; optional
|
| Id string | Name of the Activity
The name is used to associate the Activity to a WorkItem. The name of the Activity must be assigned to the WorkItem’s ActivityId attribute.
|
Example
New Activity Successfully Created (201)
Request
curl -v 'https://developer.api.autodesk.com/autocad.io/us-east/v2/Activities'\
-X 'POST' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer Jt43z2DJnsYuaAxI4R2iT84b3UPy' \
-d ' \
{
"HostApplication": "",
"RequiredEngineVersion": "22.0",
"Parameters": {
"InputParameters": [{
"Name": "HostDwg",
"LocalFileName": "$(HostDwg)"
}],
"OutputParameters": [{
"Name": "Result",
"LocalFileName": "result.dwg"
}]
},
"Instruction": {
"CommandLineParameters": null,
"Script": "_tilemode 1 _line 0,0 1,1 _save result.dwg\n"
},
"Version": 1,
"Id": "CreateALine"
}'
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#Activities/$entity",
"AppPackages": [],
"HostApplication": "",
"RequiredEngineVersion": "22.0",
"Parameters": {
"InputParameters": [{
"Name": "HostDwg",
"LocalFileName": "$(HostDwg)"
}],
"OutputParameters": [{
"Name": "Result",
"LocalFileName": "result.dwg"
}]
},
"Instruction": {
"CommandLineParameters": null,
"Script": "_tilemode 1 _line 0,0 1,1 _save result.dwg\n"
},
"AllowedChildProcesses": [],
"IsPublic": false,
"Id": "CreateALine",
"Version": 1,
"Timestamp": "0001-01-01T00:00:00Z",
"Description": null
}
Show More