analytics filter - invalid API call

Not applicable

When i call analytics api /stats/apis??select=sum(is_error)&timeRange=03%2F16%2F2015%2013%3A00~03%2F17%2F2015%2013%3A00&timeUnit=hour&filter=(responsecode+in+%274xx%27)

It complains

{

"code" : "Invalid API Call",

"message" : "Invalid API Call",

"contexts" : [ ]

}

If i change the filter to (apiproxy+EQ+%27someservice%27) then it works. What is wrong with the responsecode filter?

Solved Solved
0 8 567
1 ACCEPTED SOLUTION

Not applicable

There are two issues with the query you are trying to perform, the first one is that the name of the variable for response code is not "responsecode" but "response_status_code", the second one is that the response code value is not a string as "4xx" but a number, instead, you can use a value like 400 or specify a range.

A modified version of your filter: (response_status_code+in+%27400%27) should work.

Regards!

View solution in original post

8 REPLIES 8

Not applicable

There are two issues with the query you are trying to perform, the first one is that the name of the variable for response code is not "responsecode" but "response_status_code", the second one is that the response code value is not a string as "4xx" but a number, instead, you can use a value like 400 or specify a range.

A modified version of your filter: (response_status_code+in+%27400%27) should work.

Regards!

Is there a list of those variables that can be used in a filter? I have big time struggling to find such list.

The following call will give you the list of dimensions and metrics the system has available, including custom variables if you have them:

.../organizations/{org}/environment/{env}/analytics/admin/schema?type=fact

You can use any dimension or metric in the list to build a filter.

Just wanted to correct the URL (s/environment/environments):

../organizations/{org}/environments/{env}/analytics/admin/schema?type=fact

Not applicable

@api.management.admin, what am I missing here?

select=sum(is_error)&timeRange=04/14/2015 00:00~04/15/2015 00:00&timeUnit=hour

I am getting Invalid API Call

Thanks

The fragment you pasted seems fine. Can you paste here the complete url (at least start from "/stats/?" with the complete query string) you are using?

Not applicable

GET /v1/o/<org>/environments/prod/stats/api?select=sum(message_count)&timeRange=4/15/2015%2000:00~4/16/2015%2000:00&timeUnit=day

HTTP/1.1Host: api.enterprise.apigee.com

Authorization: Basic <b64>

Cache-Control: no-cache

Postman-Token: ab6c550d-48bf-9378-4193-87bcccd29393

Not applicable

The problem is with the name of the dimension used in the call.

You are using .../stats/api... please try it with .../stats/apiproxy...