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
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
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)
| Attribute | Type | Description |
id | number | ID of the log. |
created | string | Time the log was created. |
ip | string, optional | IP address from where the API call was made. |
method | string | HTTP method used to make the API/Webhook call. |
endpoint | string | The endpoint to which the HTTP call was made. |
status | number | HTTP status of the API/Webhook call. |
event | string, optional | The event that caused the webhook call. |
request_params | string, optional | The request query params if there are any. |
request_body | string, optional | The request body if there is any. |
response_body | string, optional | The response body if there is any. |
url | string | API 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