Active campaign by segment ID
Retorna la uuid de una campaña ingresando el identificador de un segmento (este proceso excluye a las campañas que ya no están activas).
Endpoint
Headers
Key | Value | Description |
---|---|---|
Content-Type | application/json | |
Authorization | Bearer {{access_token}} | access_token obtained in Atenea |
Url
Method: GET
URL: https://api.trust.lat/campaigns/api/v1/campaign/segment/:segment_id
caution
Recuerda que para utilizar este endpoint es necesario un access token obtenido en el servicio Atenea
Code Examples
- Curl
- JavaScript
- Python
curl --location --request GET 'https://api.trust.lat/campaigns/api/v1/campaign/segment/dnec5d5-862f-4e03-a8b4-5bbbd5f9657' \
--header 'Authorization: Bearer {{accessToken}}'
import requests
url = "https://api.trust.lat/campaigns/api/v1/campaign/segment/dnec5d5-862f-4e03-a8b4-5bbbd5f9657"
payload={}
headers = {
'Authorization': 'Bearer {{accessToken}}'
}
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/campaigns/api/v1/campaign/segment/dnec5d5-862f-4e03-a8b4-5bbbd5f9657',
headers: {
'Authorization': 'Bearer {{accessToken}}'
}
};
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data));
})
.catch(function (error) {
console.log(error);
});
Responses
HTTP Code: 200 Found
{
"code": 200,
"resource": "Campaign",
"data": [
{
"active_campaigns": [
"zclb1fq6-0dfz-4p01-a5-294a3e59ef1f"
],
"active": true
}
],
"message": "Found"
}
HTTP Code: 200 No Data
Cuando el servicio no encuentra resultados, retornará un code 200 pero con el listado de campañas vacío.
{
"code": 200,
"resource": "Campaign",
"data": [
{
"active_campaigns": [],
"active": false
}
],
"message": "Found"
}