This requires API Metrics
You can learn more about setting up API Metrics here.
One of the best parts of API Metrics is the ability for your users to construct an API request, make the request, and view the full log of the API request and response, all without leaving the documentation.
For authenticated users, API Metrics will display their logs right inside your documentation in the following places:
This includes all interactions that the user made with your API, not just the ones made inside ReadMe. In other words, if a user made a failed API call via cURL, then navigated to your API reference to read the docs and understand why the call failed, they would see that failed cURL request in your documentation!
This requires an OpenAPI document
See Make Your Metrics Even Better With OpenAPI below for more information.
For more granularity, the logs also display per endpoint in the API Reference section:
Your users can view their logs directly in the API Explorer.
If a customer has an issue with a particular endpoint, now they can see what has worked in the past and self-diagnose!
There is also a Logs section where the user will see all of their API calls for all endpoints. There, they can filter by response status code, request method, or endpoint.
Follow these steps to enable users to see their own API logs in the docs:
Scrub your API logs of confidential information before sending to ReadMe
API logs are viewable by anyone with ReadMe admin privileges. You can find out how to remove secure information from the logs at Getting Started With API Metrics.
- Set Up Authentication In Docs — ReadMe supports logging in with JWT, which you can set up with this guide. All you need to do is pass in an
idin the user's JWT object that matches the user's
idpassed into the API Metrics middleware. Then that user will be able to see all of the matching logs.
Need help getting this setup? Send us an email at [email protected].
ReadMe has a variety of upload and synchronization workflows available to make it easy to keep your API Reference up-to-date, which you can read about here.
In addition to the benefits of our interactive API Explorer, your API Metrics become even more powerful when you upload an OpenAPI document. Here are a few reasons why:
- Your users can view their API logs underneath the endpoints in the reference guides.
- Individual logs will auto-populate a link to the corresponding reference documentation for that endpoint.
- Headers will be automatically hidden that aren't explicitly listed in the OpenAPI document.
- URLs are parameterized based on the OpenAPI document.
- And many more to come!
Updated about 2 hours ago