cURL
curl --request POST \
--url https://api.cakto.com.br/public_api/webhook/event_test/{id}/ \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.cakto.com.br/public_api/webhook/event_test/{id}/"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.cakto.com.br/public_api/webhook/event_test/{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://api.cakto.com.br/public_api/webhook/event_test/{id}/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}require 'uri'
require 'net/http'
url = URI("https://api.cakto.com.br/public_api/webhook/event_test/{id}/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_bodyHttpResponse<String> response = Unirest.post("https://api.cakto.com.br/public_api/webhook/event_test/{id}/")
.header("Authorization", "Bearer <token>")
.asString();using RestSharp;
var options = new RestClientOptions("https://api.cakto.com.br/public_api/webhook/event_test/{id}/");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("Authorization", "Bearer <token>");
var response = await client.PostAsync(request);
Console.WriteLine("{0}", response.Content);
{
"detail": "Evento reenviado com sucesso"
}Webhooks
Evento de Teste Webhook
Envia um evento de teste para o webhook especificado
POST
/
public_api
/
webhook
/
event_test
/
{id}
/
cURL
curl --request POST \
--url https://api.cakto.com.br/public_api/webhook/event_test/{id}/ \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.cakto.com.br/public_api/webhook/event_test/{id}/"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.cakto.com.br/public_api/webhook/event_test/{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://api.cakto.com.br/public_api/webhook/event_test/{id}/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}require 'uri'
require 'net/http'
url = URI("https://api.cakto.com.br/public_api/webhook/event_test/{id}/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_bodyHttpResponse<String> response = Unirest.post("https://api.cakto.com.br/public_api/webhook/event_test/{id}/")
.header("Authorization", "Bearer <token>")
.asString();using RestSharp;
var options = new RestClientOptions("https://api.cakto.com.br/public_api/webhook/event_test/{id}/");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("Authorization", "Bearer <token>");
var response = await client.PostAsync(request);
Console.WriteLine("{0}", response.Content);
{
"detail": "Evento reenviado com sucesso"
}Escopo
write webhooks
- Este endpoint envia uma requisição POST para a URL configurada no webhook com um payload de teste. Use-o para validar se sua integração está recebendo e processando eventos corretamente.
- É necessário informar o parâmetro
eventna query string para especificar qual tipo de evento deseja testar - O evento de teste será registrado no histórico de eventos do webhook
- Verifique se sua URL responde em até 8 segundos para evitar falhas de entrega
O
event informado não precisa ser um dos eventos configurados neste webhook — qualquer evento válido do catálogo de eventos pode ser testado, mesmo que o webhook não esteja inscrito nele.Authorizations
Token de autenticação do tipo Bearer {access_token}, onde {access_token} é o token obtido no fluxo de autenticação.
Path Parameters
Id do App Webhook
Query Parameters
custom_id do evento a ser testado
Available options:
boleto_gerado, chargeback, checkout_abandonment, openfinance_nubank_gerado, picpay_gerado, pix_gerado, purchase_approved, purchase_refused, refund, subscription_canceled, subscription_created, subscription_paused, subscription_renewal_refused, subscription_renewed, subscription_resumed Response
Corpo da resposta status 200
Was this page helpful?