Important!
The 3D print API is shutting down on January 15, 2017. See our end of life notice for more information.
POST trays/generate-printable¶a>
Outputs a tray to a printable file ready for transmission to a printer.
Content is printer-specific:
- For FDM printers, it is a variant of G-code that is packaged in a format appropriate to the printer.
- For DLP printers, the file is a collection of images and metadata.
You need to call the POST trays/prepare endpoint before calling this endpoint and the tray’s ready
attribute must be true
.
Note that this endpoint is asynchronous and initiates a 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 tasks/:id endpoint, which retreives the new tray object.
When the task completes, a file_id
representing the URN of the file can be used as the printable_id
attribute to create jobs with the POST printers/:printer_id/jobs endpoint.
To download the printable file, call the GET buckets/:bucketKey/objects/:objectName endpoint in the Data Management API.
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 |
Body Structure¶
The POST body is a single, flat JSON object with the following attribute:
Name |
Required |
Value Type |
Description |
---|---|---|---|
id | yes | string: UUID | identifier of the tray from which to generate a printable file |
Response¶
HTTP Status Code Summary¶
Code |
Message |
Meaning |
---|---|---|
202 | Accepted | Successfully created a printable generation task |
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 (202)¶
The response body is a single, flat JSON object with the following attributes:
Field |
Type |
Description |
---|---|---|
id | string: UUID | Task ID |
status | enum: string | Possible values: running , done , and error |
progress | float | A value between 0 (not started) and 1 (complete) indicating percentage complete |
result | object | The response if status is done |
error | object | The error message if status is error |
Examples¶
Generate Printable File Task Successfully Created (202)¶
curl -X 'POST' -H 'Authorization: Bearer B9PFty7vAFzzAe4mWpF7CshVZY3C' -H 'Content-Type: application/json' -v 'https://developer.api.autodesk.com/ps/v1/print/trays/generatePrintable' -d '{
"id":"7c352be9-663b-47bd-a7d9-f230683ecdf2"
}'
{
"id": "1ebef18f-7454-490b-87ae-ccce22913e9e",
"progress": 0,
"status": "running",
"task_update_time": "2016-06-06T06:45:02.342Z"
}
For an example of a completed task result, see the Examples section in the GET tasks/:id endpoint documentation.