Export For On-Demand Production
This guide will walk you through how to export a Design for on-demand production using Core3D's API via HTTP requests.
The result of this guide will be a ZIP file containing 300 DPI artwork that can be used on relevant on-demand platforms (Printful, Printify, etc.).
Note: You'll need an API token to perform any of these actions. See the Authentication section of the API Reference. We'll use
$TOKEN
as a placeholder for your API token in the examples below.
Contents
- Step 1 — Pick A Design
- Step 2 — Create an Export
- Step 3 — Check The Status
- Step 4 — Download The Results
Step 1 — Pick A Design
We'll need a design to export -- we'll use the design from the "generate a design" guide (with URI core3d:design:018d715f-b81f-79e7-a942-c9e4f3f5f1cc
).
Step 2 — Create an Export
We'll make a request to the API to create a new Export. There are two types of exports available to you at the moment:
- a "dtf" export will include artwork for all pattern pieces of a garment (think all-over print)
- a "dtg" export will include only the "zones" or "printable areas" defined for a model (think graphic tee)
- see the glossary for more info
Since our example design is an all-over print, we'll use the "dtf" type.
Request
$ curl -X POST https://api.core3d.io/v1/exports \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"design": "core3d:design:018d715f-b81f-79e7-a942-c9e4f3f5f1cc",
"type": "dtf"
}'
Response
{
// ... additional properties omitted
"id": "018f7e9f-8b19-7edc-8916-ce7edf87ea54",
"uri": "core3d:export:018f7e9f-8b19-7edc-8916-ce7edf87ea54",
"result": null,
"status": "pending"
}
Step 3 — Check The Status
We can poll the API using the id
or uri
from the last request until the export is complete. The status
will change from "pending" to "running", and we'll know it's done when the status
property reads "ok". If the status
reads "error", something went wrong.
Request
$ curl https://api.core3d.io/v1/exports/core3d:export:018f7e9f-8b19-7edc-8916-ce7edf87ea54 \
-H "Authorization: Bearer $TOKEN"
Response
{
// ... additional properties omitted
"id": "018f7e64-16bf-74e7-9b28-b891a7077f7c",
"uri": "core3d:upload-variant:018f7e64-16bf-74e7-9b28-b891a7077f7c",
"result": {
"id": "018f7e66-8c6c-7a49-bd50-c4b7fc11dd86",
"uri": "core3d:upload:018f7e66-8c6c-7a49-bd50-c4b7fc11dd86"
},
"status": "ok"
}
The Export is done. Let's download the results.
Step 4 — Download The Results
The result
property contains the identity information of the resulting Upload resource. We can use the id
or uri
property to request the full Upload resource and a URL to the ZIP. The contents of the ZIP are a series of 300 DPI images, one per pattern piece.
Request
$ curl https://api.core3d.io/v1/uploads/core3d:upload:018f7e66-8c6c-7a49-bd50-c4b7fc11dd86 \
-H "Authorization: Bearer $TOKEN"
Response
{
// ... additional properties omitted
"id": "018f7e66-8c6c-7a49-bd50-c4b7fc11dd86",
"uri": "core3d:upload:018f7e66-8c6c-7a49-bd50-c4b7fc11dd86",
"url": "https://static.production.core3d.io/..."
}