Registrar una suscripción de webhook
curl --request POST \
--url https://slc.sandbox.lerian.net/webhooks \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"events": [
"<string>"
],
"url": "<string>",
"active": true,
"description": "<string>",
"headers": {},
"secret": "<string>",
"timeoutSeconds": 2
}
'import requests
url = "https://slc.sandbox.lerian.net/webhooks"
payload = {
"events": ["<string>"],
"url": "<string>",
"active": True,
"description": "<string>",
"headers": {},
"secret": "<string>",
"timeoutSeconds": 2
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
events: ['<string>'],
url: '<string>',
active: true,
description: '<string>',
headers: {},
secret: '<string>',
timeoutSeconds: 2
})
};
fetch('https://slc.sandbox.lerian.net/webhooks', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://slc.sandbox.lerian.net/webhooks",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'events' => [
'<string>'
],
'url' => '<string>',
'active' => true,
'description' => '<string>',
'headers' => [
],
'secret' => '<string>',
'timeoutSeconds' => 2
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://slc.sandbox.lerian.net/webhooks"
payload := strings.NewReader("{\n \"events\": [\n \"<string>\"\n ],\n \"url\": \"<string>\",\n \"active\": true,\n \"description\": \"<string>\",\n \"headers\": {},\n \"secret\": \"<string>\",\n \"timeoutSeconds\": 2\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://slc.sandbox.lerian.net/webhooks")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"events\": [\n \"<string>\"\n ],\n \"url\": \"<string>\",\n \"active\": true,\n \"description\": \"<string>\",\n \"headers\": {},\n \"secret\": \"<string>\",\n \"timeoutSeconds\": 2\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://slc.sandbox.lerian.net/webhooks")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"events\": [\n \"<string>\"\n ],\n \"url\": \"<string>\",\n \"active\": true,\n \"description\": \"<string>\",\n \"headers\": {},\n \"secret\": \"<string>\",\n \"timeoutSeconds\": 2\n}"
response = http.request(request)
puts response.read_body{
"active": true,
"createdAt": "<string>",
"description": "<string>",
"events": [
"<string>"
],
"failureCount": 123,
"id": "<string>",
"lastDeliveryAt": "<string>",
"lastDeliveryStatus": 123,
"successCount": 123,
"updatedAt": "<string>",
"url": "<string>"
}{
"code": "<string>",
"details": {},
"message": "<string>",
"title": "<string>"
}{
"code": "<string>",
"details": {},
"message": "<string>",
"title": "<string>"
}{
"code": "<string>",
"details": {},
"message": "<string>",
"title": "<string>"
}{
"code": "<string>",
"details": {},
"message": "<string>",
"title": "<string>"
}{
"code": "<string>",
"details": {},
"message": "<string>",
"title": "<string>"
}Registrar una suscripción de webhook
Registra una suscripción de webhook para el tenant de la solicitud. El secreto se usa solo para visualización y validación; nunca se persiste en texto claro (solo un hash SHA-256). En BYOC el secreto de firma real proviene del Secret de Kubernetes del cliente.
POST
/
webhooks
Registrar una suscripción de webhook
curl --request POST \
--url https://slc.sandbox.lerian.net/webhooks \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"events": [
"<string>"
],
"url": "<string>",
"active": true,
"description": "<string>",
"headers": {},
"secret": "<string>",
"timeoutSeconds": 2
}
'import requests
url = "https://slc.sandbox.lerian.net/webhooks"
payload = {
"events": ["<string>"],
"url": "<string>",
"active": True,
"description": "<string>",
"headers": {},
"secret": "<string>",
"timeoutSeconds": 2
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
events: ['<string>'],
url: '<string>',
active: true,
description: '<string>',
headers: {},
secret: '<string>',
timeoutSeconds: 2
})
};
fetch('https://slc.sandbox.lerian.net/webhooks', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://slc.sandbox.lerian.net/webhooks",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'events' => [
'<string>'
],
'url' => '<string>',
'active' => true,
'description' => '<string>',
'headers' => [
],
'secret' => '<string>',
'timeoutSeconds' => 2
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://slc.sandbox.lerian.net/webhooks"
payload := strings.NewReader("{\n \"events\": [\n \"<string>\"\n ],\n \"url\": \"<string>\",\n \"active\": true,\n \"description\": \"<string>\",\n \"headers\": {},\n \"secret\": \"<string>\",\n \"timeoutSeconds\": 2\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://slc.sandbox.lerian.net/webhooks")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"events\": [\n \"<string>\"\n ],\n \"url\": \"<string>\",\n \"active\": true,\n \"description\": \"<string>\",\n \"headers\": {},\n \"secret\": \"<string>\",\n \"timeoutSeconds\": 2\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://slc.sandbox.lerian.net/webhooks")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"events\": [\n \"<string>\"\n ],\n \"url\": \"<string>\",\n \"active\": true,\n \"description\": \"<string>\",\n \"headers\": {},\n \"secret\": \"<string>\",\n \"timeoutSeconds\": 2\n}"
response = http.request(request)
puts response.read_body{
"active": true,
"createdAt": "<string>",
"description": "<string>",
"events": [
"<string>"
],
"failureCount": 123,
"id": "<string>",
"lastDeliveryAt": "<string>",
"lastDeliveryStatus": 123,
"successCount": 123,
"updatedAt": "<string>",
"url": "<string>"
}{
"code": "<string>",
"details": {},
"message": "<string>",
"title": "<string>"
}{
"code": "<string>",
"details": {},
"message": "<string>",
"title": "<string>"
}{
"code": "<string>",
"details": {},
"message": "<string>",
"title": "<string>"
}{
"code": "<string>",
"details": {},
"message": "<string>",
"title": "<string>"
}{
"code": "<string>",
"details": {},
"message": "<string>",
"title": "<string>"
}Autorizaciones
Bearer token authentication (format: "Bearer {token}")
Cuerpo
application/json
Webhook subscription to create
¿Esta página le ayudó?
⌘I

