Get Segmentation by company id
Este endpoint permite obtener un listado paginado de todos los segmentos dado un id de compañía.
Endpoint
Headers
Key | Value | Description |
---|---|---|
Content-Type | application/json | |
Authorization | Bearer LVwuk3_oug0D6... | access_token obtained in Atenea |
Url
Method: POST
URL: https://api.trust.lat/message-persistance/api/v1/company_id/:company_id/segment?page=1&per_page=1&fields=uuid, name, index_query&search=hola
caution
Recuerda que para utilizar este endpoint es necesario un access token obtenido en el servicio Atenea
Query Params
Key | Value | Description |
---|---|---|
page | 1 | optional, default 1 |
per_page | 1 | optional, default 5 |
fields | uuid, name, index_query | limita los campos que se retornan a los seleccionados, si se deja vacio retorna todo |
search | test | busqueda parcial o completa de nombre de segmento |
Path Variables
Key | Value | Description |
---|---|---|
company_id | 1 | requerido, id de compañia |
Code Examples
- Curl
- JavaScript
- Python
curl --location --request GET 'https://api.trust.lat/message-persistance/api/v1/company_id/1/segment?page=1&per_page=1&fields=uuid,%20name,%20index_query&search=hola' \
--header 'Authorization: Bearer s1v0PD5QpUr9pBB...'
import requests
url = "https://api.trust.lat/message-persistance/api/v1/company_id/1/segment?page=1&per_page=1&fields=uuid, name, index_query&search=hola"
payload={}
headers = {
'Authorization': 'Bearer s1v0PD5QpUr9pBB...'
}
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/message-persistance/api/v1/company_id/1/segment?page=1&per_page=1&fields=uuid, name, index_query&search=hola',
headers: {
'Authorization': 'Bearer s1v0PD5QpUr9pBB...'
}
};
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": "Segment",
"data": [
{
"id": 1,
"index_query": {
"apps.app_id": "1",
"model": "sm-g965fg"
},
"uuid": "742157ec-c296...",
"name": "hola 2"
}
],
"message": "Found",
"page": 1,
"per_page": 1,
"total": 1
}
HTTP Code: 200 No data
{
"code": 200,
"resource": "Segment",
"data": [],
"message": "Found",
"page": 1,
"per_page": 1,
"total": 0
}