POST /company/shops/@id/avatar
This endpoint requires authentication.
Header | Value |
---|---|
Authorization | Set the value to Bearer + + access_token |
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 |
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 |
POST /company/shops/123/avatar HTTP/1.1
Host: api.bakeronline.be
Authorization: Bearer 2eb3d1eca54d6dd63e60395d96b1dc508607f1d91397669d4530e74a800950907448c5954bb0ed658ac8dd127e3500a1872244e60c84757d00daedbae88de2bb480f14fc4cb77e998067833a450c17097fb2ee201f41e8a1423dfceba5657d7068ff3d35
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--
POST /company/shops/124/avatar HTTP/1.1
Host: api.bakeronline.be
Authorization: Bearer 2eb3d1eca54d6dd63e60395d96b1dc508607f1d91397669d4530e74a800950907448c5954bb0ed658ac8dd127e3500a1872244e60c84757d00daedbae88de2bb480f14fc4cb77e998067833a450c17097fb2ee201f41e8a1423dfceba5657d7068ff3d35
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--
POST /company/shops/123/avatar HTTP/1.1
Host: api.bakeronline.be
Authorization: Bearer 2eb3d1eca54d6dd63e60395d96b1dc508607f1d91397669d4530e74a800950907448c5954bb0ed658ac8dd127e3500a1872244e60c84757d00daedbae88de2bb480f14fc4cb77e998067833a450c17097fb2ee201f41e8a1423dfceba5657d7068ff3d35
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--
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. |
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
Content-Length: 949
{
"id": 123,
"name": "Sinful Temptations",
"active": true,
"address": {
"street": "Hajjihof",
"nr": "84",
"zipcode": "3271",
"city": "Nieuwpoort",
"country": "BE",
"position": {
"latitude": 51.05,
"longitude": 3.71667
}
},
"avatar": {
"resolutions": [
{
"src": "https://bakeronline.be/uploads/shop-avatars/123/180x180/adriaensen-adams-beerse.jpg",
"width": 182,
"height": 180
},
{
"src": "https://bakeronline.be/uploads/shop-avatars/123/360x360/adriaensen-adams-beerse.jpg",
"width": 300,
"height": 296
}
]
},
"banner": null,
"allow_comments": false,
"allow_orders": true,
"delivery_use_intervals": false,
"categories": [],
"category_groups": []
}
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
Content-Length: 956
{
"id": 124,
"name": "The Pastry Sheet",
"active": true,
"address": {
"street": "Lefebvresingel",
"nr": "96",
"zipcode": "6980",
"city": "Zottegem",
"country": "BE",
"position": {
"latitude": 51.260197,
"longitude": 4.402771
}
},
"avatar": {
"resolutions": [
{
"src": "https://bakeronline.be/uploads/shop-avatars/124/180x180/adriaensen-adams-beerse.jpg",
"width": 182,
"height": 180
},
{
"src": "https://bakeronline.be/uploads/shop-avatars/124/360x360/adriaensen-adams-beerse.jpg",
"width": 300,
"height": 296
}
]
},
"banner": null,
"allow_comments": false,
"allow_orders": true,
"delivery_use_intervals": false,
"categories": [],
"category_groups": []
}
HTTP/1.1 400 Bad Request
Content-Type: application/json; charset=utf-8
Content-Length: 73
[
{
"code": "upload-error",
"message": "2096"
}
]