Passer au contenu

📈 Get usage metrics for a company

Requête

Get detailed usage metrics for a company within a specified period.

Sécurité
APIKeyHeader
Requête
periodstring(UsagePeriod)

Period for usage metrics

Par défaut:"monthly"
Enum:"daily""weekly""monthly""yearly"
start_datestring or null(Start Date)
Any of:

Start date for custom period

string (date)
end_datestring or null(End Date)
Any of:

End date for custom period

string (date)
En-têtes
X-PDP-Client-Idstring(X-Pdp-Client-Id)obligatoire

ID of the PDP Client for which the operation is performed

Examples:
Sandbox client
client_abc123
curl -i -X GET \
  'https://pdp.seqino.dev/api/usage/metrics?period=daily&start_date=2019-08-24&end_date=2019-08-24' \
  -H 'Authorization: YOUR_API_KEY_HERE' \
  -H 'X-PDP-Client-Id: client_abc123'

Réponses

Successful Response

Corpsapplication/json
company_idstring(Company Id)obligatoire
periodstring(UsagePeriod)obligatoire
Enum:"daily""weekly""monthly""yearly"
start_datestring, (date)(Start Date)obligatoire
end_datestring, (date)(End Date)obligatoire
total_api_callsinteger, >= 0(Total Api Calls)obligatoire

Total number of API calls

total_successful_callsinteger, >= 0(Total Successful Calls)obligatoire

Total successful API calls

total_failed_callsinteger, >= 0(Total Failed Calls)obligatoire

Total failed API calls

success_ratenumber, [ 0 .. 100 ](Success Rate)obligatoire

Success rate percentage

endpoint_usageArray of objects(Endpoint Usage)obligatoire

Usage breakdown by endpoint

generated_atstring, (date-time)(Generated At)
Response
{ "company_id": "string", "period": "daily", "start_date": "2019-08-24", "end_date": "2019-08-24", "total_api_calls": 0, "total_successful_calls": 0, "total_failed_calls": 0, "success_rate": 100, "endpoint_usage": [ {} ], "generated_at": "2019-08-24T14:15:22Z" }