Get statistics

GET /dashboard/statistics

Request

Authentication

This endpoint requires authentication.

Header Value
Authorization Set the value to Bearer + + access_token

Query string (URL)

Append the querystring with following properties to the URL.

A dictionary with fields

Field Type Description
select Dictionary Specify which statistics you want to receive
start Timestamp Start timestamp
end Timestamp End timestamp
countries [Country] Optional. Filter statistics by country

Example request 1 Get all stats from all time

GET /dashboard/statistics?select%5Bshop_amount%5D=1&select%5Border_amount%5D=1&select%5Border_price%5D=1&select%5Bactive_users%5D=1&start=0&end=1608038822 HTTP/1.1
Host: api.bakeronline.be
Authorization: Bearer be69566d269ad96dd41811bc911ad5bbfe68feaa99b93bcd1b8385bff176ca8ba1efbd321de3aa96cf132224929cd510ec12a7595e8f5574d9b804db7edae7974fa302d216a70756633fa9384533d9b33e1b251caa9cf43b1d04c5aecede414dda483c87
X-VERSION: 1.5.0
Accept-Language: en-US,en;q=0.5

Example request 2 Only request a part of the data

GET /dashboard/statistics?select%5Border_amount%5D=1&start=0&end=1608038823 HTTP/1.1
Host: api.bakeronline.be
Authorization: Bearer be69566d269ad96dd41811bc911ad5bbfe68feaa99b93bcd1b8385bff176ca8ba1efbd321de3aa96cf132224929cd510ec12a7595e8f5574d9b804db7edae7974fa302d216a70756633fa9384533d9b33e1b251caa9cf43b1d04c5aecede414dda483c87
X-VERSION: 1.5.0
Accept-Language: en-US,en;q=0.5

Example request 3 Only request for today

GET /dashboard/statistics?select%5Border_amount%5D=1&select%5Bshop_amount%5D=1&start=1608035222&end=1608038822 HTTP/1.1
Host: api.bakeronline.be
Authorization: Bearer be69566d269ad96dd41811bc911ad5bbfe68feaa99b93bcd1b8385bff176ca8ba1efbd321de3aa96cf132224929cd510ec12a7595e8f5574d9b804db7edae7974fa302d216a70756633fa9384533d9b33e1b251caa9cf43b1d04c5aecede414dda483c87
X-VERSION: 1.5.0
Accept-Language: en-US,en;q=0.5

Example request 4 Wait for update

GET /dashboard/statistics?select%5Border_amount%5D=1&start=1608035222&end=1608038822 HTTP/1.1
Host: api.bakeronline.be
Authorization: Bearer be69566d269ad96dd41811bc911ad5bbfe68feaa99b93bcd1b8385bff176ca8ba1efbd321de3aa96cf132224929cd510ec12a7595e8f5574d9b804db7edae7974fa302d216a70756633fa9384533d9b33e1b251caa9cf43b1d04c5aecede414dda483c87
X-VERSION: 1.5.0
Accept-Language: en-US,en;q=0.5

Example request 5 Filter by country

GET /dashboard/statistics?select%5Bshop_amount%5D=1&select%5Border_amount%5D=1&select%5Border_price%5D=1&select%5Bactive_users%5D=1&start=0&end=1608038822&countries%5B0%5D=BE HTTP/1.1
Host: api.bakeronline.be
Authorization: Bearer be69566d269ad96dd41811bc911ad5bbfe68feaa99b93bcd1b8385bff176ca8ba1efbd321de3aa96cf132224929cd510ec12a7595e8f5574d9b804db7edae7974fa302d216a70756633fa9384533d9b33e1b251caa9cf43b1d04c5aecede414dda483c87
X-VERSION: 1.5.0
Accept-Language: en-US,en;q=0.5

Example request 6 Permissions for statistics is required

GET /dashboard/statistics?select%5Border_amount%5D=1&start=0&end=1608038822 HTTP/1.1
Host: api.bakeronline.be
Authorization: Bearer 1484803d1c08e78acc74775062803be8eddd1afd9441844d9850150af0cbab8d0da6c4dc5fd7f26a060a873aab5a34c72d8d7bc1f6e17f4a970f1da4859b3d86e7d99cfb5a67a3f4ab97758005a99435f194f5c94352d2d3b835f9a0c4e1841388e76918
X-VERSION: 1.5.0
Accept-Language: en-US,en;q=0.5

Response

A dictionary with fields

Field Type Description
shop_amount Int Optional. Return total amount of shops
order_amount Int Optional. Return order amount
order_price Int Optional. Total price of orders in cents
active_users Int Optional. Active users

Example response 1 Get all stats from all time

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

{
    "shop_amount": 1353,
    "order_amount": 512,
    "order_price": 6441785,
    "active_users": 202
}

Example response 2 Only request a part of the data

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

{
    "order_amount": 512
}

Example response 3 Only request for today

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

{
    "shop_amount": 1353,
    "order_amount": 13
}

Example response 4 Wait for update

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

{
    "order_amount": 13
}

Example response 5 Filter by country

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

{
    "shop_amount": 1348,
    "order_amount": 507,
    "order_price": 6388580,
    "active_users": 198
}

Example response 6 Permissions for statistics is required

HTTP/1.1 401 Unauthorized
Content-Type: application/json; charset=utf-8
Content-Length: 109

{
    "code": "not_authorized",
    "message": "You do not have access to this endpoint with this account."
}
1.5.0 stable