gayatri
gayatri

Reputation: 71

How to get media URL while Integration WhatsApp with IBM Watson

I'm working on a scenario to get image URL from WhatsApp to IBM Watson. How can I get the URL of the media from WhatsApp(Twilio) to IBM using webhook.

Twilio logs the media message as shown in attachment.

enter image description here

At least can we get all these message details from Twilio to IBM, so that I can use the message id to get the media URL.

I'm not clear how can I make a proper integration to get the WhatsApp image URL reflects in IBM Watson.

The body of the image is name of the file. How can I get the media URL from this to IBM?

Upvotes: 0

Views: 261

Answers (1)

IObert
IObert

Reputation: 3881

Twilio stores the sent media files in a cloud storage and attached the URL(s) to the payload of webhook request. The parameters are named MediaUrlX, where X is a zero-based index. So, for example, the URL for the first media attachment will be in the MediaUrl0 parameter, the second in MediaUrl1, and so on.

Please also note this important note from the documentation:

Supported media include images (JPG, JPEG, PNG), audio files, and PDF files, with a size limit of 16MB per message.

You should also be able to see the sent media file in the log if it has been received successfully:

enter image description here

Upvotes: 1

Related Questions