Logo
15_Days_of_Postman_-_for_testers_IvanKo API Documentation

Get a mock server's call logs

GET {{baseUrl}}/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 The maximum number of rows to return in the response. This value defaults to 100.
cursor
string The 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 Return only results created until this given time, in [ISO 8601](https://datatracker.ietf.org/doc/html/rfc3339#section-5.6) format. This value cannot be earlier than the `since` value.
since
string Return only results created since the given time, in [ISO 8601](https://datatracker.ietf.org/doc/html/rfc3339#section-5.6) format. This value cannot be later than the `until` value.
responseStatusCode
string Return only call logs that match the given HTTP response status code.
responseType
string Return only call logs that match the given response type. Matching is not case-sensitive.
requestMethod
string Return only call logs that match the given HTTP method. Matching is not case-sensitive.
requestPath
string Return only call logs that match the given request path. Matching is not case-sensitive.
sort
string Sort the results by the given value. If you use this query parameter, you must also use the `direction` parameter. If you use this query parameter, you must also use the `direction` parameter.
direction
string 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 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 } }



Curl
curl -X GET 'https://api.getpostman.com/mocks/mockId/call-logs?limit=<integer>&cursor=<string>&until=<string>&since=<string>&responseStatusCode=<number>&responseType=<string>&requestMethod=<string>&requestPath=<string>&sort=servedAt&direction=<string>&include=<string>'

ENDPOINTS