Skip to main content

Get Segmentation by company id

Este endpoint permite obtener un listado paginado de todos los segmentos dado un id de compañía.

Endpoint

Headers

KeyValueDescription
Content-Typeapplication/json
AuthorizationBearer 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

Como obtener un access token

Query Params

KeyValueDescription
page1optional, default 1
per_page1optional, default 5
fieldsuuid, name, index_querylimita los campos que se retornan a los seleccionados, si se deja vacio retorna todo
searchtestbusqueda parcial o completa de nombre de segmento

Path Variables

KeyValueDescription
company_id1requerido, id de compañia

Code Examples

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...'

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
}