Upload a category banner

POST /company/categories/@id/banner

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 category you want to upload a banner 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 Category banner upload

POST /company/categories/13201/banner HTTP/1.1
Host: api.bakeronline.be
Authorization: Bearer 05e9f564d9f1eaf57012b2e38b58ba93d7ffcb5ae203c762a895cbb97825356aade7271e933203b0de2e3fe78fb67b0ee6fe4cd042bdaf5275aa5dd43978db8f76f895b17e5f9536daea6ad17d2727c6d46465c47de34279e5d3b255e65edf991f7511df
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 Category banner extension check

POST /company/categories/@id/banner HTTP/1.1
Host: api.bakeronline.be
Authorization: Bearer 05e9f564d9f1eaf57012b2e38b58ba93d7ffcb5ae203c762a895cbb97825356aade7271e933203b0de2e3fe78fb67b0ee6fe4cd042bdaf5275aa5dd43978db8f76f895b17e5f9536daea6ad17d2727c6d46465c47de34279e5d3b255e65edf991f7511df
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
name [Language: String] Translated category name
description [Language: String] Description of this category
active Bool A boolean value
only_order_in_store Bool Whether this product can only get ordered in the store with a separate UI for the shop employees, and not in the public webshop
id Int ID of the category
banner Image? Nullable.
seo company.SeoData Optional. The category's webpage search engine metatags

Example response 1 Category banner upload

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

{
    "id": 13201,
    "name": {
        "nl": "MediumTurquoise"
    },
    "description": {
        "nl": "This is a random description"
    },
    "banner": {
        "resolutions": [
            {
                "src": "https://bakeronline.be/uploads/temp-uploads/v24/test.png",
                "width": 700,
                "height": 467
            }
        ]
    },
    "active": true,
    "only_order_in_store": false,
    "seo": {
        "title": [],
        "description": [],
        "url": []
    }
}

Example response 2 Category banner 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"
    }
]
1.5.0 stable