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
216 stars 108 forks source link

Whatsapp Audio Files not being delivered in production #269

Closed gus-bn closed 1 year ago

gus-bn commented 1 year ago

Audio files are not being delivered through v1 whatsapp outbound API. Vonage returns 200 (OK) HTTP status but the audio file is never delivered to the user:

SDK code

client = Vonage::Client.new(
  application_id: '<APPLICATION-ID>',
  private_key: File.read('<'PATH-TO-PEM'>')
  )
message = Vonage::Messaging::Message.whatsapp(
  type: 'audio',
  message: {
    url: '<CDN-ENDPOINT>bc832675-e22a-45a2-9f08-8d8fb0a28e66.wav'
  }
)
client.messaging.send(
  from: '<FROM>',
  to: '<TO>',
  **message
)

HTTP Request

---
http_interactions:
- request:
    method: post
    uri: https://api.nexmo.com/v1/messages
    body:
      encoding: UTF-8
      string: '{"from":"<FROM>","to":"<TO>","channel":"whatsapp","message_type":"audio","audio":{"url":"<CDN-ENDPOINT>bc832675-e22a-45a2-9f08-8d8fb0a28e66.wav"}}'
    headers:
      Accept-Encoding:
      - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
      Accept:
      - application/json
      User-Agent:
      - vonage-ruby/7.10.0 ruby/3.0.0
      Authorization:
      - Bearer <TOKEN>
      Content-Type:
      - application/json
  response:
    status:
      code: 202
      message: Accepted
    headers:
      Date:
      - Fri, 02 Jun 2023 22:42:20 GMT
      Content-Type:
      - application/json
      Content-Length:
      - '55'
      Connection:
      - keep-alive
      X-Envoy-Upstream-Service-Time:
      - '29'
      X-Frame-Options:
      - deny
      X-Xss-Protection:
      - 1; mode=block
      Strict-Transport-Security:
      - max-age=31536000; includeSubdomains
      X-Content-Type-Options:
      - nosniff
      X-Ratelimit-Remaining:
      - '39'
      X-Ratelimit-Reset:
      - '1'
      Server:
      - envoy
    body:
      encoding: UTF-8
      string: '{"message_uuid":"f560ad4f-4068-4031-b204-a9ab5f102ea6"}'
  recorded_at: Fri, 02 Jun 2023 22:42:20 GMT
recorded_with: VCR 6.1.0

Plese review message_uuid: 'f560ad4f-4068-4031-b204-a9ab5f102ea6' since the audio was never delivered to the end user

gus-bn commented 1 year ago

This has been fixed, Vonage support confirmed that wav files will not work with WA. Updated integration with mp3 file