You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
However, I'm new to tinkering with this API. So I apologise if I'm wrong! 😄
Current Behavior
It appears that if you pass a caption parameter to the Vonage\Messages\MessageObjects\AudioObject object, it will cause an API validation error because the caption field is unexpected.
Possible Solution
I'm probably not the best person to suggest a change for this. But my initial guess is that the AudioObject's toArray method should just ignore the caption field and not include it in the returned array. I think this could avoid a breaking change. But I guess this might confuse devs though if they're passing the caption field and not seeing it anywhere in the received WhatsApp message?
But, I think the long-term fix might be to completely remove all mentions of the caption field in the AudioObject.
Steps to Reproduce (for bugs)
I've been using this code here to reproduce the issue:
$whatsAppMessage = newWhatsAppAudio(
to: 'NUMBER_GOES_HERE',
from: 'NUMBER_GOES_HERE',
audioObject: newAudioObject(
url: 'AUDIO_URL_HERE',
caption: 'CAPTION_HERE', // This line causes the error!
),
);
app(Client::class)
->messages()
->send($whatsAppMessage);
Context
I'm not currently using this in a real-world application. I was just writing an article about how to send WhatsApp messages from your Laravel app using Vonage.
Your Environment
Environment name and version (e.g. PHP 7.2 on nginx 1.19.1): PHP 8.1
Operating System and version: MacOS Ventura
Using the following Vonage packages in my Laravel app:
vonage/client - 3.0.0
vonage/client-core - 3.1.5
vonage/nexmo-bridge - 0.1.1
vonage/vonage-laravel - 1.0.0
I hope I've given enough info, but if you need anything else, feel free to give me a shout and I'll try to get back to you 🙂
The text was updated successfully, but these errors were encountered:
Expected Behavior
I don't think you should be able to pass a caption for an audio message in WhatsApp. From looking at the docs, I get the impression that this is also the case (https://developer.vonage.com/messages/code-snippets/whatsapp/send-audio).
However, I'm new to tinkering with this API. So I apologise if I'm wrong! 😄
Current Behavior
It appears that if you pass a
caption
parameter to theVonage\Messages\MessageObjects\AudioObject
object, it will cause an API validation error because thecaption
field is unexpected.Possible Solution
I'm probably not the best person to suggest a change for this. But my initial guess is that the
AudioObject
'stoArray
method should just ignore thecaption
field and not include it in the returned array. I think this could avoid a breaking change. But I guess this might confuse devs though if they're passing thecaption
field and not seeing it anywhere in the received WhatsApp message?But, I think the long-term fix might be to completely remove all mentions of the
caption
field in theAudioObject
.Steps to Reproduce (for bugs)
I've been using this code here to reproduce the issue:
Context
I'm not currently using this in a real-world application. I was just writing an article about how to send WhatsApp messages from your Laravel app using Vonage.
Your Environment
Using the following Vonage packages in my Laravel app:
I hope I've given enough info, but if you need anything else, feel free to give me a shout and I'll try to get back to you 🙂
The text was updated successfully, but these errors were encountered: