Receber webhook de sistema
curl --request POST \
--url https://{space}.{region}.api.niadra.com/v1/ingest/webhook/{source_id}import requests
url = "https://{space}.{region}.api.niadra.com/v1/ingest/webhook/{source_id}"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://{space}.{region}.api.niadra.com/v1/ingest/webhook/{source_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_URL => "https://{space}.{region}.api.niadra.com/v1/ingest/webhook/{source_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://{space}.{region}.api.niadra.com/v1/ingest/webhook/{source_id}"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://{space}.{region}.api.niadra.com/v1/ingest/webhook/{source_id}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{space}.{region}.api.niadra.com/v1/ingest/webhook/{source_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_body{
"accepted": 1,
"duplicates": 0,
"errors": []
}{
"code": "<string>",
"status": 123,
"title": "<string>",
"detail": "<string>",
"request_id": "<string>",
"type": "about:blank"
}Escrita
Receber webhook de sistema
A entrada genérica para CRM, ERP e help desk, com mapeamento versionado e autenticação da fonte.
POST
/
v1
/
ingest
/
webhook
/
{source_id}
Receber webhook de sistema
curl --request POST \
--url https://{space}.{region}.api.niadra.com/v1/ingest/webhook/{source_id}import requests
url = "https://{space}.{region}.api.niadra.com/v1/ingest/webhook/{source_id}"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://{space}.{region}.api.niadra.com/v1/ingest/webhook/{source_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_URL => "https://{space}.{region}.api.niadra.com/v1/ingest/webhook/{source_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://{space}.{region}.api.niadra.com/v1/ingest/webhook/{source_id}"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://{space}.{region}.api.niadra.com/v1/ingest/webhook/{source_id}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{space}.{region}.api.niadra.com/v1/ingest/webhook/{source_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_body{
"accepted": 1,
"duplicates": 0,
"errors": []
}{
"code": "<string>",
"status": 123,
"title": "<string>",
"detail": "<string>",
"request_id": "<string>",
"type": "about:blank"
}Parâmetros de caminho
A fonte configurada para este sistema.
Resposta
O conteúdo depois do mapeamento da fonte, como resultado de lote: aceitos, duplicados e um erro por item recusado. O conteúdo bruto fica guardado em todos os casos.

