Read events by trust/app id
Este endpoint buscara como primer filtro el trust_id, luego agrupara por app_id. Su uso es para buscar todos los eventos relacionados a un dispositivo celular y la aplicación 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?trust_id=1111-2222-3333-4444&app_id=1&bundle_id=com.enrollment.trust&style=cascade&page=1&per_page=10
caution
Recuerda que para utilizar este endpoint es necesario un access token obtenido en el servicio Atenea
Request Params
Key | Example | Required | Description |
---|---|---|---|
trust_id | 1111-2222-3333-4444 | true | Device id |
app_id | 1 | required but can use bundle_id as altermative | application identification |
bundle_id | com.enrollment.trust | required but can use app_id as altermative | application identification |
style | cascade | true | select the output format, can be 'compacted' or 'cascade' |
page | 1 | false | for pagination, default: 1 |
per_page | 10 | false | for pagination, default: 10 |
Code Examples
- Curl
- JavaScript
- Python
curl --location --request GET 'https://api.trust.lat/events/v1/event?trust_id=1111-2222-3333-4444&app_id=1&bundle_id=com.enrollment.trust&style=cascade&page=1&per_page=10' \
--header 'Authorization: Bearer MdJWfp154y0HN...'
import requests
url = "https://api.trust.lat/events/v1/event?trust_id=1111-2222-3333-4444&app_id=1&bundle_id=com.enrollment.trust&style=cascade&page=1&per_page=10"
payload={}
headers = {
'Authorization': 'Bearer MdJWfp154y0HN...'
}
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?trust_id=1111-2222-3333-4444&app_id=1&bundle_id=com.enrollment.trust&style=cascade&page=1&per_page=10',
headers: {
'Authorization': 'Bearer MdJWfp154y0HN...'
}
};
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": "Events",
"data": [
{
"app_id": "1",
"app_version": "v1.0.0",
"created_at": "2021-07-13T22:23:10.433Z",
"event_date": "2020-07-30T19:48:28.845+00:00",
"event_type": "INSTANCE",
"reason": "UPDATE",
"trust_id": "1234",
"uuid": "26418eaa-...",
"_type": ""
}
],
"message": "Found",
"page": 1,
"per_page": 10,
"total": 1
}
HTTP Code: 200 OK-No data
{
"code": 200,
"resource": "Events",
"data": [],
"message": "Found",
"page": 1,
"per_page": 10,
"total": 0
}
HTTP Code: 404 Not Found
{
"code": 404,
"resource": "Events",
"message": "Bad Request",
"errors": "trust_id and/or application id is missing in the request."
}