Reporting API
This content is for 5.0 (Preview). Switch to 4.5 (Current) for the current release documentation.
Access to the reporting API is handle by cube.js which allows for optimal performance, pre-aggregation and access control. Request can be done through a REST API or any of the provided client libraries such as React, Vue or Web sockets. See [https://cube.dev/docs/frontend-introduction] for more details on available integration libraries.
REST API
Section titled “REST API”Request base url
Section titled “Request base url”https://reporting.qpos.me/cubejs-api/v1Authentication
Section titled “Authentication”Start by obtaining an access token. The access token must be included in the header for all requests. See the previous chapter for more information.
A request can also include a query param that is interpreted by the API, translated to SQL and which returns a response with the relevant json data.
Request example
Section titled “Request example”A simple request to count all orders
curl --request GET 'https://reporting.qpos.me/cubejs-api/v1/load?query={"measures":["orders.count"]}' \--header 'Authorization: Bearer eyJhbGciOi...'\Response example
Section titled “Response example”{ "data": [ { "orders.count": 19461 } ], "query": { ... }}Meta data
Section titled “Meta data”Retrieve a list of all cubes, dimensions and measures
https://reporting.qpos.me/cubejs-api/v1/metaTime zone
Section titled “Time zone”By default QUEUE API will queries and results will be UTC timezone, but a timezone parameter can be provided:
curl --request GET 'https://reporting.qpos.me/cubejs-api/v1/load?query={"timezone": "Europe/Berlin", "measures":["orders.count"]}' \--header 'Authorization: Bearer eyJhbGciOi...'\to use a specific timezone.
Examples
Section titled “Examples”Get list of orders
Section titled “Get list of orders”curl --request GET 'https://reporting.qpos.me/cubejs-api/v1/load?query={"dimensions": ["orders.paid_at", "orders.status", "orders.amount"], "limit": 2, "order": [["orders.paid_at", "desc"]]}' \--header 'Authorization: Bearer eyJhbGciOiJSUz...' \--header 'Content-Type: application/x-www-form-urlencoded'{ "data": [ { "orders.paid_at": "2023-10-18T02:37:01.234", "orders.status": "paid", "orders.amount": 150 }, { "orders.paid_at": "2023-09-01T04:46:30.896", "orders.status": "paid", "orders.amount": 180 } ], "query": { ... },}Get list of line items with order and quantity in date range
Section titled “Get list of line items with order and quantity in date range”curl --request GET 'https://reporting.qpos.me/cubejs-api/v1/load?query={"dimensions": ["orders.id", "orders.paid_at", "orders.status", "orders.amount","menu_products.name", "menu_variants.name", "line_items.quantity"], "filters": [{"member": "orders.paid_at", "operator": "inDateRange", "values": ["2023-10-01", "2023-11-01"] }], "order": [["orders.paid_at", "asc"]], "limit": 3}' \--header 'Authorization: Bearer eyJhbGciOi...'{ "data": [ { "orders.id": "4WGOlrQUA9Tq8-HA6cGBtC", "orders.paid_at": "2023-10-18T02:37:01.234", "orders.status": "paid", "orders.amount": 150, "menu_products.name": "Coffee", "menu_variants.name": "Large", "line_items.quantity": 1 } ], "query": { ... }}