Upload a product photo

POST /company/products/@id/photo

Request

Authentication

This endpoint requires authentication.

Header Value
Authorization Set the value to Bearer + + access_token

URL parameters

Replace the @ keywords in the URL with their corresponding value.

A dictionary with fields

Field Type Description
id Int The ID of the product you want to upload a photo for

File upload

This endpoint requires uploaded files in the HTTP request. You can check the examples on the right for more information or read more about this on MDN.

Key Description
file Upload a single file

Example request 1 Product photo upload

POST /company/products/7117/photo HTTP/1.1
Host: api.bakeronline.be
Authorization: Bearer 2a3d50e2cb2685ad13019a5d07b90a7c585d7258350e4afab726b63836dafd8dba882588f4ea6f08aa30503d0d00442b0530669d95632bb3edaf861d835a8c1aab7065bfc1b63cd73d4d34e51b23d41c32d934637aa00646ccda372380326125e69859c2
X-VERSION: 1.5.0
Accept-Language: en-US,en;q=0.5
Content-Type: multipart/form-data;boundary="boundary"

--boundary
Content-Disposition: form-data; name="file"; filename="test.png"
Content-Type: image/jpeg

...<Binary file here depending on Content-Transfer-Encoding field>...
--boundary--

Example request 2 Product photo extension check

POST /company/products/@id/photo HTTP/1.1
Host: api.bakeronline.be
Authorization: Bearer 2a3d50e2cb2685ad13019a5d07b90a7c585d7258350e4afab726b63836dafd8dba882588f4ea6f08aa30503d0d00442b0530669d95632bb3edaf861d835a8c1aab7065bfc1b63cd73d4d34e51b23d41c32d934637aa00646ccda372380326125e69859c2
X-VERSION: 1.5.0
Accept-Language: en-US,en;q=0.5
Content-Type: multipart/form-data;boundary="boundary"

--boundary
Content-Disposition: form-data; name="file"; filename="test.txt"
Content-Type: image/jpeg

...<Binary file here depending on Content-Transfer-Encoding field>...
--boundary--

Response

Field Type Description
resolutions [Resolution] Array of Resolution
white_background Bool Optional. A boolean value

Example response 1 Product photo upload

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
Content-Length: 392

{
    "resolutions": [
        {
            "src": "https://bakeronline.be/uploads/temp-uploads/v239/250x200/test.png",
            "width": 300,
            "height": 200
        },
        {
            "src": "https://bakeronline.be/uploads/temp-uploads/v239/1080x720/test.png",
            "width": 700,
            "height": 467
        }
    ],
    "white_background": true
}

Example response 2 Product photo extension check

HTTP/1.1 400 Bad Request
Content-Type: application/json; charset=utf-8
Content-Length: 124

[
    {
        "code": "missing_field",
        "message": "Field id is required",
        "field": "parameters.id"
    }
]
Version update available Please adjust your integration to the latest stable version (1.5.2)
1.5.0 stable