Read service event by Company id
Trae los eventos asociados a un company id, si queda en blanco, traera todos. Su uso es para buscar todos los eventos relacionados a un servicio en cuestión.
Endpoint
Headers
Key | Value | Description |
---|---|---|
Content-Type | application/json | |
Authorization | Bearer MdJWfp154y0HN... | access_token obtained in Atenea |
Url
Method: GET
URL: https://api.trust.lat/events/v1/event/service/?company_id=3
caution
Recuerda que para utilizar este endpoint es necesario un access token obtenido en el servicio Atenea
Request Params
Key | Example | Required | Description |
---|---|---|---|
company_id | 3 | false | Id de company |
Code Examples
- Curl
- JavaScript
- Python
curl --location --request GET 'https://api.trust.lat/events/v1/event/service/?company_id=3' \
--header 'Authorization: Bearer sCaKT4qKHoDVEtP7F4...'
import requests
url = "https://api.trust.lat/events/v1/event/service/?company_id=3"
payload={}
headers = {
'Authorization': 'Bearer sCaKT4qKHoDVEtP7F4'
}
response = requests.request("GET", url, headers=headers, data=payload)
print(response.text)
var axios = require('axios');
var config = {
method: 'get',
url: 'https://api.trust.lat/events/v1/event/service/?company_id=3',
headers: {
'Authorization': 'Bearer sCaKT4qKHoDVEtP7F4...'
}
};
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data));
})
.catch(function (error) {
console.log(error);
});
Responses
HTTP Code: 200 OK
{
"code": 200,
"resource": "Service Log",
"data": [
{
"audit_id": "",
"company_id": "6",
"created_at": "2021-07-13T22:36:33.778Z",
"description": "device created",
"operation": "CREATE",
"relevance": "INFO",
"resource": "DEVICE",
"resource_id": "1111-2222-3333-4444",
"resource_id_2": "",
"result": true,
"service": "INDEX",
"user_id": "1",
"uuid": "d538c40b-..."
},
{
"audit_id": "",
"company_id": "6",
"created_at": "2021-07-14T19:18:42.902Z",
"description": "device created",
"operation": "CREATE",
"relevance": "INFO",
"resource": "DEVICE",
"resource_id": "1111-2222-3333-4444",
"resource_id_2": "",
"result": true,
"service": "INDEX",
"user_id": "1",
"uuid": "b97a4c1c-..."
},
{
"audit_id": "",
"company_id": "6",
"created_at": "2021-07-14T19:19:54.641Z",
"description": "device created",
"operation": "CREATE",
"relevance": "INFO",
"resource": "DEVICE",
"resource_id": "1111-2222-3333-4444",
"resource_id_2": "",
"result": true,
"service": "INDEX",
"user_id": "",
"uuid": "cab9d2e1-..."
},
{
"audit_id": "",
"company_id": "6",
"created_at": "2021-07-14T19:20:03.788Z",
"description": "device created",
"operation": "CREATE",
"relevance": "INFO",
"resource": "DEVICE",
"resource_id": "1111-2222-3333-4444",
"resource_id_2": "",
"result": true,
"service": "INDEX",
"user_id": "1",
"uuid": "0cfd1942-..."
}
],
"message": "Found",
"page": 1,
"per_page": 10
}
HTTP Code: 200 OK-No data
{
"code": 200,
"resource": "Service Log",
"data": [],
"message": "Found",
"page": 1,
"per_page": 10
}