Vonage / vonage-php-sdk-core

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

New Messages API Features #465

Closed SecondeJK closed 7 months ago

SecondeJK commented 7 months ago

This PR provides parity with new Messages API features.

Description

webhook_url and webhook_version have been added to all Messages API Objects sms property added to outbound SMS text objects, containing encoding_type, content_id, entity_id and ttl MMS vCard now has caption WhatsApp File object now has name

Fixed the Viber Video object which was missing the viber_service object, but now has mandatory duration and file_size keys

Motivation and Context

Parity with Vonage APIs

How Has This Been Tested?

Existing tests have been modified

Example Output or Screenshots (if appropriate):

Types of changes

Checklist:

SecondeJK commented 7 months ago

@superchilled That's true: you could actually send a file object with the caption for Viber - the way it works is with default values so that it's up to the user to populate the object correctly.

As the channels become more complex, I might introduce a validation set of classes. I don't want to extend the file objects for every channel - there's already more objects than I'd like. But with a validator, it could decorate them to say "you've done it wrong"

superchilled commented 7 months ago

@superchilled That's true: you could actually send a file object with the caption for Viber - the way it works is with default values so that it's up to the user to populate the object correctly.

As the channels become more complex, I might introduce a validation set of classes. I don't want to extend the file objects for every channel - there's already more objects than I'd like. But with a validator, it could decorate them to say "you've done it wrong"

Thanks Jim. That makes sense! :)