Monitoring the activity of your webhooks is crucial to gain visibility into the messages and delivery attempts made by the webhook system. By utilizing appropriate API calls, you can retrieve valuable information about the status and performance of your webhooks. These API calls allow you to view the webhook messages, track successful deliveries, and identify any delivery failures or retries. Monitoring webhook activity empowers you to stay informed about the real-time performance of your integrations, enabling you to troubleshoot issues, optimize delivery, and ensure reliable data synchronization. In this section, we will explore the various API calls available to monitor webhook activity, providing you with the necessary tools to effectively track and analyze the performance of your webhooks.
Messages
In the context of webhooks, a "message" refers to the payload sent to your webhook endpoint whenever a specific event occurs. Each message represents a discrete event-triggered notification that contains relevant data related to the event. It serves as a communication bridge between the source of the event and your webhook integration.
A message can have multiple delivery attempts, depending on the success or failure of previous delivery attempts. If a delivery attempt fails, the webhook system will automatically retry sending the message to your endpoint.
By monitoring the messages sent to your webhook, you can gain insights into the occurrence of events and the delivery status of each message. This allows you to track the history of events and identify any potential issues or patterns in message delivery. With this information, you can ensure the reliability and effectiveness of your webhook integrations, and take necessary actions to handle any failed delivery attempts.
You can list all of the messages for a specific endpoint by making a GET request to the /v1/webhooks/{webhookId}/messages
endpoint:
curl 'http://sandboxapi.givechariot.com/v1/webhooks/ep_2RqbEdIw7bfvHnCymJWvQrP23zG/messages' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer <ACCESS_TOKEN>'
using System.Net.Http;
HttpClient client = new HttpClient();
HttpRequestMessage request = new HttpRequestMessage(HttpMethod.Get, "http://sandboxapi.givechariot.com/v1/webhooks/ep_2RqbEdIw7bfvHnCymJWvQrP23zG/messages");
request.Headers.Add("Accept", "application/json");
request.Headers.Add("Authorization", "Bearer <ACCESS_TOKEN>");
HttpResponseMessage response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
string responseBody = await response.Content.ReadAsStringAsync();
package main
import (
"fmt"
"io"
"log"
"net/http"
)
func main() {
client := &http.Client{}
req, err := http.NewRequest("GET", "http://sandboxapi.givechariot.com/v1/webhooks/ep_2RqbEdIw7bfvHnCymJWvQrP23zG/messages", nil)
if err != nil {
log.Fatal(err)
}
req.Header.Set("Accept", "application/json")
req.Header.Set("Authorization", "Bearer <ACCESS_TOKEN>")
resp, err := client.Do(req)
if err != nil {
log.Fatal(err)
}
defer resp.Body.Close()
bodyText, err := io.ReadAll(resp.Body)
if err != nil {
log.Fatal(err)
}
fmt.Printf("%s\n", bodyText)
}
import java.io.IOException;
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("http://sandboxapi.givechariot.com/v1/webhooks/ep_2RqbEdIw7bfvHnCymJWvQrP23zG/messages"))
.GET()
.setHeader("Accept", "application/json")
.setHeader("Authorization", "Bearer <ACCESS_TOKEN>")
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
$.ajax({
url: 'http://sandboxapi.givechariot.com/v1/webhooks/ep_2RqbEdIw7bfvHnCymJWvQrP23zG/messages',
crossDomain: true,
headers: {
'Accept': 'application/json',
'Authorization': 'Bearer <ACCESS_TOKEN>'
}
}).done(function(response) {
console.log(response);
});
var request = require('request');
var headers = {
'Accept': 'application/json',
'Authorization': 'Bearer <ACCESS_TOKEN>'
};
var options = {
url: 'http://sandboxapi.givechariot.com/v1/webhooks/ep_2RqbEdIw7bfvHnCymJWvQrP23zG/messages',
headers: headers
};
function callback(error, response, body) {
if (!error && response.statusCode == 200) {
console.log(body);
}
}
request(options, callback);
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'http://sandboxapi.givechariot.com/v1/webhooks/ep_2RqbEdIw7bfvHnCymJWvQrP23zG/messages');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Accept: application/json',
'Authorization: Bearer <ACCESS_TOKEN>',
]);
$response = curl_exec($ch);
curl_close($ch);
import http.client
conn = http.client.HTTPConnection("sandboxapi.givechariot.com")
headers = {
'Accept': "application/json",
'Authorization': "Bearer <ACCESS_TOKEN>"
}
conn.request("GET", "/v1/webhooks/ep_2RqbEdIw7bfvHnCymJWvQrP23zG/messages", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
require 'net/http'
uri = URI('http://sandboxapi.givechariot.com/v1/webhooks/ep_2RqbEdIw7bfvHnCymJWvQrP23zG/messages')
req = Net::HTTP::Get.new(uri)
req['Accept'] = 'application/json'
req['Authorization'] = 'Bearer <ACCESS_TOKEN>'
req_options = {
use_ssl: uri.scheme == 'https'
}
res = Net::HTTP.start(uri.hostname, uri.port, req_options) do |http|
http.request(req)
end
The list messages method will not return the message payload. To get the payload for a specific message, issue a request to
GET /v1/webhooks/{webhookId/messages/{messageId}
Attempts
When a webhook message is sent, it may go through multiple delivery attempts to ensure successful delivery to your endpoint. An "attempt" refers to each individual effort made to deliver a webhook message. In cases where the initial delivery attempt fails, the webhook system will automatically retry sending the message.
You can list all of the attempts for a specific endpoint for a specific message by making a GET request to the /v1/webhooks/{webhookId}/messages/{messageId}/attempts
endpoint:
curl 'http://sandboxapi.givechariot.com/v1/webhooks/ep_2RqbEdIw7bfvHnCymJWvQrP23zG/messages/msg_2RqbI0ZobX5fKeDoNWg4RgLZula/attempts' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer <ACCESS_TOKEN>'
using System.Net.Http;
HttpClient client = new HttpClient();
HttpRequestMessage request = new HttpRequestMessage(HttpMethod.Get, "http://sandboxapi.givechariot.com/v1/webhooks/ep_2RqbEdIw7bfvHnCymJWvQrP23zG/messages/msg_2RqbI0ZobX5fKeDoNWg4RgLZula/attempts");
request.Headers.Add("Accept", "application/json");
request.Headers.Add("Authorization", "Bearer <ACCESS_TOKEN>");
HttpResponseMessage response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
string responseBody = await response.Content.ReadAsStringAsync();
package main
import (
"fmt"
"io"
"log"
"net/http"
)
func main() {
client := &http.Client{}
req, err := http.NewRequest("GET", "http://sandboxapi.givechariot.com/v1/webhooks/ep_2RqbEdIw7bfvHnCymJWvQrP23zG/messages/msg_2RqbI0ZobX5fKeDoNWg4RgLZula/attempts", nil)
if err != nil {
log.Fatal(err)
}
req.Header.Set("Accept", "application/json")
req.Header.Set("Authorization", "Bearer <ACCESS_TOKEN>")
resp, err := client.Do(req)
if err != nil {
log.Fatal(err)
}
defer resp.Body.Close()
bodyText, err := io.ReadAll(resp.Body)
if err != nil {
log.Fatal(err)
}
fmt.Printf("%s\n", bodyText)
}
import java.io.IOException;
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("http://sandboxapi.givechariot.com/v1/webhooks/ep_2RqbEdIw7bfvHnCymJWvQrP23zG/messages/msg_2RqbI0ZobX5fKeDoNWg4RgLZula/attempts"))
.GET()
.setHeader("Accept", "application/json")
.setHeader("Authorization", "Bearer <ACCESS_TOKEN>")
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
$.ajax({
url: 'http://sandboxapi.givechariot.com/v1/webhooks/ep_2RqbEdIw7bfvHnCymJWvQrP23zG/messages/msg_2RqbI0ZobX5fKeDoNWg4RgLZula/attempts',
crossDomain: true,
headers: {
'Accept': 'application/json',
'Authorization': 'Bearer <ACCESS_TOKEN>'
}
}).done(function(response) {
console.log(response);
});
var request = require('request');
var headers = {
'Accept': 'application/json',
'Authorization': 'Bearer <ACCESS_TOKEN>'
};
var options = {
url: 'http://sandboxapi.givechariot.com/v1/webhooks/ep_2RqbEdIw7bfvHnCymJWvQrP23zG/messages/msg_2RqbI0ZobX5fKeDoNWg4RgLZula/attempts',
headers: headers
};
function callback(error, response, body) {
if (!error && response.statusCode == 200) {
console.log(body);
}
}
request(options, callback);
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'http://sandboxapi.givechariot.com/v1/webhooks/ep_2RqbEdIw7bfvHnCymJWvQrP23zG/messages/msg_2RqbI0ZobX5fKeDoNWg4RgLZula/attempts');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Accept: application/json',
'Authorization: Bearer <ACCESS_TOKEN>',
]);
$response = curl_exec($ch);
curl_close($ch);
import http.client
conn = http.client.HTTPConnection("sandboxapi.givechariot.com")
headers = {
'Accept': "application/json",
'Authorization': "Bearer <ACCESS_TOKEN>"
}
conn.request("GET", "/v1/webhooks/ep_2RqbEdIw7bfvHnCymJWvQrP23zG/messages/msg_2RqbI0ZobX5fKeDoNWg4RgLZula/attempts", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
require 'net/http'
uri = URI('http://sandboxapi.givechariot.com/v1/webhooks/ep_2RqbEdIw7bfvHnCymJWvQrP23zG/messages/msg_2RqbI0ZobX5fKeDoNWg4RgLZula/attempts')
req = Net::HTTP::Get.new(uri)
req['Accept'] = 'application/json'
req['Authorization'] = 'Bearer <ACCESS_TOKEN>'
req_options = {
use_ssl: uri.scheme == 'https'
}
res = Net::HTTP.start(uri.hostname, uri.port, req_options) do |http|
http.request(req)
end
The list attempts method will not return the response body. To get the response body for a specific attempt, issue a request to
GET /v1/webhooks/{webhookId/messages/{messageId}/attempts/{attemptId}