This web service responds with the number of API calls logged in a selected period.
- Calls to private web services and calls triggered by a human using a Fluid Topics portal are not part of the data that appears in the API calls screen.
- The API calls web service v2 returns data starting April 1st, 2023. For data prior to April 1st, 2023, use the API calls v1 web service.
It is necessary to define header parameters when calling a Fluid Topics web service in order for Fluid Topics to log API calls.
Method | Endpoint |
---|---|
POST |
/analytics/api/v2/traffic/api-calls |
Request example
The following lines show an example of a JSON request body:
{
"startDate": "2023-04-01",
"endDate": "2023-10-01",
"groupByPeriod": "month",
"callingApps": ["undefined (default)"]
}
Field | Type | Required? | Description |
---|---|---|---|
startDate |
String | Yes | The inclusive start date of the period. The start date must be in the past year. |
endDate |
String | Yes | The exclusive end date of the period. The end date must be later than the start date. |
groupByPeriod |
String | Yes | The period by which to group the API calls. Valid values are month , week and day . |
callingApps |
Array | Yes | Accepts one or more calling apps. |
Response body
The following lines show an example of a JSON response body:
{
"startDate": "2023-04-01",
"endDate": "2023-10-01",
"results": [
{
"name": "undefined (default)",
"periods": [
{
"periodStartDate": "2023-04-01",
"periodEndDate": "2023-05-01",
"callCount": 546762
},
{
"periodStartDate": "2023-05-01",
"periodEndDate": "2023-06-01",
"callCount": 378475
},
{
"periodStartDate": "2023-06-01",
"periodEndDate": "2023-07-01",
"callCount": 402705
},
{
"periodStartDate": "2023-07-01",
"periodEndDate": "2023-08-01",
"callCount": 319967
},
{
"periodStartDate": "2023-08-01",
"periodEndDate": "2023-09-01",
"callCount": 538165
},
{
"periodStartDate": "2023-09-01",
"periodEndDate": "2023-10-01",
"callCount": 253964
}
]
}
]
}
Method | Endpoint |
---|---|
POST |
/analytics/api/v1/traffic/api-calls |
Request example
The following lines show an example of a JSON request body:
{
"callingApps": [
"my-calling-app",
"my-other-calling-app"
],
"startDate": "2023-03-29",
"endDate": "2023-04-29",
"groupByPeriod": "month"
}
Field | Type | Required? | Description |
---|---|---|---|
callingApps |
Array | Yes | Accepts one or more calling apps. |
startDate |
String | Yes | The inclusive start date of the period. The start date must be in the past year. |
endDate |
String | Yes | The exclusive end date of the period. The end date must be later than the start date. |
groupByPeriod |
String | Yes | The period by which to group the API calls. Valid values are month and day . |
Response body
The following lines show an example of a JSON response body:
{
"endDate": "2023-04-29",
"results": [
{
"callCount": 0,
"periodStartDate": "2022-07-06",
"periodEndDate": "2022-07-06"
}
],
"startDate": "2023-03-29"
}
The API calls v1 web service only returns data prior to April 1st, 2023. For data starting April 1st, 2023, use the API calls v2 web service.
Field | Type | Description |
---|---|---|
startDate |
String | The inclusive start date of the total period as defined in the request body. |
endDate |
String | The exclusive end date of the total period as defined in the request body. |
periodStartDate |
String | The inclusive start date of the period by which results are grouped. |
periodEndDate |
String | The exclusive end date of the period by which results are grouped. |
callCount |
Number | The number of calls sent by the calling apps during the period by which results are grouped. |
Return code | Description |
---|---|
200 OK |
Returns results |