Gets traffic usage data for selected period
GET <your-unleash-url>/api/admin/metrics/traffic/:period
Authorization
name: Authorizationtype: apiKeyin: headerdescription: API key needed to access this API
Gets traffic usage data numbers per API for a period given by the parameter
Request
Path Parameters
- period string required
Responses
- 200
trafficUsageDataSegmentedSchema
- application/json
- Schema
- Example (from schema)
Schema
- period string required
The year-month period for which the data usage is counted
apiData object[]required
{
"period": "2023-04",
"apiData": [
{
"days": [
{
"day": "2023-04-19T00:00:00.000Z",
"trafficTypes": [
{
"group": "successful-requests",
"count": 100
}
]
}
],
"apiPath": "/api/client/features"
}
]
}
Authorization
name: Authorizationtype: apiKeyin: headerdescription: API key needed to access this API
Request
Request
curl / cURL
curl -L -X GET '<your-unleash-url>/api/admin/metrics/traffic/:period' \
-H 'Accept: application/json' \
-H 'Authorization: <API_KEY_VALUE>'
python / requests
curl -L -X GET '<your-unleash-url>/api/admin/metrics/traffic/:period' \
-H 'Accept: application/json' \
-H 'Authorization: <API_KEY_VALUE>'
go / native
curl -L -X GET '<your-unleash-url>/api/admin/metrics/traffic/:period' \
-H 'Accept: application/json' \
-H 'Authorization: <API_KEY_VALUE>'
nodejs / axios
curl -L -X GET '<your-unleash-url>/api/admin/metrics/traffic/:period' \
-H 'Accept: application/json' \
-H 'Authorization: <API_KEY_VALUE>'
ruby / Net::HTTP
curl -L -X GET '<your-unleash-url>/api/admin/metrics/traffic/:period' \
-H 'Accept: application/json' \
-H 'Authorization: <API_KEY_VALUE>'
csharp / RestSharp
curl -L -X GET '<your-unleash-url>/api/admin/metrics/traffic/:period' \
-H 'Accept: application/json' \
-H 'Authorization: <API_KEY_VALUE>'
php / cURL
curl -L -X GET '<your-unleash-url>/api/admin/metrics/traffic/:period' \
-H 'Accept: application/json' \
-H 'Authorization: <API_KEY_VALUE>'
java / OkHttp
curl -L -X GET '<your-unleash-url>/api/admin/metrics/traffic/:period' \
-H 'Accept: application/json' \
-H 'Authorization: <API_KEY_VALUE>'
powershell / RestMethod
curl -L -X GET '<your-unleash-url>/api/admin/metrics/traffic/:period' \
-H 'Accept: application/json' \
-H 'Authorization: <API_KEY_VALUE>'