Post Query
To query generic analytical data from CashLantern, use this API endpoint.
To use this API endpoint, you will need to receive an API key from SprintQuip.
This API endpoint provides the identical query structure used by the CashLantern frontend.
POST /api_v1/query
The request body should be in JSON structure. There are some mandatory fields that are required:
- account_id - ID of target account. Available accounts can be requested
by using the endpoint: GET /api_v1/query/accounts
- timestart - End of timewindow, in epoch milliseconds (UTC)
- timeend - Start of the timewindow, in epoch milliseconds (UTC)
- package - Specifies the type of data that is of interest.
Available packages are:
- rcs_transaction
- rcs_box_content
- rcs_status
- caos_transaction
- caos_box_content
- caos_status
- ba_transaction
- ba_box_content
- ba_status
- aggregates - List of aggregate metrics that is of interest.
Must have at least a single value.
List of aggregate metrics can be requested by using the endpoint: POST /api_v1/query/aggregates
This endpoint only requires 'account_id' and 'package' field to be provided.
- dimensions - List of dimensions to group the data.
Must have at least a single value.
List of dimensions can be requested by using the endpoint: POST /api_v1/query/dimensions
This endpoint only requires 'account_id' and 'package' field to be provided.
Request and Response formats are in JSON.
You must include the Authorization api-key in the header.
The header key to use is
Authorization and the value is in the format api-key:<apikey>
Here is an example of what the body would look like, if you sent the mandatory fields and the optional fields listed above:
{
"account_id": "acc_osn_105",
"timestart": 1534866975000,
"timeend": 1533570975000,
"package": "rcs_transaction",
"aggregates": ["total_value"],
"dimensions": ["user_id"]
}
Back home