The SmartDocs page for the “Retrieve and Filter Metrics for a Dimension”, says to pass a timeRange as:
MM/DD/YYYY HH:MM~MM/DD/YYYY HH:MM.
For example:
8/24/2015 1200:00~9/20/2015 1200:00
That works fine in SmartDocs because it URL encodes the time range in the generated curl command:
curl -X GET "https://api.enterprise.apigee.com/v1/organizations/sgilson/environments/test/stats/apis?select=sum(message_count)&timeRange=8%2F24%2F2015%201200%3A00~9%2F20%2F2015%201200%3A00&timeUnit=day"
But in a straight curl command, how do you specify the time range? The doc says specify the date as MM/DD/YYYY%HH:MM using a % to precede HH:MM, as in:
curl https://api.enterprise.apigee.com/v1/o/{org_name}/environments/test/stats/target_url?"select=sum(is_error)&timeRange=8/08/2015%1200:00~9/15/2015%1200:00&timeUnit=week"
But that generates an error:
{
"code" : "Invalid parameter - timeRange",
"message" : "Invalid parameter - timeRange",
"contexts" : [ ]
}
If I do it like SmartDocs, by omitting the %, then I get no response at all:
curl https://api.enterprise.apigee.com/v1/o/{org_name}/environments/test/stats/target_url?"select=sum(is_error)&timeRange=8/08/2015 1200:00~9/15/2015 1200:00&timeUnit=week"
How do I pass the range then in curl?
Thanks,
Stephen