Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Unable to consume Metrics API for developer app

Hi Team,

I am trying to start exploring the Apigee metrics API to integrate with our service to serve the Metrics on our own dashboards. 

When i start executing one of the requests to get data by devapp, using below API

https://apigee.googleapis.com/v1/organizations/<Org Name>/environments/<ENV>/stats/<Developer App Name>?select=sum(message_count)&timeRange=10/01/2022%2000:00~10/07/2022%2000:00&timeUnit=day

getting below error, 

Invalid query parameter - Field <Developer App Name> not present in schema of <Org Name>~<ENV>
 
And this is the first time i am using these APIs, do i need to enable anything to start using metrics API ? 
And my developer app name has a space, can that be any issue ?? (I hope no, as apigee allows having spaces in the app name) 

I am using Apigee X. 

Please help on this to move forward. 
 
Thanks in advance! 
Solved Solved
0 3 721
1 ACCEPTED SOLUTION

The API is for retrieving environment level statistics. It looks as if you are trying to retrieve information about a specific app. It does not work that way.

Take a look at the docs over at:

https://cloud.google.com/apigee/docs/reference/apis/apigee/rest/v1/organizations.environments.stats/...

The last segment in the path

 

organizations/{org}/environments/{env}/stats/{dimensions}

 


is for specifying a comma separated list of "dimensions". The dimensions themselves are the names of the fields by with you want to group-by the result (metrics).

Here is a list of dimensions you can use:

https://cloud.google.com/apigee/docs-preview/api-platform/analytics/analytics-reference?hl=en#dimens...

So, in your case, you would not put the ID/name of the app itself. Instead you would use the "developer_app", or "client_id" dimension (field name).

 

View solution in original post

3 REPLIES 3
Top Solution Authors