Skip to content

Batch files upload

Request

This endpoint has been only renamed from "File upload" after we created new synchronous endpoint one file upload. Url and structure is unchanged

Performs file upload asynchronously.

Please note that order of files matter (result of job respects the order of images in request).

In case of specifying filename, keep in mind that extension is checked whether it respects file type.

The result can be found in job detail in resultUrl. The result is formed as normal API response:


{
    "data": {
        "images":[
            {
                "index": 0,
                "md5": "072c1a2005e17dcd3a3cca3d2c769264",
                "name": "kocka.png",
                "created": "2023-01-16T13:19:32+0100",
                "sourceUrl": "https://example.com/image.png"
            }
        ]
    },
    "errors": [
        {
            "errorCode": "file-upload-size-limit",
            "message": "Uploaded file size limit exceeded. Limit is 2 MB.",
            "instance": "data[1]"
        }
    ]
}

In the result's images section, there are successfully uploaded images with their info and with index field which is order of the image in the request (0-based indexing).

In the result's errors section, there are errors which occurred during some images upload and with number in brackets in data[0] in instance, which is order of the image in the request (0-based indexing).

See more about Files upload

See how Asynchronous requests work on our developer's portal.

Currently maximum of 50 files can be uploaded in one request. Current filesize limit per file is 2MB.

Security
shoptetAccessToken or shoptetPrivateApiToken
Headers
Content-Typestringrequired
Default:"application/json"
Bodyapplication/json
dataArray of objects, [ 1 .. 50 ] itemsrequired
curl -i -X POST \
  https://api.docs.shoptet.com/_mock/shoptet-api/openapi/api/system/files \
  -H 'Content-Type: application/json' \
  -H 'Shoptet-Access-Token: YOUR_API_KEY_HERE' \
  -d '{
    "data": [
      {
        "sourceUrl": "https://example.com/file.png",
        "name": "string"
      }
    ]
  }'

Responses

Accepted

Bodyapplication/json
dataobjectrequired
errorsArray of objects or null(Errors)required
metadataobject(Metadata)required
Response
{ "data": { "jobId": "ad24xod" }, "errors": [ {} ], "metadata": { "requestId": "019c8c34-64f3-7328-af43-bf1e34fa39d7" } }