Documentation IndexFetch the complete documentation index at: /llms.txtUse this file to discover all available pages before exploring further.
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Manage webhook endpoints and verify signatures
wh, err := client.Webhooks.Create(ctx, grantex.CreateWebhookParams{ URL: "https://example.com/webhooks/grantex", Events: []string{"grant.created", "grant.revoked", "token.issued"}, }) fmt.Printf("Webhook ID: %s, Secret: %s\n", wh.ID, wh.Secret)
result, err := client.Webhooks.List(ctx) for _, wh := range result.Webhooks { fmt.Printf("%s: %s (%v)\n", wh.ID, wh.URL, wh.Events) }
err := client.Webhooks.Delete(ctx, "webhook-id")
func webhookHandler(w http.ResponseWriter, r *http.Request) { body, _ := io.ReadAll(r.Body) signature := r.Header.Get("X-Grantex-Signature") secret := "whsec_your_webhook_secret" if !grantex.VerifyWebhookSignature(body, signature, secret) { http.Error(w, "invalid signature", http.StatusUnauthorized) return } // Process the webhook payload fmt.Println("Webhook verified!") w.WriteHeader(http.StatusOK) }
sha256=<hex-encoded HMAC>
grant.created
grant.revoked
token.issued