Skip to content

Logs

These are the endpoints that provide details about every call made within your company via Xref Reference API.

List Logs

Method GET
Path /logs{?type}{?limit}{?page}

This endpoint returns the list of logs for each API/Webhook call that was made in your account. The page attribute in the response allows you to link to the current, previous and next pages of the logs list.

Request

Headers

Authorization: Bearer YOUR_JWT_TOKEN_HERE
Content-Type: application/json

Parameters

Name Example / default Required Type Description
type "api" Yes string Filter the list of logs by type. Possible values are api, and webhook. There is no default value.
limit 20 No integer Limit the list of logs to a certain number. Defaults to 20, maximum can be 100. Default: 20
page 1 No integer The page number in the list of logs. Default: 1

Response

200 — application/json

{
"pages": {
    "total": 5,
    "links": {
        "this": "/logs?type=api&limit=20&page=1",
        "prev": "",
        "next": "/logs?type=api&limit=20&page=2"
    }
},
"data": [
    {
        "id": 1000,
        "created": "2017-10-17T06:40:08",
        "method": "GET",
        "endpoint": "/checks",
        "status": 200,
        "event": "",
        "url": "/log/1000"
    },
    {
        "id": 1001,
        "created": "2017-10-17T06:42:00",
        "method": "GET",
        "endpoint": "/check/5000",
        "status": 200,
        "event": "",
        "url": "/log/1001"
    },
    {
        "id": 1002,
        "created": "2017-10-17T06:45:00",
        "method": "POST",
        "endpoint": "/check",
        "status": 201,
        "event": "",
        "url": "/log/1002"
    }
]
}

401 — application/json

Retrieve a Log

Method GET
Path /log/{id}

This endpoint returns useful information on the API/Webhook call such as the method, the event, the status, the url and more. The API returns a 404 response if the log is not found, and a 403 response if the requesting user does not have the permissions required to view the log.

Request

Headers

Authorization: Bearer YOUR_JWT_TOKEN_HERE
Content-Type: application/json

Parameters

Name Example / default Required Type Description
id 1000 Yes number A unique identifier of the log.

Response

200 — application/json

Attributes (object)
AttributeTypeDescription
idnumberID of the log.
createdstringTime the log was created.
ipstring, optionalIP address from where the API call was made.
methodstringHTTP method used to make the API/Webhook call.
endpointstringThe endpoint to which the HTTP call was made.
statusnumberHTTP status of the API/Webhook call.
eventstring, optionalThe event that caused the webhook call.
request_paramsstring, optionalThe request query params if there are any.
request_bodystring, optionalThe request body if there is any.
response_bodystring, optionalThe response body if there is any.
urlstringAPI endpoint to retrieve this object.
Body
{
    "id": 1000,
    "created": "2017-10-17T06:40:08",
    "ip": "127.0.0.1",
    "method": "GET",
    "endpoint": "/checks",
    "status": 200,
    "event": "",
    "request_params": "",
    "request_body": "",
    "response_body": "",
    "url": "/log/1000"
}

404

403