Vonage / vonage-ruby-sdk

Vonage REST API client for Ruby. API support for SMS, Voice, Text-to-Speech, Numbers, Verify (2FA) and more.
https://developer.vonage.com
Apache License 2.0
217 stars 108 forks source link

Add custom data from API call to webhook response #217

Closed benebrice closed 10 months ago

benebrice commented 2 years ago

Currently, no custom data are allowed to be passed from API call that will be transferred to Webhook.

It's always be useful for the client to be able to add custom data for themselves they will catch on webhook calls.

Those custom data might be shared/transferred via the JWT or directly with another HEADER.

AWS has implemented it years ago amazon-ses-now-includes-original-message-headers-in-notifications

superchilled commented 10 months ago

This is a function of the API rather than the SDK. It's not possible to expose functionality in the SDK that doesn't exist in the API.

Note: some Vonage APIs do provide a means of passing custom data into an AP request that is then included in the webhook. For example, the Messages API /v1/messages endpoint includes an optional client_ref parameter in the body which, if included, is then present in the Message Status Webhook.