SmakeSmake API Docs
EndpointsMedia

Get a media

GET
/media/{id}

Returns the resource for an uploaded image or PDF file with id = x.

AuthorizationbearerAuth

Authorization

bearerAuth
AuthorizationBearer <token>

API token as bearer token — you receive a test and a live token, there is no switch between them. See Setup → Authentication and Setup → Test mode.

In: header

Path Parameters

id*integer

The ID of the resource.

Header Parameters

Accept*"application/json"

The API only responds with JSON — this header is mandatory on every request (see Setup → Headers).

Default"application/json"

Value in

  • "application/json"

Response Body

application/json

application/json

application/json

Request example
curl -X GET "https://example.com/media/0" \  -H "Accept: application/json"
{  "id": 1,  "is_test": 0,  "collection_name": "api-media-upload",  "file_name": "39b8196929f742e7bccab01a643b6524.jpeg",  "size": 42840,  "mime_type": "image/jpeg",  "download_url": "https://api.smake.io/v2/media/1/download",  "state": "completed",  "requested": null,  "failure_message": null,  "created_at": "2017-09-28T08:40:44+00:00",  "updated_at": "2017-09-28T08:40:44+00:00"}

Upload media POST

In the `Media` section you can upload image or PDF files to use them in other parts of the system by referencing the Media ID. The request body is the **raw file content**; set the `Content-Type` header to the file's mime type (and `Content-Length` to its size), e.g.: ``` POST /media HTTP/1.1 Content-Type: image/jpeg Content-Length: 42840 raw content ``` The following file formats are currently supported: | Type | Options | |----------|---------------------------------------| | JPG/JPEG | RGB, 360dpi recommended | | PNG | RGB, transparency, 360dpi recommended | | PDF | RGB, 360dpi recommended | **Warning:** The maximum file size is 51.2MB.

List production methods GET

The endpoint lists all available production methods that can be used for customizing. See [Design Variants](/docs/checkout/2022-02-01/endpoints/variants/designVariant), [Create Logos](/docs/checkout/2022-02-01/endpoints/logos/createLogo) and [Design in Order](/docs/checkout/2022-02-01/endpoints/orders/createOrder) ## List Returns a collection of production methods. ### Filtering You can filter your results as follows: ##### List production methods for specified id(s) * `/production-methods?filter[id]=1` * `/production-methods?filter[id]=1,2,3` ##### List production methods for a specified handle(s) * `/production-methods?filter[handle]=dtg` * `/production-methods?filter[handle]=dtg,embroidery` See: [Pagination](/docs/checkout/2022-02-01/basic/pagination), [Filtering](/docs/checkout/2022-02-01/basic/filtering)