Query Request History
When a request is sent to a Beeceptor endpoint, it is stored and searchable. The following APIs can be used to retrieve and manage request history.
Get All Requests
Filter and retrieve request history.
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
You can pass additional query paramemers to filter specific requests.
path=SOME-REQUEST-PATH
- retrieve all requests having this path (regex works here).status=200
- filter requests having response with 200 status code. Any code between 100-599 is valid.method=POST
- filter requests matching POST only.dateFrom=2019-10-20T18:19:48.851Z
- get requests after this date. (ISO format, UTC timezone)dateTo=2019-10-20T18:19:48.851Z
- get requests before this date. (ISO format, UTC timezone)mode=full
- by default only basic details are returned. Pass this to retrieve request and response body.count=20
- by default only 20 results are returned. Maximum 500.
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 this request |
date | Date and time at which server reveived the request (ISO format, UTC timezone) |
timeTaken | total server side time taken in miliseconds |
status | Response status code |
method | Request method (GET , POST , PUT , etc) |
path | Request path |
rule | true , if a mocking rule was matched for this request |
req.b | Request body (available with full details mode) |
req.h | A map having all the request headers (available with full details mode) |
res.b | Response body (available with full details mode) |
res.h | A map having all the response headers (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 based on the 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.