Cancelar uma mensagem de WhatsApp
curl --request POST \
--url https://app.escrybe.com.br/api/whatsapp/v1/cancel \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"outbox_id": 123,
"message_id": 123
}
'import requests
url = "https://app.escrybe.com.br/api/whatsapp/v1/cancel"
payload = {
"outbox_id": 123,
"message_id": 123
}
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({outbox_id: 123, message_id: 123})
};
fetch('https://app.escrybe.com.br/api/whatsapp/v1/cancel', 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://app.escrybe.com.br/api/whatsapp/v1/cancel",
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([
'outbox_id' => 123,
'message_id' => 123
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"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://app.escrybe.com.br/api/whatsapp/v1/cancel"
payload := strings.NewReader("{\n \"outbox_id\": 123,\n \"message_id\": 123\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Basic <encoded-value>")
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://app.escrybe.com.br/api/whatsapp/v1/cancel")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"outbox_id\": 123,\n \"message_id\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.escrybe.com.br/api/whatsapp/v1/cancel")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"outbox_id\": 123,\n \"message_id\": 123\n}"
response = http.request(request)
puts response.read_body{
"status": 200,
"status_message": "<string>",
"data": {
"success": true,
"message_id": 123,
"outbox_id": 123,
"status": "cancelled",
"reimbursed": true,
"reimbursed_amount": 123
}
}{
"status": 400,
"status_message": "Campos obrigatórios não preenchidos",
"data": null
}{
"status": 401,
"status_message": "Unauthorized - invalid credentials",
"data": null
}{
"status": 200,
"status_message": "<string>",
"data": {}
}{
"status": 200,
"status_message": "<string>",
"data": {}
}{
"status": 200,
"status_message": "<string>",
"data": {}
}WhatsApp Messages
Cancelar uma mensagem de WhatsApp
Informe outbox_id ou message_id. Mensagens podem ser canceladas enquanto aguardam pagamento ou estão na fila (status do outbox pending/processing, ou status da mensagem 0/2). Reembolsos de créditos ocorrem apenas quando um admin cancela uma mensagem com falha paga com escrybe_credits.
POST
/
api
/
whatsapp
/
v1
/
cancel
Cancelar uma mensagem de WhatsApp
curl --request POST \
--url https://app.escrybe.com.br/api/whatsapp/v1/cancel \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"outbox_id": 123,
"message_id": 123
}
'import requests
url = "https://app.escrybe.com.br/api/whatsapp/v1/cancel"
payload = {
"outbox_id": 123,
"message_id": 123
}
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({outbox_id: 123, message_id: 123})
};
fetch('https://app.escrybe.com.br/api/whatsapp/v1/cancel', 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://app.escrybe.com.br/api/whatsapp/v1/cancel",
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([
'outbox_id' => 123,
'message_id' => 123
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"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://app.escrybe.com.br/api/whatsapp/v1/cancel"
payload := strings.NewReader("{\n \"outbox_id\": 123,\n \"message_id\": 123\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Basic <encoded-value>")
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://app.escrybe.com.br/api/whatsapp/v1/cancel")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"outbox_id\": 123,\n \"message_id\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.escrybe.com.br/api/whatsapp/v1/cancel")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"outbox_id\": 123,\n \"message_id\": 123\n}"
response = http.request(request)
puts response.read_body{
"status": 200,
"status_message": "<string>",
"data": {
"success": true,
"message_id": 123,
"outbox_id": 123,
"status": "cancelled",
"reimbursed": true,
"reimbursed_amount": 123
}
}{
"status": 400,
"status_message": "Campos obrigatórios não preenchidos",
"data": null
}{
"status": 401,
"status_message": "Unauthorized - invalid credentials",
"data": null
}{
"status": 200,
"status_message": "<string>",
"data": {}
}{
"status": 200,
"status_message": "<string>",
"data": {}
}{
"status": 200,
"status_message": "<string>",
"data": {}
}Autorizações
HTTP Basic onde o usuário é o e-mail da conta e a senha é o token de segurança.
⌘I