curl --request POST \
--url http://localhost:8090/internal/v1/webhooks/{provider}/{endpoint_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/octet-stream' \
--header 'X-Provider-Signature: <x-provider-signature>' \
--data '"<string>"'import requests
url = "http://localhost:8090/internal/v1/webhooks/{provider}/{endpoint_id}"
payload = "<string>"
headers = {
"X-Provider-Signature": "<x-provider-signature>",
"Authorization": "Bearer <token>",
"Content-Type": "application/octet-stream"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-Provider-Signature': '<x-provider-signature>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/octet-stream'
},
body: JSON.stringify('<string>')
};
fetch('http://localhost:8090/internal/v1/webhooks/{provider}/{endpoint_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "8090",
CURLOPT_URL => "http://localhost:8090/internal/v1/webhooks/{provider}/{endpoint_id}",
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('<string>'),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/octet-stream",
"X-Provider-Signature: <x-provider-signature>"
],
]);
$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 := "http://localhost:8090/internal/v1/webhooks/{provider}/{endpoint_id}"
payload := strings.NewReader("\"<string>\"")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Provider-Signature", "<x-provider-signature>")
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/octet-stream")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("http://localhost:8090/internal/v1/webhooks/{provider}/{endpoint_id}")
.header("X-Provider-Signature", "<x-provider-signature>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/octet-stream")
.body("\"<string>\"")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:8090/internal/v1/webhooks/{provider}/{endpoint_id}")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["X-Provider-Signature"] = '<x-provider-signature>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/octet-stream'
request.body = "\"<string>\""
response = http.request(request)
puts response.read_bodyEntregar un webhook del proveedor, crudo y firmado
El conector reenvía el cuerpo sin tocar, porque la firma es sobre esos bytes exactos: cualquier reserialización la invalida. El webhook no trae el recurso, trae «cambió el producto 123»; el worker se lo pide después por /internal/v1/fetch.
curl --request POST \
--url http://localhost:8090/internal/v1/webhooks/{provider}/{endpoint_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/octet-stream' \
--header 'X-Provider-Signature: <x-provider-signature>' \
--data '"<string>"'import requests
url = "http://localhost:8090/internal/v1/webhooks/{provider}/{endpoint_id}"
payload = "<string>"
headers = {
"X-Provider-Signature": "<x-provider-signature>",
"Authorization": "Bearer <token>",
"Content-Type": "application/octet-stream"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-Provider-Signature': '<x-provider-signature>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/octet-stream'
},
body: JSON.stringify('<string>')
};
fetch('http://localhost:8090/internal/v1/webhooks/{provider}/{endpoint_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "8090",
CURLOPT_URL => "http://localhost:8090/internal/v1/webhooks/{provider}/{endpoint_id}",
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('<string>'),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/octet-stream",
"X-Provider-Signature: <x-provider-signature>"
],
]);
$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 := "http://localhost:8090/internal/v1/webhooks/{provider}/{endpoint_id}"
payload := strings.NewReader("\"<string>\"")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Provider-Signature", "<x-provider-signature>")
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/octet-stream")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("http://localhost:8090/internal/v1/webhooks/{provider}/{endpoint_id}")
.header("X-Provider-Signature", "<x-provider-signature>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/octet-stream")
.body("\"<string>\"")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:8090/internal/v1/webhooks/{provider}/{endpoint_id}")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["X-Provider-Signature"] = '<x-provider-signature>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/octet-stream'
request.body = "\"<string>\""
response = http.request(request)
puts response.read_bodyAutorizaciones
El conector de plataforma y el operador. Registra conexiones, entrega webhooks, corre la saga de instalación y da de alta conexiones custom. Es el único principal obligatorio del proceso: los otros tres se apagan dejando su token vacío, y una puerta que no se monta no la abre ningún token.
Encabezados
La firma del proveedor sobre el cuerpo crudo, verificada con el secreto de la app que selecciona el endpoint ya resuelto. No hay lectura de AWS por webhook.
1Parámetros de ruta
El proveedor del webhook. Tiene que ser el del principal del token y estar entre los adapters montados; si no, 401.
1El endpoint que resuelve la conexión y la tienda. La tienda sale de acá, no de la configuración del proceso: una app tiene una sola URL y la instalan N merchants.
1Cuerpo
El cuerpo del proveedor, byte por byte.
The body is of type file.
Respuesta
La entrega quedó archivada y registrada. Sin cuerpo.