Listar eventos
curl --request GET \
--url https://api.blu.direct/v1/events \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.blu.direct/v1/events"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.blu.direct/v1/events', 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.blu.direct/v1/events",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
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;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.blu.direct/v1/events"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.blu.direct/v1/events")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.blu.direct/v1/events")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"object": "list",
"data": [
{
"id": "evt_5Tq0",
"object": "event",
"type": "message.received",
"phone_number": "<string>",
"api_version": "2026-10-11",
"data": {
"object": {
"type": "text",
"text": {
"body": "<string>",
"preview_url": false
},
"id": "msg_Zt4b",
"object": "message",
"chat": "<string>",
"direction": "inbound",
"status": "accepted",
"errors": [
{
"code": "not_on_whatsapp",
"message": "<string>"
}
],
"context": {
"message_id": "<string>"
},
"from": {
"wa_id": "5511988887777",
"name": "<string>"
},
"mentions": [
"<string>"
],
"broadcast": "<string>",
"pricing": {
"billable": true,
"category": "marketing"
},
"whatsapp_message_id": "<string>",
"created": 1760190012
},
"previous_attributes": {}
},
"created": 1760190012
}
],
"has_more": true,
"url": "/v1/chats"
}{
"error": {
"type": "invalid_request_error",
"message": "<string>",
"request_id": "<string>",
"code": "outside_service_window",
"param": "text.body",
"doc_url": "<string>"
}
}{
"error": {
"type": "invalid_request_error",
"message": "<string>",
"request_id": "<string>",
"code": "outside_service_window",
"param": "text.body",
"doc_url": "<string>"
}
}Eventos
Listar eventos
Eventos dos últimos 30 dias, do mais recente para o mais antigo.
GET
/
v1
/
events
Listar eventos
curl --request GET \
--url https://api.blu.direct/v1/events \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.blu.direct/v1/events"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.blu.direct/v1/events', 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.blu.direct/v1/events",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
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;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.blu.direct/v1/events"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.blu.direct/v1/events")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.blu.direct/v1/events")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"object": "list",
"data": [
{
"id": "evt_5Tq0",
"object": "event",
"type": "message.received",
"phone_number": "<string>",
"api_version": "2026-10-11",
"data": {
"object": {
"type": "text",
"text": {
"body": "<string>",
"preview_url": false
},
"id": "msg_Zt4b",
"object": "message",
"chat": "<string>",
"direction": "inbound",
"status": "accepted",
"errors": [
{
"code": "not_on_whatsapp",
"message": "<string>"
}
],
"context": {
"message_id": "<string>"
},
"from": {
"wa_id": "5511988887777",
"name": "<string>"
},
"mentions": [
"<string>"
],
"broadcast": "<string>",
"pricing": {
"billable": true,
"category": "marketing"
},
"whatsapp_message_id": "<string>",
"created": 1760190012
},
"previous_attributes": {}
},
"created": 1760190012
}
],
"has_more": true,
"url": "/v1/chats"
}{
"error": {
"type": "invalid_request_error",
"message": "<string>",
"request_id": "<string>",
"code": "outside_service_window",
"param": "text.body",
"doc_url": "<string>"
}
}{
"error": {
"type": "invalid_request_error",
"message": "<string>",
"request_id": "<string>",
"code": "outside_service_window",
"param": "text.body",
"doc_url": "<string>"
}
}Autorizações
Parâmetros de consulta
message.received: chegou uma mensagem.data.objecté a mensagem.message.updated: o status de uma mensagem enviada mudou.data.objecté a mensagem.phone_number.connected/phone_number.disconnected:data.objecté o número.broadcast.completed/broadcast.failed:data.objecté a campanha.
Opções disponíveis:
message.received, message.updated, phone_number.connected, phone_number.disconnected, broadcast.completed, broadcast.failed