In our previous article on API analytics, we saw how API producers could learn more about how their APIs are used thanks to some pretty graphs showing the number of calls, the HTTP methods and status codes being used, where in the world calls are coming from, or what client was used to make those calls.
Today, we’re going to have a closer look at API calls, to see who called you recently and with what outcome. Head over to the Messages tab of your API. You’ll see a Messages and Traces section which tell you about recent events for this Web API cell, like recent deployments of the API, etc. But we’re interested in the last section called Latest API calls:
You can see a list of recent calls made to your API, showing:
- the HTTP method used,
- the URL called,
- a little circle indicating if the call was successful or not (green some 2xx status code or orange for 4xx error code),
- and the date and time of the call.
Clicking on one of these calls gives you more details, including:
- the user token used to make that request,
- the duration of the call,
- the user agent used to make the call,
- the remote IP of the client that issued that request.
When you investigate a call that returned an error code like 422 in our screenshot below:
You can have more information on that call as well, including more details about the encountered error. In this case here, the 422 status code was returned because the PUT call to add a new car in my car inventory was not successful due to a malformed payload.
Looking into latest API calls will give you more insight into how your API is used by your consumers!