(API) How to retrieve Audit Logs
In the API, we save a Log of all commands (GET, POST, PATCH, DELETE) executed by the User, related by APIKey. We saved everything and everything is available for consultation at our
Endpoint: https://api.botdoc.io/v1/logentry/search/
Example to how to request a logentry by cURL:
curl -i --request GET "https://api.botdoc.io/v1/logentry/search/" \
--header "Content-Type: application/json" \
Example of a body response:
{
"id":"1f68690da2ce8ecc6f89688a78089cee",
"code":"ABA-0010",
"content_type":null,
"data":{
"id":2119,
"identifier":"73f9943e4d5b9acf20daf65bd5a2c5f6",
"state":"created",
"callback_url":"https://link.to.your.callback.url",
"callback_flat":false,
"email_template_slug":null,
"sms_template_slug":null,
"expires_at":null,
"created":"2020-08-27T19:51:19.178797Z",
"updated":"2020-08-27T19:51:19.178844Z",
"allow_open_remote_addrs":"['*']",
"block_open_remote_addrs":"[]",
"display_botdoc_mentions":false,
"page_type":"p2"
},
"remote_addr":null,
"method":null,
"path":null,
"related_model":"Request",
"relation_key":"2119",
"apikey_id":"c9cc1843-7a1c-4535-89df-4d94bb49c532",
"value":"Entity Container was created",
"date":"2020-08-27T19:51:19.187376Z",
"PartitionKey":"model_audit",
"from":null,
"Timestamp":"2020-08-27 19:51:19.187376",
"api_key_id":"c9cc1843-7a1c-4535-89df-4d94bb49c532",
"RowKey":"1f68690da2ce8ecc6f89688a78089cee"
}
Every log has a Code to identify itself, we call this Codes of Products, and we Have a list of Products, see below
List of Products (Code):
Log Codes:
Code | Description |
---|---|
AAA-0010 | Log the calls made to the API endpoints |
AAA-0011 | Log the calls made to the fetch/send pages |
AAA-0001 | Log when a successful user login occurs |
AAA-0002 | Log when a fail user login occurs |
ABB-0010 | Log when a media is downloaded |
ABB-0020 | Log when an user loads the page of fetch/send files |
ABA-0010 | Log when entities are created |
ABA-0020 | Log when entities are deleted |
ABA-0030 | Log when entities are updated |
ABD-0010 | Log when the request email is opened |
ABC-0010 | Log when a request it sent to the contact_methods within that request |
ABB-0030 | Log when a Recipient opens the URL he/she received |