Get Webhooks
curl --request GET \
--url https://webhooks.sbx.moduluslabs.io/v1/webhooks \
--header 'Authorization: Basic <encoded-value>'import requests
url = "https://webhooks.sbx.moduluslabs.io/v1/webhooks"
headers = {"Authorization": "Basic <encoded-value>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Basic <encoded-value>'}};
fetch('https://webhooks.sbx.moduluslabs.io/v1/webhooks', 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://webhooks.sbx.moduluslabs.io/v1/webhooks",
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: Basic <encoded-value>"
],
]);
$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://webhooks.sbx.moduluslabs.io/v1/webhooks"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Basic <encoded-value>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://webhooks.sbx.moduluslabs.io/v1/webhooks")
.header("Authorization", "Basic <encoded-value>")
.asString();using RestSharp;
var options = new RestClientOptions("https://webhooks.sbx.moduluslabs.io/v1/webhooks");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("Authorization", "Basic <encoded-value>");
var response = await client.GetAsync(request);
Console.WriteLine("{0}", response.Content);
[
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"callbackUrl": "https://your-domain.com/webhooks/modulus",
"webhookAction": "QRPH_SUCCESS",
"webhookStatus": "ENABLED"
}
]{
"code": "20000003",
"error": "<string>",
"referenceNumber": "<string>"
}Webhooks API
List Webhooks
List your registered webhook endpoints
GET
/
v1
/
webhooks
Get Webhooks
curl --request GET \
--url https://webhooks.sbx.moduluslabs.io/v1/webhooks \
--header 'Authorization: Basic <encoded-value>'import requests
url = "https://webhooks.sbx.moduluslabs.io/v1/webhooks"
headers = {"Authorization": "Basic <encoded-value>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Basic <encoded-value>'}};
fetch('https://webhooks.sbx.moduluslabs.io/v1/webhooks', 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://webhooks.sbx.moduluslabs.io/v1/webhooks",
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: Basic <encoded-value>"
],
]);
$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://webhooks.sbx.moduluslabs.io/v1/webhooks"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Basic <encoded-value>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://webhooks.sbx.moduluslabs.io/v1/webhooks")
.header("Authorization", "Basic <encoded-value>")
.asString();using RestSharp;
var options = new RestClientOptions("https://webhooks.sbx.moduluslabs.io/v1/webhooks");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("Authorization", "Basic <encoded-value>");
var response = await client.GetAsync(request);
Console.WriteLine("{0}", response.Content);
[
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"callbackUrl": "https://your-domain.com/webhooks/modulus",
"webhookAction": "QRPH_SUCCESS",
"webhookStatus": "ENABLED"
}
]{
"code": "20000003",
"error": "<string>",
"referenceNumber": "<string>"
}The response is an encrypted envelope
{ "response": { "Token": "<JWE>" } }. Decrypt the Token with your Encryption Key to get the array of webhooks, each with a UUID id, a scalar webhookAction, webhookStatus, and callbackUrl. If you have no webhooks registered, this returns 400 with code 10000032 (not an empty array).Authorizations
HTTP Basic Authentication using your Secret Key as the username and an empty password
Response
List of webhooks retrieved successfully
Unique identifier for the webhook
The transaction event this webhook receives.
Available options:
QRPH_SUCCESS, QRPH_DECLINED Current status of the webhook
Available options:
ENABLED, DISABLED The HTTPS URL where notifications are sent
Was this page helpful?