Hey there! In this guide, we'll explore how to use Xano's new metadata API to retrieve and filter your application's request history. This powerful feature allows you to access and analyze your request data in a way that suits your needs, giving you better visibility and control over your application's performance.
The first endpoint we'll look at is the `GET` endpoint that allows us to browse the entire request history for a particular workspace. To use this endpoint, you'll need to provide your workspace ID, like so:
This will return the complete request history for the specified workspace, with no filtering applied. However, you can use various query parameters to refine the results:
Here's an example of how you might use this endpoint with some additional filtering:
This request would retrieve the first 20 results from the request history, filtered by a specific branch, API, and query, and include the response output in the results.
The second endpoint we'll explore is the `POST` endpoint that allows you to search your request history based on specific criteria. To use this endpoint, you'll need to provide your workspace ID and a search object:
The search object can include various properties to filter the results, such as `status`, `method`, `path`, and more. For example, let's say you want to search for all requests that returned a 200 status code:
You can then send this search object as the request body:
This will return all requests from the specified workspace that had a status of 200.
You can also combine multiple search criteria to further refine your results. For instance, to find all `GET` requests to a specific path that returned a 400 status code:
This endpoint also supports the `page`, `perPage`, `branchId`, `apiId`, and `queryId` query parameters, just like the browsing endpoint.
Being able to access and filter your request history opens up a wide range of possibilities. Here are a few examples of how you might leverage this functionality:
Xano's metadata API provides a powerful way to access and work with your application's request history. By leveraging these endpoints, you can gain deeper insights into your application's performance, identify and resolve issues more efficiently, and unlock new possibilities for monitoring, analytics, and optimization.
Keep an eye out for more updates and new features in the metadata API, as Xano continues to expand its capabilities. Happy coding (or no-coding, as the case may be)!
This transcript was AI generated to allow users to quickly answer technical questions about Xano.
I found it helpful
I need more support