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.
#Upload
The following file formats are currently supported:
| Type |
Options |
| JPG/JPEG |
RGB, 360dpi recommended |
| PNG |
RGB, transparency, 360dpi recommended |
| PDF |
RGB, 360dpi recommended |
The maximum file size is 51.2MB.
#Example
POST /media HTTP/1.1
Content-Type: image/jpeg
Content-Length: 42840
raw content
{
"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"
}
#Get
Returns the resource for an uploaded image or PDF file with id = x.
#Example
GET /media/1 HTTP/1.1
{
"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"
}