Register
Endpoint: /webhooks/v1/registrations
Registers for webhook event delivery
POST
https://sandbox.crbcos.com/webhooks/v1/registrations
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://sandbox.crbcos.com/Webhooks/v1/registrations"
method := "POST"
payload := strings.NewReader(`{`+"
"+`
"partnerId": "19222b81-0e1e-452d-a842-b2f1011c16f3",`+"
"+`
"eventName": "Cards.Card.Activated",`+"
"+`
"callbackUrl": "https://webhook.site/27b9814b-16eb-4099-9999-32594aee5e04",`+"
"+`
"type": "Push",`+"
"+`
"format": "Extended"`+"
"+`
}`+"
"+`
`+"
"+`
`)
client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)
if err != nil {
fmt.Println(err)
return
}
req.Header.Add("Content-Type", "application/json")
req.Header.Add("Authorization", "••••••")
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))
}