Query Request History
When a request is sent to a Beeceptor endpoint, it's stored for future review. Beeceptor collects diverse data from each HTTP request including headers and payload. To streamline the retrieval and management of request history, the following APIs available.
Get All Requests
Use this API to retrieve one or multiple HTTP requests. You can pass query parameters to precisely filter and narrow down your search to the specific requests you need.
Request Details
Method | Request Path |
---|---|
GET | https://api.beeceptor.com/api/v1/endpoints/<my-endpoint>/requests |
<my-endpoint>
- name of the Beeceptor endpoint
Request Query Params
Supported query parameters and their sample values:
path=SOME-REQUEST-PATH
- This parameter allows you to retrieve all requests with a matching path. By default, the input is treated as a regular expression. In case the regular expression parsing fails, the input is searched as-is, ensuring a seamless search experience.status=200
- Use this parameter to filter requests that have a response with a 200 status code. Any code between 200 and 599 is considered valid. If an invalid value is passed, this filter will be ignored.method=POST
- Use this parameter to filter requests matching given HTTP method.dateFrom=2019-10-20T18:19:48.851Z
- Specify this parameter to retrieve requests that occurred after the specified date and time. The format for the date and time is ISO format, with the UTC timezone.dateTo=2019-10-20T18:19:48.851Z
- Use this parameter to retrieve requests that occurred before the specified date and time. The format for the date and time should be in ISO format, with the UTC timezone.reqBody=SOME-VALUE
- This parameter allows you to retrieve all the items where the request payload contains given value. You can either pass a search value or a regular expression. If the input is a valid regular expression, it is given priority for search.resBody=SOME-VALUE
- This parameter allows you to retrieve all the items where the response payload contains given value. You can either pass a search value or a regular expression. If the input is a valid regular expression, it is given priority for search.mode=full
- By default, the API returns only basic details. However, by sendingmode
asfull
, you can retrieve both the request and response body.count=20
- By default, only 20 results are returned. However, you can increase this number up to a maximum of 500 requests.
Response Object Details
The API response holds an array of requests in data
parameter. Refer the table below for details about each attribute in response.
Reponse parameters | Details |
---|---|
id | Uniquely identifies a request. |
date | Date and time at which the server received this request (ISO format in UTC timezone). |
timeTaken | Total time taken in milliseconds measured at server-side. |
status | Response status code. |
method | Request method (GET , POST , PUT , etc) |
path | Request path including any query and path parameters. |
rule | true , if a mocking rule was matched for this request. |
req.b | Request body, represented as text. (This is available with full details mode) |
req.h | A map of all the request headers. The header keys are case-insensitive and available in lower case. (This is available with full details mode) |
res.b | Response body, represented as text. (This is available with full details mode) |
res.h | A map of all the response headers. The header keys are case-insensitive and available in lower case. (This is available with full details mode) |
Success Response
A success response has 200
as HTTP status code.
{
"data": [
{
"id": "48ifhrbwedo",
"date": "2019-10-20T18:19:48.851Z",
"timeTaken": 22,
"method": "POST",
"path": "/my/api/path",
"status": 200,
"rule": false,
"req": {
"b": "{\"data\":\"Hello Beeceptor\"}",
"h": {
"host": "test-endpoint.free.localhost:8008",
"user-agent": "curl/7.54.0",
"accept": "*/*",
"content-type": "application/json",
"content-length": "26"
}
},
"res": {
"b": "\nHey ya! Great to see you here. Btw, nothing is configured for this request path. Create a rule and start building a mock API.\n",
"h": {
"content-type": "text/plain",
"access-control-allow-origin": "*",
"vary": "Accept-Encoding"
}
}
},
{
"id": "03vi2qc3fh79",
"date": "2019-10-20T18:20:10.399Z",
"timeTaken": 4,
"method": "POST",
"path": "/my/api/path/some/path",
"status": 200,
"rule": false,
"req": {
"b": "{\"data\":\"Hello Beeceptor\"}",
"h": {
"host": "test-endpoint.free.localhost:8008",
"user-agent": "curl/7.54.0",
"accept": "*/*",
"content-type": "application/json",
"content-length": "26"
}
},
"res": {
"b": "\nHey ya! Great to see you here. Btw, nothing is configured for this request path. Create a rule and start building a mock API.\n",
"h": {
"content-type": "text/plain",
"access-control-allow-origin": "*",
"vary": "Accept-Encoding"
}
}
},
{
"id": "6zgmmaebb5d",
"date": "2019-10-20T18:21:17.846Z",
"timeTaken": 6,
"method": "POST",
"path": "/my/api/path",
"status": 404,
"rule": true,
"req": {
"b": "{\"data\":\"Hello Beeceptor\"}",
"h": {
"host": "test-endpoint.free.localhost:8008",
"user-agent": "curl/7.54.0",
"accept": "*/*",
"content-type": "application/json",
"content-length": "26"
}
},
"res": {
"b": "Some error occurred.",
"h": {
"access-control-allow-origin": "*",
"content-type": "text/plain",
"vary": "Accept-Encoding"
}
}
}
]
}
Get One Request
Returns one request matching the given request ID.
Endpoint
HTTP Method | Request Path |
---|---|
GET | https://api.beeceptor.com/api/v1/endpoints/<my-endpoint>/requests/<request-id> |
<my-endpoint>
- name of the Beeceptor endpoint<request-id>
- request'sid
Success Response
The following represents a success response with 200
as HTTP status code.
{
"data": [
{
"id": "48ifhrbwedo",
"date": "2019-10-20T18:19:48.851Z",
"timeTaken": 22,
"method": "POST",
"path": "/my/api/path",
"status": 200,
"rule": false,
"req": {
"b": "{\"data\":\"Hello Beeceptor\"}",
"h": {
"host": "test-endpoint.free.localhost:8008",
"user-agent": "curl/7.54.0",
"accept": "*/*",
"content-type": "application/json",
"content-length": "26"
}
},
"res": {
"b": "\nHey ya! Great to see you here. Btw, nothing is configured for this request path. Create a rule and start building a mock API.\n",
"h": {
"content-type": "text/plain",
"access-control-allow-origin": "*",
"vary": "Accept-Encoding"
}
}
}
]
}
Purge Requests
Use this API to delete or purge request history. Note that deleting requests is non-recoverable.
Request Details
Method | Request Path |
---|---|
DELETE | https://api.beeceptor.com/api/v1/endpoints/<my-endpoint>/requests Deletes all requests for this endpoint |
DELETE | https://api.beeceptor.com/api/v1/endpoints/<my-endpoint>/requests/<request-id> Deletes one request with given ID for this endpoint |
<my-endpoint>
- name of the Beeceptor endpoint.<request-id>
- request'sid
, to delete a specific request. Whenrequest-id
is not passed, all requests will be deleted.
Success Response
A success response has 200
as HTTP status code. In the following requestsPurged
represents number of requests purged with this API call.
{
"data": {
"requestsPurged": 1
}
}
Limitations
- Requests sent in last 10 days are available for retrieval.
- Binary content is not supported by this API.
- Delete/purging requests is non-recoverable.