Update by ID
Endpoint: /webhooks/v1/registrations/{id}
Updates the details of a webhook registration by ID
PUT
https://sandbox.crbcos.com/webhooks/v1/registrations/{id}
Path Parameters
- idstringDescription
Body Parameters
- partnerIdstringrequiredDescription
- eventNamestringrequiredDescription
- callbackUrlstringrequiredDescription
- authUsernamestringDescription
- authPasswordstringDescription
- consecutiveErrorsintegerDescription
- lastErrorstringDescription
- statusstringDescription
- typestringDescription
- formatstringDescription
Response
- idstringDescription
- partnerIdstringDescription
- eventNamestringDescription
- callbackURLstringDescription
- authUsernamestringDescription
- authPasswordstringDescription
- consecutiveErrorsintegerDescription
- lastErrorstringDescription
- statusstringDescription
- typestringDescription
- formatstringDescription
curl
curl --location --globoff --request PUT 'https://sandbox.crbcos.com/webhooks/v1/registrations/{id}?id=d0dc5a57-ce2a-40d8-b7c4-b306003dd243' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"partnerId": "19222b81-0e1e-452d-a842-b2f1011c16f3",
"eventName": "ACH.batch.imported",
"callbackUrl": "https://webhook.site/27b9814b-16eb-4099-9999-32594aee5e04"
}'nodejs
var https = require('follow-redirects').https;
var fs = require('fs');
var options = {
'method': 'PUT',
'hostname': 'sandbox.crbcos.com',
'path': '/webhooks/v1/registrations/{id}?id=d0dc5a57-ce2a-40d8-b7c4-b306003dd243',
'headers': {
'Authorization': 'Bearer <token>',
'Content-Type': 'application/json'
},
'maxRedirects': 20
};
var req = https.request(options, function (res) {
var chunks = [];
res.on("data", function (chunk) {
chunks.push(chunk);
});
res.on("end", function (chunk) {
var body = Buffer.concat(chunks);
console.log(body.toString());
});
res.on("error", function (error) {
console.error(error);
});
});
var postData = "{\r\n \n \"partnerId\": \"19222b81-0e1e-452d-a842-b2f1011c16f3\",\r\n \"eventName\": \"ACH.batch.imported\",\r\n \"callbackUrl\": \"https://webhook.site/27b9814b-16eb-4099-9999-32594aee5e04\"\r\n \n \n \n \n \n}";
req.write(postData);
req.end();python
import requests
url = "https://sandbox.crbcos.com/webhooks/v1/registrations/{id}?id=d0dc5a57-ce2a-40d8-b7c4-b306003dd243"
payload = "{\r\n \n \"partnerId\": \"19222b81-0e1e-452d-a842-b2f1011c16f3\",\r\n \"eventName\": \"ACH.batch.imported\",\r\n \"callbackUrl\": \"https://webhook.site/27b9814b-16eb-4099-9999-32594aee5e04\"\r\n \n \n \n \n \n}"
headers = {
'Authorization': 'Bearer <token>',
'Content-Type': 'application/json'
}
response = requests.request("PUT", url, headers=headers, data=payload)
print(response.text)
ruby
require "uri"
require "net/http"
url = URI("https://sandbox.crbcos.com/webhooks/v1/registrations/{id}?id=d0dc5a57-ce2a-40d8-b7c4-b306003dd243")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = "Bearer <token>"
request["Content-Type"] = "application/json"
request.body = "{\r\n \n \"partnerId\": \"19222b81-0e1e-452d-a842-b2f1011c16f3\",\r\n \"eventName\": \"ACH.batch.imported\",\r\n \"callbackUrl\": \"https://webhook.site/27b9814b-16eb-4099-9999-32594aee5e04\"\r\n \n \n \n \n \n}"
response = https.request(request)
puts response.read_body
go
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://sandbox.crbcos.com/webhooks/v1/registrations/{id}?id=d0dc5a57-ce2a-40d8-b7c4-b306003dd243"
method := "PUT"
payload := strings.NewReader(`{
"partnerId": "19222b81-0e1e-452d-a842-b2f1011c16f3",
"eventName": "ACH.batch.imported",
"callbackUrl": "https://webhook.site/27b9814b-16eb-4099-9999-32594aee5e04"
}`)
client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)
if err != nil {
fmt.Println(err)
return
}
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()
body, err := io.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}200
{
"id": "d0dc5a57-ce2a-40d8-b7c4-b306003dd243",
"partnerId": "19222b81-0e1e-452d-a842-b2f1011c16f3",
"eventName": "ACH.Batch.Imported",
"callbackUrl": "https://webhook.site/27b9814b-16eb-4099-9999-32594aee5e04",
"consecutiveErrors": 0,
"status": "Active",
"type": "Push",
"format": "Basic"
}