Export Data
Overview​
The Data endpoint allows users to retrieve specific data from service and provider datasets they have access to.
The user may specify a selection of columns and apply filters to refine the data query.
Additionally, pagination is supported, allowing users to navigate through large datasets by requesting specific pages of data.
POST /v1/data/:serviceId/:providerId
​
Retrieves data for a given service and provider based on specified columns and filters.
- Method: POST
- URL:
https://api.kinver.no/v1/data/{serviceId}/{providerId}
- Authentication: Required (Token-based). See Authentication and Authorization
- Parameters:
serviceId
(int): The ID of the service, should align with user's access.providerId
(int): The ID of the provider, should align with user's access.
- Request Body:
columns
(array): Specifies which columns to retrieve data for.filters
(array): Defines filters to apply to the data query.page
(int, optional): Specifies the page number for pagination. This parameter is crucial for navigating large datasets, allowing users to fetch a specific subset of data.
Supported Comparers​
The following comparers can be used in the filters to refine your data queries. Please note that all filters are cumulative, meaning that all conditions must be met for a record to be included in the result set.
=
: Equal to (strings and numerical values)!=
: Not equal to (both strings and numerical values)>
: Greater than (numerical values)<
: Less than (numerical values)>=
: Greater than or equal to (numerical values)<=
: Less than or equal to (numerical values)
Pagination​
- The
page
parameter in the request body allows users to access different parts of their data result set. Each page contains a fixed number of records. - Users should reference the
meta
object in the response to understand pagination status, including the total number of rows, total pages, and whether more pages are available.
Request Body Example​
Request payload should be JSON
{
"columns": ["column1", "column2"],
"filters": [
{
"criteria": "column1",
"comparer": "=",
"value": "value1"
},
{
"criteria": "column2",
"comparer": ">",
"value": 42
}
],
"page": 1
}
Response​
- Content-Type:
application/json
- Returns the requested data along with pagination details.
Example Response​
{
"meta": {
"totalRows": 100,
"totalPages": 10,
"currentPage": 1,
"pageSize": 10,
"morePages": true
},
"data": [
{
"column1": "value1",
"column2": 42
},
...
]
}