2

I am trying to send this gif - https://media.giphy.com/media/YVBC4HdSpB7z2/giphy.gif - using Twilio but I am getting this error - Channel did not accept given content. Please see Channel specific error message for more information.

This is my code -

try{

            $client = new Client(env('TWILIO_SID'), env('TWILIO_TOKEN'));
            $send = $client->messages->create(
                "whatsapp:".$my_phone_number, // Text this number
                array(
                    'from' => "whatsapp:".env('TWILIO_NUMBER'),
                    'body' => 'hey',
                    'mediaUrl' => 'https://media.giphy.com/media/YVBC4HdSpB7z2/giphy.gif',
                    'contentType' => ['image/gif']
                )
            );

        }catch (\Exception $exception){

        }

The content-type is image/gif, which is acceptable by Twilio. So what might be the problem here?

shekwo
  • 1,411
  • 1
  • 20
  • 50

1 Answers1

2

Looking at the documentation for Twilio WhatsApp supported MIME types:

Accepted Content Types for Media

It calls out the following:

The Twilio API for WhatsApp supports sending and receiving images, audio, PDF files, and video. The following formats are currently supported:

Images: JPG, JPEG, PNG Audio: MP3, OGG, AMR Documents: PDF Video: MP4

Alan
  • 10,465
  • 2
  • 8
  • 9