Cadastrar Webhook
curl --request POST \
--url https://api.multchats.com/v2/integration/webhook/create \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"integrationId": "<string>",
"url": "<string>",
"headers": [
{
"key": "<string>",
"value": "<string>"
}
],
"delayMinutes": 1
}
'import requests
url = "https://api.multchats.com/v2/integration/webhook/create"
payload = {
"integrationId": "<string>",
"url": "<string>",
"headers": [
{
"key": "<string>",
"value": "<string>"
}
],
"delayMinutes": 1
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
integrationId: '<string>',
url: '<string>',
headers: [{key: '<string>', value: '<string>'}],
delayMinutes: 1
})
};
fetch('https://api.multchats.com/v2/integration/webhook/create', 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://api.multchats.com/v2/integration/webhook/create",
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([
'integrationId' => '<string>',
'url' => '<string>',
'headers' => [
[
'key' => '<string>',
'value' => '<string>'
]
],
'delayMinutes' => 1
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://api.multchats.com/v2/integration/webhook/create"
payload := strings.NewReader("{\n \"integrationId\": \"<string>\",\n \"url\": \"<string>\",\n \"headers\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"delayMinutes\": 1\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://api.multchats.com/v2/integration/webhook/create")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"integrationId\": \"<string>\",\n \"url\": \"<string>\",\n \"headers\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"delayMinutes\": 1\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.multchats.com/v2/integration/webhook/create")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"integrationId\": \"<string>\",\n \"url\": \"<string>\",\n \"headers\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"delayMinutes\": 1\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"response": {
"webhook": {
"id": "<string>",
"integrationId": "<string>",
"url": "<string>",
"method": "<string>",
"type": "<string>",
"headers": "<array>",
"delayMinutes": 123,
"transferType": "<string>",
"createdAt": "<string>",
"updatedAt": "<string>"
}
}
}{
"success": false,
"message": "Erro ao enviar mensagem"
}Integrações
Cadastrar Webhook
Cadastra um webhook para receber notificações de eventos de uma integração.
POST
/
integration
/
webhook
/
create
Cadastrar Webhook
curl --request POST \
--url https://api.multchats.com/v2/integration/webhook/create \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"integrationId": "<string>",
"url": "<string>",
"headers": [
{
"key": "<string>",
"value": "<string>"
}
],
"delayMinutes": 1
}
'import requests
url = "https://api.multchats.com/v2/integration/webhook/create"
payload = {
"integrationId": "<string>",
"url": "<string>",
"headers": [
{
"key": "<string>",
"value": "<string>"
}
],
"delayMinutes": 1
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
integrationId: '<string>',
url: '<string>',
headers: [{key: '<string>', value: '<string>'}],
delayMinutes: 1
})
};
fetch('https://api.multchats.com/v2/integration/webhook/create', 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://api.multchats.com/v2/integration/webhook/create",
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([
'integrationId' => '<string>',
'url' => '<string>',
'headers' => [
[
'key' => '<string>',
'value' => '<string>'
]
],
'delayMinutes' => 1
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://api.multchats.com/v2/integration/webhook/create"
payload := strings.NewReader("{\n \"integrationId\": \"<string>\",\n \"url\": \"<string>\",\n \"headers\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"delayMinutes\": 1\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://api.multchats.com/v2/integration/webhook/create")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"integrationId\": \"<string>\",\n \"url\": \"<string>\",\n \"headers\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"delayMinutes\": 1\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.multchats.com/v2/integration/webhook/create")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"integrationId\": \"<string>\",\n \"url\": \"<string>\",\n \"headers\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"delayMinutes\": 1\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"response": {
"webhook": {
"id": "<string>",
"integrationId": "<string>",
"url": "<string>",
"method": "<string>",
"type": "<string>",
"headers": "<array>",
"delayMinutes": 123,
"transferType": "<string>",
"createdAt": "<string>",
"updatedAt": "<string>"
}
}
}{
"success": false,
"message": "Erro ao enviar mensagem"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
ID da integração
Pattern:
^c[a-z0-9]{24}$URL do webhook
Método HTTP
Available options:
GET, POST, PUT, DELETE, PATCH Tipo de evento que dispara o webhook
Available options:
MESSAGE_SENT_AND_RECEIVED, MESSAGE_SENT, MESSAGE_RECEIVED, FIRST_MESSAGE_RECEIVED, MESSAGE_IN_SERVICE, CONNECTION_STATUS_UPDATE, SERVICE_CONTINUITY_VERIFICATION Cabeçalhos HTTP adicionais
Show child attributes
Show child attributes
Atraso em minutos antes de disparar o webhook
Required range:
x >= 0Tipo de transferência para filtrar o disparo do webhook
Available options:
ALL, USER, AUTOMATION, API, AUTOMATION_AND_API ⌘I

