Class: Vonage::Messaging
- Inherits:
-
Namespace
- Object
- Namespace
- Vonage::Messaging
- Extended by:
- Forwardable
- Defined in:
- lib/vonage/messaging.rb
Defined Under Namespace
Classes: Message
Instance Method Summary collapse
-
#send(to:, from:, **message) ⇒ Object
Send a Message.
-
#update(message_uuid:, **params) ⇒ Object
Update a Message Object.
-
#verify_webhook_token(token:, signature_secret: @config.signature_secret) ⇒ Boolean
Validate a JSON Web Token from a Messages API Webhook.
Instance Method Details
#send(to:, from:, **message) ⇒ Object
Send a Message.
30 31 32 |
# File 'lib/vonage/messaging.rb', line 30 def send(to:, from:, **) request('/v1/messages', params: {to: to, from: from, **}, type: Post) end |
#update(message_uuid:, **params) ⇒ Object
Update a Message Object.
‘:message_uuid` is always required. Other parameters will depend on the message channel and the specific action being performed.
44 45 46 |
# File 'lib/vonage/messaging.rb', line 44 def update(message_uuid:, **params) request("/v1/messages/#{}", params: params, type: Patch) end |
#verify_webhook_token(token:, signature_secret: @config.signature_secret) ⇒ Boolean
Validate a JSON Web Token from a Messages API Webhook.
55 56 57 |
# File 'lib/vonage/messaging.rb', line 55 def verify_webhook_token(token:, signature_secret: @config.signature_secret) JWT.verify_hs256_signature(token: token, signature_secret: signature_secret) end |