Send Docs Feedback

Get API message counts

Resource Summary

Security

Content Type

Category

Analytics,

GetAPImessagecountspermonth

GET

Get API message counts

Use this API call to get the number of API messages made per time interval in an organization and environment.

 

If you have multiple organizations and environments, make this API call for each one and add them to get the total number of calls per time interval for your API program.

 

To convert the JSON response to a CSV format for use in spreadsheets, use a tool like https://json-csv.com/

 

For different and more granular metrics, use the Get metrics for a dimension management API. For more information on the analytics management API, see Use the analytics API to measure API program performance.

Resource URL

https://api.enterprise.apigee.com/v1 /organizations/{org_name}/environments/{env_name}/stats/

Query Parameters

Name Values Description
select
(required)

Use sum(message_count) to tell the API you want the message count.

timeRange
(required)

The UTC start and end time for the desired interval. The date format is MM/DD/YYYY HH:MM. For example, 03/01/2016 00:00~03/31/2016 23:59 returns data for the month of March 2016.

If you make a request through this SmartDocs page, it automatically URL encodes the space character before HH:MM. However, if you are entering the time range in a cURL command from the command line, manually insert "%20" for the space character, in the form: MM/DD/YYYY%20HH:MM~MM/DD/YYYY%20HH:MM. (See the cURL tab below after you make a request.)

Note: Data older than six months from the current date is not accessible by default. If you want to access data older than six months, contact Apigee Support.

timeUnit

Leave this blank to return the total number of API calls. However, if you want to return counts in time intervals, specify a value of second, minute, hour, day, or week.

The Epoch timestamp in milliseconds that is returned is the start time of each interval.

Request Body

org_name Mention the organization name true

env_name Mention the environment name, such as test or prod true

HTTP Basic

OAuth 2.0

API Key

Reset

Make a request and see the response.

Make a request and see the response.

Make a request and see the response.

Working...

Help or comments?