POST /pictures/preview-files/{instance_id}

Main resource to add a preview. It stores the preview file and generates three picture files (thumbnails) matching preview when it's possible, a square thumbnail, a rectangle thumbnail and a midsize file.

Path parameters

  • instance_id string(uuid) Required

    Preview file unique identifier

Responses

  • 201 application/json

    Preview file added successfully

    Hide response attributes Show response attributes object
    • id string(uuid)

      Preview file unique identifier

    • extension string

      File extension

    • file_size integer

      File size in bytes

  • 400

    Wrong file format or normalization failed

POST /pictures/preview-files/{instance_id}
curl -X POST "http://api.example.com/pictures/preview-files/a24a6ea4-ce75-4665-a070-57453082c25" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Accept: application/json"
import requests

url = "http://api.example.com/pictures/preview-files/a24a6ea4-ce75-4665-a070-57453082c25"
headers = {
    "Authorization": "Bearer YOUR_API_TOKEN",
    "Accept": "application/json"
}
params = {}
payload = None

response = requests.post(
    url,
    headers=headers,
    params=params,
    json=payload
)

response.raise_for_status()

if response.content:
    print(response.json())
curl \
 --request POST 'http://api.example.com/pictures/preview-files/a24a6ea4-ce75-4665-a070-57453082c25' \
 --header "Authorization: $API_KEY"
Response examples (201)
{
  "id": "a24a6ea4-ce75-4665-a070-57453082c25",
  "extension": "png",
  "file_size": 1024000
}