Apigee Monitoring API for 500 errors - apigee

I am trying to call the monitoring API of api to get back stats on my api's to determine the error counts. However, i only want to see 5XX errors and not 4XX.
I tried the api below based on the documentation listed below however, doest seem to work. Any suggestions?
https://api.enterprise.apigee.com/v1/o/{env}/environments/test/stats/apis?select=error_count&timeRange=11/14/2014%2000:00~11/25/2014%2000:00&timeUnit=minute&filter=(responsecode EQ 500)
Documentation:
http://apigee.com/docs/analytics-services/reference/analytics-reference

I tested this and I get a 500 error with the response
{
"contexts": []
}
Looks like a bug.

Related

AdCreativesV2 Batch GET API returns 400 BAD REQUEST - "Cannot process request involving multiple routing entities"

I am making API requests to a url like this to access AdCreatives API:
https://api.linkedin.com/v2/adCreativesV2?ids=List(123,456,789)
(not the exact ids, but you get the idea)
Depending on the IDs used in the call, sometimes this works as expected, and sometimes I get a 400 error code response with the message "Cannot process request involving multiple routing entities"
What does this mean, and how can I fix it?
I assume I can't make a request that includes all of these ids at once, but is there a way to tell which ids are causing the problem? This could help me group similar IDs successfully to make the call.
Have you checked you are using X-Restli-Protocol-Version: 2.0.0 in the header?
For example, for me in python this looks like
headers['X-Restli-Protocol-Version'] = '2.0.0'
r = requests.get(url, headers=headers)
This is mentioned on the docs here
Make sure that your Creatives belong to the same account.
Based on LinkedIn's new error messages documentation, the new error message that will replace the "Cannot process request involving multiple routing entities" message is indicating that the ad account of the Creative_ids is not identical:
Entities should have the same ad account in batch update and batch partial update request.

Cannot successfully make here map requests using my api key

I cannot get a success response using the example code shown in the here documentation: https://developer.here.com/documentation/routing/dev_guide/topics/request-constructing.html
I created a Freemium account and generated two each of JS and REST api keys. Regardless of which key I try, I keep getting errors that seem to change with each attempt:
Sometimes a 404
Sometimes a 502
Sometimes a 504
Sometimes a 403 with a message I might understand if it happened every time:
{
Message: "User: anonymous is not authorized to perform: es:ESHttpGet"
}
Sometimes a 200 with a page not found error message from something called
Platform's Radar
Sometimes a 302 that redirects to a login for Kibana using a Live Nation account
For reference, a specific request from the documentation that I have been trying:
https://route.ls.hereapi.com/routing/7.2/calculateroute.json?apikey={API_KEY}&waypoint0=geo!52.5,13.4&waypoint1=geo!52.5,13.45&mode=fastest;car;traffic:disabled
I am really not sure what is going on here.
On replicating the API call, it is resulting 200 every time. For reference find screenshot, please use correct APIkey

Clockify API in PBI

Does anyone know how to call the Clockify API in Power Bi?
I just cant seem to get it right. I have read through the Clockify API documentation and the I cant transpose the code in Power Bi.
let
Source = Json.Document(Web.Contents("https://api.clockify.me/api/",
[Headers=[Accept="application/json", #"x-api-key"="xxxxxxxxxx"]])),
messages = Source[messages]
in
Source
So I don't know PBI but one issue I think I see with your call is the "Headers" should include a "Content-Type" - "application/json" header. You don't need the "Accept" header. And you might have shortened it, but your endpoint URL needs an actual endpoint - https://api.clockify.me/api/ won't return anything. Instead you should test trying to get the workspace information, for example, which I think would look something like this:
let
Source = Json.Document(Web.Contents("https://api.clockify.me/api/workspaces/",
[Headers=[#"x-api-key"="xxxxxxxxxx"]])),
messages = Source[messages]
in
Source
This one doesn't need the content-type header because it's just a GET request. I don't know how PBI creates different types of requests, but certain requests need to be GET requests, while others need to be POST/PUT/DELETE/etc.
did you get around this? there is no support on official website of clockify as for now, but it seems that it could be done by the clockify API but same as your code it does not run.

API Status Page Response Codes

(This is sort of an abstract philosophical question. But I believe it has objective concrete answers.)
I'm writing an API, my API has a "status" page (like, https://status.github.com/).
If whatever logic I have in place to determine the status says everything is good my plan would be to return 200 OK, and a JSON response with more information about each service tested by my status page.
But what if my logic says the API is down? Say the database isn't responding or something.
I think I want to return 500 INTERNAL SERVER ERROR (or 503 SERVICE NOT AVAILABLE) along with a JSON response with more details.
However, is that breaking the HTTP Status Code spec? Would that confuse end users? My status page itself is working just fine in that case. So maybe it should return 200? But that would mean anyone using it would have to dig into the body looking for a specific parameter to determine the API's status vs. just checking the HTTP Status Code. (Also if my status page itself was broken, I'm fine with the end user taking that to mean the API is down since that's a pretty bad sign...)
Thoughts? Is there official protocol on how a status page should work?
https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html
For me the page should return 200 unless has problems itself. Is true that is easier to check the status code of a response than parsing but using HTTP status codes to encode application informations breaks what people (and spiders) expect. If a spider passes for your page and sees a 500 or 503 will think your site has a page with problems, not that that page is ok and is signaling that the site is down.
Also, as you notice, it wont' be possible to distinguish between the service is down and the status page is down cases, with the last the only one that should send 500. Also, what if you show more than one service like the twitter status page ? Use 200.
Related: https://stackoverflow.com/a/943021/1536382 https://stackoverflow.com/a/34324179/1536382

Status of page, for tests to check

I'm writing tests for my python code and need to find a web page that returns status code grater then 307, if someone knows pages like that, plz link them. Thanks
I also wanted this some time back but couldn't fine , however some of my test I used below linked for below HTTP error codes. Basically these are some rest api calls. you can try it.
HTTP error code 401 if you call
http://gdata.youtube.com/feeds/api/standardfeeds/r
HTTP error 400 gives if you call
http://gdata.youtube.com/feeds/api/standardfeeds/

Resources