latestOpenAPI 3.0.02026-08-105585620.8 KB
18e2f2e178dd
File Library API
Add a new file
Adds a new File to the library by providing URL of the file.
If a file with identical URL already exists, then the original file is returned. If a file does not exist, a new file is created.
See examples
post/files
Headers
X-PF-Store-Idstring
Use this to specify which store you want to use (required only for account level token).
The store IDs can be retrieved with the Get basic information about stores endpoint.
Request body
Example request
{
"type": "default",
"id": 10,
"url": "https://www.example.com/files/tshirts/example.png",
"options": [
{
"id": "template_type",
"value": "native"
}
],
"hash": "ea44330b887dfec278dbc4626a759547",
"filename": "shirt1.png",
"mime_type": "image/png",
"size": 45582633,
"width": 1000,
"height": 1000,
"dpi": 300,
"status": "ok",
"created": 1590051937,
"thumbnail_url": "https://files.cdn.printful.com/files/ea4/ea44330b887dfec278dbc4626a759547_thumb.png",
"preview_url": "https://files.cdn.printful.com/files/ea4/ea44330b887dfec278dbc4626a759547_thumb.png",
"visible": true
}Response
OK
Example response
{
"code": 200,
"result": {
"type": "default",
"id": 10,
"url": "https://www.example.com/files/tshirts/example.png",
"options": [
{
"id": "template_type",
"value": "native"
}
],
"hash": "ea44330b887dfec278dbc4626a759547",
"filename": "shirt1.png",
"mime_type": "image/png",
"size": 45582633,
"width": 1000,
"height": 1000,
"dpi": 300,
"status": "ok",
"created": 1590051937,
"thumbnail_url": "https://files.cdn.printful.com/files/ea4/ea44330b887dfec278dbc4626a759547_thumb.png",
"preview_url": "https://files.cdn.printful.com/files/ea4/ea44330b887dfec278dbc4626a759547_thumb.png",
"visible": true
}
}