POST /v3/appnotificaciones/{topic}
Crea la configuración del webhook.
Request
Path parameters
Name | Type | Constraints | Descripción |
---|---|---|---|
topic | string |
Required |
Topic para configurar |
Body content
AppWebhookUpsert
Name | Type | Constraints | Example | Descripción |
---|---|---|---|---|
Callback | string (uri) |
Min length 0 Max length 1024 |
"https://callbacks.myapp.com/autocosmos/event" | URL envío hook |
Secret | string |
Min length 16 Max length 256 |
"96d0300081d644d3bdceae8fbfc77955" | Si se especifica el Secret recibirás el header 'Notification-Signature' con el HMAC256 calculado con los valores (UTF-8 encoded) de los headers Notification-Hook-ID, Notification-Timestamp y Notification-Topic (si disponible). |
Description | string |
Min length 0 Max length 256 |
Texto libre para describir el webhook | |
Activo | boolean | Activo/Suspendido | ||
HeaderCustom01 | V3.Models.CustomHeader | |||
HeaderCustom02 | V3.Models.CustomHeader | |||
HeaderCustom03 | V3.Models.CustomHeader |
AppWebhookUpsert
Content-Type
: application/json
{ "Callback": "https://callbacks.myapp.com/autocosmos/event", "Secret": null, "Description": "Mi callback para algo", "Activo": true, "HeaderCustom01": { "Name": "X-MYAPP-PRODUCER", "Value": "Autocosmos" }, "HeaderCustom02": null, "HeaderCustom03": null }
Responses
HTTP-StatusCode 201
Created
Headers
Name | Type | Descripción |
---|---|---|
Location | string (uri) | URI del webhook. |
{ "Callback": "https://callbacks.myapp.com/autocosmos/event", "Secret": null, "Description": "Mi callback para algo", "Activo": true, "HeaderCustom01": { "Name": "X-MYAPP-PRODUCER", "Value": "Autocosmos" }, "HeaderCustom02": null, "HeaderCustom03": null, "_links": { "rel1": { "href": "/v3/appnotificaciones/somevalue" }, "rel2": { "href": "/v3/appnotificaciones/somevalue", "method": "PUT" } } }
HTTP-StatusCode 400
{ "Errors": { "_": [ "entry problem1", "entry problem2" ], "property1": [ "problem 1" ] }, "Type": "https://httpstatuses.com/400", "Title": "Validación de información esperada fallida", "Status": 400, "Detail": "Alguna información contiene valores no validos.", "Instance": "/v3/somewhere", "Extensions": {} }
HTTP-StatusCode 403
Topic no disponible.
{ "Type": "https://httpstatuses.com/403", "Title": "Titulo de problema", "Status": 403, "Detail": "Alguna descripción del problema", "Instance": "/v3/somewhere", "Extensions": {} }
HTTP-StatusCode 409
La configuración del webhook ya fue creada (usa el PUT).
{ "Errors": { "_": [ "entry problem1", "entry problem2" ], "property1": [ "problem 1" ] }, "Type": "https://httpstatuses.com/400", "Title": "Validación de información esperada fallida", "Status": 400, "Detail": "Alguna información contiene valores no validos.", "Instance": "/v3/somewhere", "Extensions": {} }