Update Webhook
curl --request PUT \
--url https://webhooks.sbx.moduluslabs.io/v1/webhooks/{id} \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"request": {
"Token": "eyJhbGciOiJBMjU2S1ciLCJlbmMiOiJBMjU2Q0JDLUhTNTEyIn0..."
}
}
'import requests
url = "https://webhooks.sbx.moduluslabs.io/v1/webhooks/{id}"
payload = { "request": { "Token": "eyJhbGciOiJBMjU2S1ciLCJlbmMiOiJBMjU2Q0JDLUhTNTEyIn0..." } }
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({request: {Token: 'eyJhbGciOiJBMjU2S1ciLCJlbmMiOiJBMjU2Q0JDLUhTNTEyIn0...'}})
};
fetch('https://webhooks.sbx.moduluslabs.io/v1/webhooks/{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://webhooks.sbx.moduluslabs.io/v1/webhooks/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'request' => [
'Token' => 'eyJhbGciOiJBMjU2S1ciLCJlbmMiOiJBMjU2Q0JDLUhTNTEyIn0...'
]
]),
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://webhooks.sbx.moduluslabs.io/v1/webhooks/{id}"
payload := strings.NewReader("{\n \"request\": {\n \"Token\": \"eyJhbGciOiJBMjU2S1ciLCJlbmMiOiJBMjU2Q0JDLUhTNTEyIn0...\"\n }\n}")
req, _ := http.NewRequest("PUT", 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.put("https://webhooks.sbx.moduluslabs.io/v1/webhooks/{id}")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"request\": {\n \"Token\": \"eyJhbGciOiJBMjU2S1ciLCJlbmMiOiJBMjU2Q0JDLUhTNTEyIn0...\"\n }\n}")
.asString();using RestSharp;
var options = new RestClientOptions("https://webhooks.sbx.moduluslabs.io/v1/webhooks/{id}");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("Authorization", "Basic <encoded-value>");
request.AddJsonBody("{\n \"request\": {\n \"Token\": \"eyJhbGciOiJBMjU2S1ciLCJlbmMiOiJBMjU2Q0JDLUhTNTEyIn0...\"\n }\n}", false);
var response = await client.PutAsync(request);
Console.WriteLine("{0}", response.Content);
{
"id": "<string>",
"webhookAction": "QRPH_SUCCESS",
"webhookStatus": "ENABLED",
"callbackUrl": "<string>"
}{
"code": "20000003",
"error": "<string>",
"referenceNumber": "<string>"
}{
"code": "20000003",
"error": "<string>",
"referenceNumber": "<string>"
}Webhooks API
Update Webhook
Update a webhook endpoint
PUT
/
v1
/
webhooks
/
{id}
Update Webhook
curl --request PUT \
--url https://webhooks.sbx.moduluslabs.io/v1/webhooks/{id} \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"request": {
"Token": "eyJhbGciOiJBMjU2S1ciLCJlbmMiOiJBMjU2Q0JDLUhTNTEyIn0..."
}
}
'import requests
url = "https://webhooks.sbx.moduluslabs.io/v1/webhooks/{id}"
payload = { "request": { "Token": "eyJhbGciOiJBMjU2S1ciLCJlbmMiOiJBMjU2Q0JDLUhTNTEyIn0..." } }
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({request: {Token: 'eyJhbGciOiJBMjU2S1ciLCJlbmMiOiJBMjU2Q0JDLUhTNTEyIn0...'}})
};
fetch('https://webhooks.sbx.moduluslabs.io/v1/webhooks/{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://webhooks.sbx.moduluslabs.io/v1/webhooks/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'request' => [
'Token' => 'eyJhbGciOiJBMjU2S1ciLCJlbmMiOiJBMjU2Q0JDLUhTNTEyIn0...'
]
]),
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://webhooks.sbx.moduluslabs.io/v1/webhooks/{id}"
payload := strings.NewReader("{\n \"request\": {\n \"Token\": \"eyJhbGciOiJBMjU2S1ciLCJlbmMiOiJBMjU2Q0JDLUhTNTEyIn0...\"\n }\n}")
req, _ := http.NewRequest("PUT", 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.put("https://webhooks.sbx.moduluslabs.io/v1/webhooks/{id}")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"request\": {\n \"Token\": \"eyJhbGciOiJBMjU2S1ciLCJlbmMiOiJBMjU2Q0JDLUhTNTEyIn0...\"\n }\n}")
.asString();using RestSharp;
var options = new RestClientOptions("https://webhooks.sbx.moduluslabs.io/v1/webhooks/{id}");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("Authorization", "Basic <encoded-value>");
request.AddJsonBody("{\n \"request\": {\n \"Token\": \"eyJhbGciOiJBMjU2S1ciLCJlbmMiOiJBMjU2Q0JDLUhTNTEyIn0...\"\n }\n}", false);
var response = await client.PutAsync(request);
Console.WriteLine("{0}", response.Content);
{
"id": "<string>",
"webhookAction": "QRPH_SUCCESS",
"webhookStatus": "ENABLED",
"callbackUrl": "<string>"
}{
"code": "20000003",
"error": "<string>",
"referenceNumber": "<string>"
}{
"code": "20000003",
"error": "<string>",
"referenceNumber": "<string>"
}The request and response are encrypted
{Token} envelopes. The decrypted request requires both callbackUrl (HTTPS) and webhookStatus (ENABLED or DISABLED); webhookAction cannot be changed. {id} is the webhook’s UUID.Authorizations
HTTP Basic Authentication using your Secret Key as the username and an empty password
Path Parameters
The unique identifier of the webhook
Body
application/json
Show child attributes
Show child attributes
Response
Webhook updated 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?