Search charts
const url = 'https://api.wink.travel/api/analytics/booking/grid';const options = { method: 'POST', headers: { 'Wink-Version': '2.0', Authorization: 'Bearer <token>', 'Content-Type': 'application/json' }, body: 'null'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.wink.travel/api/analytics/booking/grid \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --header 'Wink-Version: 2.0' \ --data nullReturns a paginated, filterable grid of the caller’s saved booking line charts.
Authorizations
Section titled “Authorizations ”Parameters
Section titled “ Parameters ”Header Parameters
Section titled “Header Parameters ”Request Body required
Section titled “Request Body required ”Grid filter and sort state for paginating booking analytics line charts
Pagination, sorting, filtering, and grouping state used to query a paged result set.
object
Number of records to be skipped by the pager.
Example
0Number of records to take.
Example
10Descriptors used for sorting result set.
Descriptor that defines the sort direction and field for ordering a result set.
object
Descriptors used for sorting result set
Example
ascData set field to sort on
Example
hotel.nameExample
{ "dir": "asc", "field": "hotel.name"}Descriptors used for filtering result set
object
Whether to filter inclusively or exclusively
Example
andDescriptors used for filtering the result set
A single field-level filter criterion that specifies what to match and how to compare it.
object
Field name to filter on
Example
hotel.nameFilter operator to use on field
Example
startsWithValue to filter dataset against
Example
Happy ResMake filter comparison case insensitive. Default: Case sensitive
Example
trueExample
{ "field": "hotel.name", "operator": "startsWith", "value": "Happy Res", "ignoreCase": true}Example
{ "logic": "and", "filters": [ { "field": "hotel.name", "operator": "startsWith", "value": "Happy Res", "ignoreCase": true } ]}Descriptors to group result sets by.
Descriptor that defines how a result set should be grouped, including sort direction and optional aggregate calculations.
object
Field to group data set on
Example
createdDateGroup sort direction
Example
ascPrimitive aggregate data points
Descriptor that defines an aggregate function to apply to a specific field in a grouped result set.
object
Field to run aggregate function on
Example
hotel.bookingsAggregate function
Example
countExample
{ "field": "hotel.bookings", "aggregate": "count"}Example
{ "field": "createdDate", "dir": "asc", "aggregates": [ { "field": "hotel.bookings", "aggregate": "count" } ]}Example
{ "skip": 0, "take": 10, "sort": [ { "dir": "asc", "field": "hotel.name" } ], "filter": { "logic": "and", "filters": [ { "field": "hotel.name", "operator": "startsWith", "value": "Happy Res", "ignoreCase": true } ] }, "group": [ { "field": "createdDate", "dir": "asc", "aggregates": [ { "field": "hotel.bookings", "aggregate": "count" } ] } ]}Responses
Section titled “ Responses ”Paginated list of matching line charts. Pagination metadata (total, page, size) is in the Page wrapper.
A line chart data structure containing an identifier, title, legend, one or more series of data points, and category axis configuration.
object
Unique line chart identifier
The configuration options for the chart title
object
The text content of the chart title.
The configuration options for the chart legend.
object
The legend labels, one entry per series.
The configuration of the chart series. The series type is determined by the value of the type field. If a type value is missing, the chart renders the type that is specified in seriesDefaults. Some options accept functions as arguments. These arguments are evaluated for each point which is supplied as a parameter. If no value is returned, the chart uses the theme or seriesDefaults values.
A named data series for a chart, pairing a display name with its array of numeric data points.
object
The name of the Chart series which is visible in the legend.
The array of data items which represent the series data.
You can set it to:
- Array of numbers. Supported when the series.type option is set to
area,bar,column,donut,pie,line, orwaterfall. The Bubble series need arrays of three values—X value, Y value, and Size value—for example, [1, 1, 10]. The Scatter and ScatterLine series need arrays of two values—X value and Y value. The OHLC and Candlestick series need arrays of four values—open, high, low, and close. The RangeBar and RangeArea series need arrays of two values—the from and to value.
The configuration options of the category axis.
object
The category names. The Chart creates a category for every item of the array.
Configuration options for the category (X) axis of the chart, including the list of category names.
object
The category names. The Chart creates a category for every item of the array.
Example
{ "identifier": "3c6b1a5d-8e2f-4a0b-9c7d-6e4f0a8b2c51", "title": { "text": "Monthly Booking Revenue" }, "legend": { "data": [ "Revenue", "Refunds" ] }, "series": [ { "name": "Revenue", "data": [ 120000, 95000, 148000, 210000, 175000, 230000 ] }, { "name": "Refunds", "data": [ 5000, 3200, 7800, 4100, 6500, 2900 ] } ], "xAxis": { "data": [ "Jan", "Feb", "Mar", "Apr", "May", "Jun" ] }}Bad Request — missing or invalid request parameter or body
object
object
Example
Unauthorized — authentication is required or the session has expired
object
object
Example
Forbidden — authenticated but lacking the required permission or scope
object
object
Example
Not Found — the requested resource does not exist
object
object
Example
Method Not Allowed — the HTTP verb is not supported on this endpoint
object
object
Example
Unsupported Media Type — use application/json
object
object
Example
Internal Server Error — an unexpected failure occurred on the server
object
object
Example
Service Unavailable — a downstream dependency is unreachable