Request Details
All Reporting API endpoints must have a start and end date (in UTC timezone) as required query parameters. All data is returned in UTC timezone. Below are details related to the request, response, and query parameters that apply to all Reporting API endpoints.
By default, each Reporting API endpoint returns all data for the partner account associated with the API Key being used. If you have more than one integration setup within your account, then by default each endpoint will return all data for your account, grouped by the ClientId of each integration. To fetch data specific to a single ClientId within your account, use the clientIds
parameter as described below.
Query Parameters
Each endpoint accepts the following query parameters.
Parameter | Description | Required |
---|---|---|
startDate | Date in the format of yyyy-MM-dd | true |
endDate | Date in the format of yyyy-MM-dd | true |
clientIds | Use this to retrieve metrics for a specific ClientId within your account. Should be a string with one or more clientIds in the format of "string1,string2,etc.." | false |
country | Filter by country code as defined here | false |
productType | Filter by product type. See list of supported languages. | false |
Example Request
- cURL
curl \
--request GET 'https://api.inbrain.ai/api/v2/reports/earnings?startDate=2022-09-01&endDate=2022-09-05' \
--header 'X-InBrain-Api-Key: YOUR_API_KEY_HERE'
Response
Response codes
Code | Description | Reason |
---|---|---|
200 | Success | |
400 | Bad Request | Some of the request parameters are missing or invalid |
401 | Unauthorized | Invaild API Key |
403 | Forbidden | User geo is unsupported/User reached surveys limit/User banned |
429 | Too Many Requests | Too many requests in a given amount of time |
500 | Internal Server Error | Server error occured while processing the request |
Success model
Successful response is a JSON object. See example below:
[
{
"clientId": "fbbb2399-0412-46ad-abd7-2f4851d062d3",
"total": 3935.5897,
"data": [
504.6873,
701.3224
],
"dateArray": [
"2021-06-03T00:00:00",
"2021-06-04T00:00:00"
]
},
{
"clientId": "55e9e563-11fc-4b45-84d8-9219bd58731b",
"total": 6935.5897,
"data": [
584.6873,
701.3224
],
"dateArray": [
"2021-06-03T00:00:00",
"2021-06-04T00:00:00"
]
}
]