0

Cannot create a conversation message with media, or update a message with a media

I'm getting this error when trying to create a message together with a media.

response = client.conversations \
    .v1 \
    .conversations('CHXX') \
    .messages.create(author='smee', body='Ahoy there!', media_sid='ME75f5f40f4dcd6913587c4b27043019a8')

Error: "twilio.base.exceptions.TwilioRestException: HTTP 400 error: Unable to create record: Provided media content does not exist"

The media was just created and I was able to fetch the media.

I also tried creating the message without the media, then update the newly created message with the media using curl -u “<acount_sid>:<account_secret>” -X POST https://chat.twilio.com/v2/Services/<chat_service_sid>/Channels/<channel_sid>/Messages -d MediaSid=ME75f5f40f4dcd6913587c4b27043019a8

The command succeeded but the message is still not updated with the media. (media=null)

{"body": "Ahoy there!", "index": 0, "author": "smee", "date_updated": "2023-07-18T18:05:19Z", "media": null, "participant_sid": null, "conversation_sid": "CHXX", "account_sid": "ACxX", "delivery": null, "url": "https://conversations.twilio.com/v1/Conversations/CHXX/Messages/IM17bc4ab2e2c94782b04911266fcc1d34", "date_created": "2023-07-17T22:44:45Z", "content_sid": null, "sid": "IMXX", "attributes": "{}", "links": {"delivery_receipts": "https://conversations.twilio.com/v1/Conversations/CHXX/Messages/IMXX34/Receipts", "channel_metadata": "https://conversations.twilio.com/v1/Conversations/CHXX/Messages/IMXX/ChannelMetadata"}}

Any help is appreciated. Thank you!

0 Answers0