Important!
The 3D print API is shutting down on January 15, 2017. See our end of life notice for more information.
POST printers/:printer_id/command¶a>
Sends a command to a remote printer. Members can only send commands to printers they have registered with and for which they have the required scope relationship (is_printer_scoped
and is_job_scoped
).
For more information, see the Print Commands section.
This endpoint is asynchronous and initiates a command task that runs in the background, rather than halting execution of your program. The response returns a task_id
that you need to use to call the GET printers/command/:task_id endpoint, which returns the status of the issued command. When the task is complete, an object representing the result of the task is returned in the response.
Resource Information¶
Method and URI | POST https:/ |
Authentication Context | user context required |
Required OAuth Scopes | data:read data:write |
Data Format | JSON |
Request¶
HTTP Headers¶
Name |
Required |
Value Type |
Description |
---|---|---|---|
Authorization | yes | string | Must be Bearer <token> , where <token> is obtained via a three- |
Content-Type | yes | string | Must be application/json |
URI Parameters¶
Name |
Required |
Value Type |
Description |
---|---|---|---|
printer_id | yes | int | the ID of the printer to send the command to |
Body Structure¶
The POST body is a single, flat JSON object with the following attributes:
Name |
Required |
Value Type |
Description |
---|---|---|---|
command | yes | enum: string | the command to send |
job_id | no | string: UUID | the job identifier, required only for commands with the “Job” command scope (the pause , resume and cancel
commands) |
package_url | no | string: URL | the firmware URL for the firmware_upgrade command |
settings | no | object | printer-specific settings for the current job on the printer, only when sending the settings command |
Response¶
HTTP Status Code Summary¶
Code |
Message |
Meaning |
---|---|---|
200 | OK | Successful |
400 | Bad Request | Invalid request. E.g., the request could not be parsed. |
401 | Unauthorized | Invalid authorization header. E.g., user is not logged in, or cannot access resource. |
404 | Not Found | Endpoint does not exist. |
422 | Unprocessable Entity | Semantic errors |
429 | Precondition Required | Request rate limit exceeded |
500 | Internal Server Error | An unknown error occurred on the server. |
Body Structure (200)¶
The response body is a single, flat JSON object with the following attribute:
Field |
Type |
Description |
---|---|---|
task_id | string: UUID | the ID of the task |
Examples¶
Successful Resuming of a Job (200)¶
curl -X 'POST' -H 'Content-Type: application/json' -H 'Authorization: Bearer q9QBw38WE0p57RKMZcq2Snj2KVPR' -v 'https://developer.api.autodesk.com/ps/v1/print/printers/1092/command' -d '{
"command":"resume",
"job_id": "4b5a3181-8997-4d6a-979f-e1af7eb5b545"
}'
{
"task_id": "3098f187-62f1-426c-b192-8188b4700f36"
}
Successful Posting of Settings (200)¶
curl -X 'POST' -H 'Content-Type: application/json' -H 'Authorization: Bearer q9QBw38WE0p57RKMZcq2Snj2KVPR' -v 'https://developer.api.autodesk.com/ps/v1/print/printers/1092/command' -d '{
"job_id" : "12131132323",
"command" : "settings",
"settings" : {"MotorTimeoutScaleFactor": 1.6, "BurnInLayers" : 3 }
}'
{
"task_id": "07e212ca-7021-4945-8cdc-a4ea4ecf944c"
}