Show API Request History To Users

:rocket: We're in the process of rolling out the new Metrics experience for all customers. This will be live in your project in the coming weeks! Go here for docs on our legacy Metrics product.

ReadMe hubs go beyond static docs sites β€” they're interactive, so users can try your API in real time. On top of the default Try It playground, one of the best ways to make your developer experience stand out is by surfacing a user's real API request history to them directly in your hub. As long as they're logged in, they can view full logs of their past API calls and responses to debug issues and learn through trial and error.

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 went to read your API reference to understand why the call failed, they would see that failed cURL request in your hub! It's a pretty cool experience πŸ™‚

πŸ‘

API Request Data Required

Showing request history to users in your hub is only possible if you send your API request data to ReadMe. Here's how to set it up!

Where can users see their past API requests?

Once you're sending API request data to ReadMe, authenticated (logged in) users will see their request history in a dedicated API Logs section.

When you click an individual request, you're taken directly to the endpoint the request was made to in your API Reference β€” with the complete history of that specific request in the Try It playground, so developers can see exactly what happened.

If they need more help, they can use the Share This Request toggle to generate a unique link for that request that can be shared directly with your developer support team, so everyone's on the same page, looking at the same information.

Users will also see past API Requests next to each endpoint in the API Reference. Like in the logs section, clicking on an individual request will populate all of its actual metadata in the Try It playground for visibility and easy debugging.

Note: this requires an OpenAPI spec β€” so if you don't have one, consider this one more reason to invest the time in building one out!

How to set this up

Follow these steps to enable users to see their own API requests in the docs:

  1. (Highly Recommended!) Upload an OpenAPI document to ReadMe β€” learn more.
  2. Send your API request data to ReadMe β€” get started here.

❗️

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 your request data at here.

  1. Set Up Authentication In Docs β€” To protect your data privacy, all hub users must be authenticated in order to see real API request history data. ReadMe supports logging in with JWT, which you can set up with this guide. All you need to do is pass in an id in the user's JWT object that matches the user's id passed into the API Metrics middleware. Then that user will be able to see all of the matching API requests.

Need help getting this setup? Send us an email at [email protected].


Did this page help you?