Skip to main content

Create a TrustFeed

Endpoint que crea un TrustFeed (Los TrustFeed son tipos de mensaje para un channel). Recibe como parámetros los siguientes campos:

  • company_id(obligatorio y válido)
  • name(obligatorio)

Al registrar el TrustFeed, lo devuelve como respuesta.

Endpoint#

Headers

KeyValueDescription
Content-Typeapplication/json
AuthorizationBearer {{ access_token }}access token obtained in Atenea
Method: POST
URL: https://api.trust.lat/channels/v1/trust_feed

Body

{
"company_id": "9",
"name": "test"
}
caution

Recuerda que para utilizar este endpoint es necesario un access token obtenido en el servicio Atenea

Como obtener un access token

Descripción de los campos

KeyRequiredData TypeDescription
company_idtrueIntegerId identificador de la compañia perteneciente al TrustFeed creado. Este campo debe ser válido para la creación
nametrueStringNombre del TrustFeed a crear

Code Examples#

curl --location --request POST 'https://api.trust.lat/channels/v1/trust_feed' \
--header 'Authorization: Bearer 4quUDNDn...' \
--header 'Content-Type: application/json' \
--data-raw '{
"company_id": "9",
"name": "test"
}'

Responses#

HTTP CODE: 201 CREATED#

{
"code": 201,
"resource": "TrustFeed",
"data": {
"company_id": "9",
"created_at": "2020-09-15T05:08:10.213Z",
"name": "test",
"uuid": "9999-9999-99-999-999-99-99-99"
},
"message": "Created"
}

HTTP CODE: 422 Unprocessable Entity (name field blank)#

{
"code": 422,
"resource": "Trust_feed",
"message": "Fail",
"errors": {
"name": [
"can't be blank"
]
}
}

HTTP CODE: 422 Unprocessable Entity (company_id field blank)#

{
"code": 422,
"resource": "Trust_feed",
"message": "Fail",
"errors": {
"company_id": [
"can't be blank"
]
}
}
Last updated on by msepulvedav