Update Segmentation
Este endpoint actualiza el contenido de un segmento, estos cambios pueden tomar tiempo en ser actualizados en los servicios que estén usando ese segmento u otro comportamiento inesperado.
Endpoint
Headers
Key | Value | Description |
---|---|---|
Content-Type | application/json | |
Authorization | Bearer LVwuk3_oug0D6... | access_token obtained in Atenea |
Url
Method: PUT
URL: https://api.trust.lat/message-persistance/api/v1/segment/:segment_uuid
caution
Recuerda que para utilizar este endpoint es necesario un access token obtenido en el servicio Atenea
Path Variables
Key | Value | Description |
---|---|---|
segment_uuid | cf8fb1b8-420e... | uuid del segmento creado previamente |
Body
{
"name": "hola 2",
"index_query": {
"apps.app_id": "1",
"model": "sm-g965fg"
}
}
Los campos se comportan de igual forma que en creacion, y se pueden agregar nuevos grupos al campo "index_query", como tambien borrarlos, index_query se modificara como se visualiza el campo en el body (en este caso, borrando tags).
Code Examples
- Curl
- JavaScript
- Python
curl --location --request PUT 'https://api.trust.lat/message-persistance/api/v1/segment/cf8fb1b8-420e...' \
--header 'Authorization: Bearer s1v0PD5QpUr9pBB...' \
--header 'Content-Type: application/json' \
--data-raw '{
"name": "hola 2",
"index_query": {
"apps.app_id": "1",
"model": "sm-g965fg"
}
}'
import requests
import json
url = "https://api.trust.lat/message-persistance/api/v1/segment/cf8fb1b8-420e..."
payload = json.dumps({
"name": "hola 2",
"index_query": {
"apps.app_id": "1",
"model": "sm-g965fg"
}
})
headers = {
'Authorization': 'Bearer s1v0PD5QpUr9...',
'Content-Type': 'application/json'
}
response = requests.request("PUT", url, headers=headers, data=payload)
print(response.text)
var axios = require('axios');
var data = JSON.stringify({
"name": "hola 2",
"index_query": {
"apps.app_id": "1",
"model": "sm-g965fg"
}
});
var config = {
method: 'put',
url: 'https://api.trust.lat/message-persistance/api/v1/segment/cf8fb1b8-420e...',
headers: {
'Authorization': 'Bearer s1v0PD5QpUr9pBB...',
'Content-Type': 'application/json'
},
data : data
};
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": {
"company_id": "1",
"name": "hola 2",
"index_query": {
"apps.app_id": "1",
"model": "sm-g965fg"
},
"id": 359,
"uuid": "742157ec-c296...",
"created_at": "2021-07-13T17:10:16.425Z",
"updated_at": "2021-07-13T17:10:27.491Z"
},
"message": "Found"
}
HTTP Code: 404 Not Found
{
"code": 404,
"resource": "Segment",
"message": "Not found"
}