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/jobs¶a>
Queues job for a 3D printer. For more information, see the Print Jobs section.
If the callback_url
attribute is specified, your app will be notified via an HTTP POST with job status. When the job is first created, a test callback is sent to your app by calling your callback_url
with /support
appended. For example, if your callback_url
is http://mysampleapp.com/callback_handler
, the callback mechanism will send a test payload to http://mysampleapp.com/callback_handler/support
. Your app will need to respond with a JSON payload of {"callback":"supported"}
.
The callback will be called with an object like the following:
{
"printer_status": "printing",
"progress": "0.94",
"job_id": "01afb066-725e-4fcf-ba3f-40a551de3e97",
"job_progress": "0.94",
"job_status": "printing",
"data": {
"job_status": "printing",
"total_layers": "50",
"layer": "47",
"seconds_left": "60",
"temperature": "71",
"job_id": "01afb066-725e-4fcf-ba3f-40a551de3e97"
},
"job_name": "My new Bear",
"member_id": "FPEJMQHAG3NXE",
"printer_id": "2831",
"printer_name": "Testing"
}
Be careful to not confuse the callback URL here with the callback URL in your app’s registration for OAuth purposes.
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 printer ID |
Body Structure¶
The POST body is a single, flat JSON object with the following attributes:
Name |
Required |
Value Type |
Description |
---|---|---|---|
job_name | yes | string | Name for the Job |
printable_id | no | string: URN | ID of a printable file |
printable_url | no | string: URL | URL of a printable file; used if no printable_id is specified |
settings | no | object | Job settings for the 3D printer that override the default settings defined by the
profile_id during tray creation |
callback_url | no | string: URL | Callback URL |
callback_interval | no | int | the percentage interval at which the
callback_url will be calledFor example, if set to
20 , the callback_url will be called when the job is at
0%, 20%, 40%, 60%, 80%, and 100% completion.The default value is
0 , in which case the callback_url is called every time the
printer checks in. |
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)¶
A successful response returns a JSON object with the following attributes:
Field |
Type |
Description |
---|---|---|
printer_id | string: URN | The printer ID |
job_id | string: UUID | The job ID |
status | enum: string | The status of the job |
Examples¶
Queued Job Successfully Created Using Printable ID (200)¶
curl -X 'POST' -H 'Content-Type: application/json' -H 'Authorization: Bearer q9QBw38WE0p57RKMZcq2Snj2KVPR' -v 'https://developer.api.autodesk.com/ps/v1/print/printers/1092/jobs' -d '{
"job_name":"my_job",
"printable_id": "urn:adsk.objects:os.object:print-services-external/b1996dd1-4b7f-44d8-9040-01615530073c.tar.gz",
"callback_url": "http://mycallbackurl.com/mycallback",
"callback_interval": 10
}'
{
"printer_id": 1092,
"job_id": "4b5a3181-8997-4d6a-979f-e1af7eb5b545",
"status": "sent"
}
Queued Job Successfully Created Using Printable URL (200)¶
curl -X 'POST' -H 'Content-Type: application/json' -H 'Authorization: Bearer q9QBw38WE0p57RKMZcq2Snj2KVPR' -v 'https://developer.api.autodesk.com/ps/v1/print/printers/1092/jobs' -d '
{
"printable_url": "http://cdn.spark.com/print/a/stl",
"settings": {
"FirstApproachRPM": 6,
"FirstZLiftMicrons": 2000
}
}'
{
"printer_id": 1093,
"job_id": "4gfe3181-5372-4d6a-979f-e1af7eb5b545",
"status": "sent"
}