GET https://api.getpostman.com/mocks/{{mockId}}/call-logs
Gets a mock server's call logs. You can get a maximum of 6.5MB of call logs or a total of 100 call logs, whichever limit is met first in one API call. Call logs contain exchanged request and response data made to mock servers. The logs provide visibility into how the mock servers are being used. You can log data to debug, test, analyze, and more, depending upon the use case.
Body
PARAM
Key | Datatype | Required | Description |
limit
|
string | Optional. The maximum number of rows to return in the response. This value defaults to 100. | |
cursor
|
string | Optional. A pointer to the first record of the set of paginated results. To view the next response, use the "nextCursor" value for this parameter. | |
until
|
string | Optional. Return only the call logs created at and after this time, in ISO 8601 UTC format. | |
since
|
string | Optional. Return only the call logs created at and before this time, in ISO 8601 UTC format. | |
responseStatusCode
|
string | Optional. Return only the call logs that match the given HTTP response status code. | |
responseType
|
string | Optional. Return only the call logs with a matching response type. For example, "success" or "error". Matching is not case-sensitive. | |
requestMethod
|
string | Optional. Return only the call logs with a matching HTTP method. Matching is not case-sensitive. | |
requestPath
|
string | Optional. Return only the call logs that match the request's path. Matching is not case-sensitive. | |
sort
|
string | Optional. Sort the call logs by the given property. This only accepts the "servedAt" value. If you use this query parameter, you must also use the "direction" parameter. | |
direction
|
string | Optional. Sort in ascending (asc) or descending (desc) order. Matching is not case-sensitive. If you use this query parameter, you must also use the "sort" parameter. | |
include
|
string | Optional. Include call log records with header and body data. This query parameter accepts the "request.headers", "request.body", "response.headers", and "response.body" values. For multiple include types, comma-separate each value. |
HEADERS
Key | Datatype | Required | Description |
RESPONSES
status OK
{
"call-logs": [
{
"id": "c4505a1e-7261-497c-91ff-db4bd51351a6-9545",
"responseName": "Double check your method and the request path and try again.",
"servedAt": "2022-01-17T06:19:30.000Z",
"request": {
"method": "POST",
"path": "/animals",
"headers": [
{
"key": "content-length",
"value": "50"
},
{
"key": "x-mock-match-request-body",
"value": "true"
},
{
"key": "content-type",
"value": "application/json"
}
],
"body": {
"mode": "raw",
"data": "{\"type\":\"hamster\",\"breed\":\"Syrian Hamster\"}"
}
},
"response": {
"type": "error",
"statusCode": 404,
"headers": [],
"body": {
"data": "{\"error\":{\"name\":\"mockRequestNotFoundError\",\"message\":\"Double check your method and the request path and try again.\"}}"
}
}
},
{
"id": "0f63f54d-665e-436a-95b4-c1302d7685a9-3925",
"responseName": "Bad request",
"servedAt": "2022-01-17T06:19:22.000Z",
"request": {
"method": "POST",
"path": "/animals",
"headers": [
{
"key": "content-length",
"value": "69"
},
{
"key": "x-mock-match-request-body",
"value": "true"
},
{
"key": "content-type",
"value": "application/json"
}
],
"body": {
"mode": "raw",
"data": "{\"type\":\"hamster\",\"breed\":\"Syrian Hamster\",\"age\":\"1 month\"}"
}
},
"response": {
"type": "success",
"statusCode": 400,
"headers": [
{
"description": {
"content": "",
"type": "text/plain"
},
"key": "Content-Type",
"value": "application/json"
}
],
"body": {
"data": "{\n\t\"message\": \"Malformed request. You need to send gender as part of the request.\"\n}"
}
}
},
{
"id": "adab0d30-5c38-43bf-af90-4119925138e2-3795",
"responseName": "Successful addition of animals to the store",
"servedAt": "2022-01-17T06:19:16.000Z",
"request": {
"method": "POST",
"path": "/animals",
"headers": [
{
"key": "content-length",
"value": "88"
},
{
"key": "x-mock-match-request-body",
"value": "true"
},
{
"key": "content-type",
"value": "application/json"
}
],
"body": {
"mode": "raw",
"data": "{\"type\":\"hamster\",\"breed\":\"Syrian Hamster\",\"age\":\"1 month\",\"gender\":\"male\"}"
}
},
"response": {
"type": "success",
"statusCode": 200,
"headers": [
{
"description": {
"content": "",
"type": "text/plain"
},
"key": "Content-Type",
"value": "application/json"
}
],
"body": {
"data": "{\n\t\"message\": \"Animal added successfully to the store\"\n}"
}
}
},
{
"id": "dae50669-f4c1-460a-b3a4-3a2445f4f39d-2468",
"responseName": "Get filtered list of Animals",
"servedAt": "2022-01-17T06:18:26.000Z",
"request": {
"method": "GET",
"path": "/animals?type=dog",
"headers": [],
"body": {}
},
"response": {
"type": "success",
"statusCode": 200,
"headers": [
{
"description": {
"content": "",
"type": "text/plain"
},
"key": "Content-Type",
"value": "application/json"
}
],
"body": {
"data": "[\n\t{\n\t\t\"type\": \"dog\",\n\t\t\"breed\": \"German Sheperd\",\n\t\t\"age\": \"6 months\",\n\t\t\"gender\": \"male\"\n\t},\n\t{\n\t\t\"type\": \"dog\",\n\t\t\"breed\": \"Bulldog\",\n\t\t\"age\": \"1 year\",\n\t\t\"gender\": \"female\"\n\t}\n]"
}
}
},
{
"id": "a5330463-26e1-4812-a962-e44b569a2054-9894",
"responseName": "Get Animals",
"servedAt": "2022-01-17T06:18:06.000Z",
"request": {
"method": "GET",
"path": "/animals",
"headers": [],
"body": {}
},
"response": {
"type": "success",
"statusCode": 200,
"headers": [
{
"description": {
"content": "",
"type": "text/plain"
},
"key": "Content-Type",
"value": "application/json"
}
],
"body": {
"data": "[\n\t{\n\t\t\"type\": \"dog\",\n\t\t\"breed\": \"German Sheperd\",\n\t\t\"age\": \"6 months\",\n\t\t\"gender\": \"male\"\n\t},\n\t{\n\t\t\"type\": \"dog\",\n\t\t\"breed\": \"Bulldog\",\n\t\t\"age\": \"1 year\",\n\t\t\"gender\": \"female\"\n\t},\n\t{\n\t\t\"type\": \"cat\",\n\t\t\"breed\": \"Persian cat\",\n\t\t\"age\": \"3 months\",\n\t\t\"gender\": \"female\"\n\t}\n]"
}
}
}
],
"meta": {
"nextCursor": null
}
} |
ENDPOINTS