Upload a shop avatar

POST /company/shops/@id/avatar

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 shop you want to upload an avatar 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 Shop avatar upload

POST /company/shops/171/avatar HTTP/1.1
Host: api.bakeronline.be
Authorization: Bearer f3df01ceab620467b2e787ca0f793b8b6675c8c36eac0a3f09d7999f0f5509f9d73262742ff3fd443fc5b13ad16bb7aa53deb9aadb8b9048b67911fd51789899e2b0c8c303120c8d3fd8c71400cb91414fb3e4fded3f2123159cc3f7d457959fa47bb92c
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="adriaensen-adams-beerse.jpg"
Content-Type: image/png

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

Example request 2 Replace shop avatar

POST /company/shops/172/avatar HTTP/1.1
Host: api.bakeronline.be
Authorization: Bearer f3df01ceab620467b2e787ca0f793b8b6675c8c36eac0a3f09d7999f0f5509f9d73262742ff3fd443fc5b13ad16bb7aa53deb9aadb8b9048b67911fd51789899e2b0c8c303120c8d3fd8c71400cb91414fb3e4fded3f2123159cc3f7d457959fa47bb92c
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="adriaensen-adams-beerse.jpg"
Content-Type: image/png

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

Example request 3 Shop avatar extension check

POST /company/shops/171/avatar HTTP/1.1
Host: api.bakeronline.be
Authorization: Bearer f3df01ceab620467b2e787ca0f793b8b6675c8c36eac0a3f09d7999f0f5509f9d73262742ff3fd443fc5b13ad16bb7aa53deb9aadb8b9048b67911fd51789899e2b0c8c303120c8d3fd8c71400cb91414fb3e4fded3f2123159cc3f7d457959fa47bb92c
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/png

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

Response

Field Type Description
name String Name of the shop (not translateable for now)
active Bool A boolean value
address Address.detailed An address
allow_comments Bool A boolean value
allow_orders Bool A boolean value
delivery_use_intervals Bool A boolean value
categories [company.Category.simple] List of the categories of all the categories visible for the shop
category_groups [company.CategoryGroup] List of the category groups linked to the shop. More information can be found on the category group documentation page.
id Int ID of the shop
avatar Image? Nullable.
banner Image? Nullable.

Example response 1 Shop avatar upload

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

{
    "id": 171,
    "name": "Slow Dough",
    "active": true,
    "address": {
        "street": "Gillesboulevard",
        "nr": "33",
        "zipcode": "3460",
        "city": "Dinant",
        "country": "BE",
        "position": {
            "latitude": 50.8503396,
            "longitude": 4.3517103
        }
    },
    "avatar": {
        "resolutions": [
            {
                "src": "https://bakeronline.be/uploads/shop-avatars/171/180x180/adriaensen-adams-beerse.jpg",
                "width": 182,
                "height": 180
            },
            {
                "src": "https://bakeronline.be/uploads/shop-avatars/171/360x360/adriaensen-adams-beerse.jpg",
                "width": 300,
                "height": 296
            }
        ]
    },
    "banner": null,
    "allow_comments": true,
    "allow_orders": true,
    "delivery_use_intervals": false,
    "categories": [],
    "category_groups": []
}

Example response 2 Replace shop avatar

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

{
    "id": 172,
    "name": "The Torpedough",
    "active": true,
    "address": {
        "street": "Delfossesteeg",
        "nr": "81",
        "zipcode": "5377",
        "city": "Blankenberge",
        "country": "BE",
        "position": {
            "latitude": 51.260197,
            "longitude": 4.402771
        }
    },
    "avatar": {
        "resolutions": [
            {
                "src": "https://bakeronline.be/uploads/shop-avatars/172/180x180/adriaensen-adams-beerse.jpg",
                "width": 182,
                "height": 180
            },
            {
                "src": "https://bakeronline.be/uploads/shop-avatars/172/360x360/adriaensen-adams-beerse.jpg",
                "width": 300,
                "height": 296
            }
        ]
    },
    "banner": null,
    "allow_comments": true,
    "allow_orders": true,
    "delivery_use_intervals": false,
    "categories": [],
    "category_groups": []
}

Example response 3 Shop avatar extension check

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

[
    {
        "code": "upload-error",
        "message": "2096"
    }
]
1.5.0 stable