Slack API and sending message containing a video - slack-api

is there any way how to send a message with video content to Slack over its API? I see support only for an image here https://api.slack.com/messaging/composing/layouts

The best you can do is link to a video file in the body of the message, and then Slack will "unfurl" (preview) it alongside the message. There's no native video block today.

You could upload the video to Slack as any other file, using the files.upload method. If you also specify channels and initial_comment parameters, the file will be posted to respective channels with messages.
Alternatively, upload the file without posting to channels, grab the file ID from the response (like F0TD00400) and pass it as an external_id to the File Block.

Related

Twilio MMS: GIFs sent via Twilio do not play inline

I am using the Twilio PHP SDK within a Laravel app to send MMS messages.
When I send JPG or PNG files, the images display inline. When I send GIF files, the GIFs are sent as objects that the user must click on to view. They behave more like an attachment than an inline image.
The gif displays as a clickable object rather than as an inline gif
The code for constructing the object to be sent is dead simple with the helper SDK, perhaps overly so.
$response = new MessagingResponse();
$answer = $response->message("");
$answer->body("Foo");
$answer->media("/bar.gif");
print $response;
This sends the file. It is captured by Twilio and turned into a Twilio Media Resource before being sent to the user. My understanding is that GIFs are a fully supported content type in Twilio so my expectation is that they would be displayed the same way that a JPG is.
Is there some other factor I'm missing here? Or am I missing an element in the construction of the object?

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.
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?
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:

Cannot receive media attachment file in Twilio Flex

Project description:
Currently we have our customers using various chat platforms such as whatsapp , and slack where our contact center is forced to use the same. However, we would like to give Twilio flex platform to our contact service team so that they can reply messages coming from whatsapp, slack.
Query regarding media messages:
I use Javascript Client SDK for front end and connect Twilio Flex as an agent. Chat is working fine. I can send / Receive messages. But, when I send media files through SDK, 'Media messages are not supported' is displaying in Twilio Flex. When I use get All Messages from API able to get that media file as message with type = media. Also media SID is created for the uploaded file. But not able to view the same file in twilio flex.
This is a very old OLD question, but there's a bit better answer now.
https://github.com/jprix/mms2FlexChat/tree/master/function
Twilio Flex Plugin SAMPLE that shows media use with Flex and WhatsApp. Caveat: even the sample is somewhat old at this point, but should at least be educational.
HTH
You are correct, Flex does not support media attachments. You could possibly work on some logic to pass in the media URL to the agent via chat, but I have not seen any code examples to share.

How to send image (image url),video chat App Messages using XMPPFramework iOS

I'm sending only text, but I don't know how to send image/url, videos and
integrate that in the chat application in iOS using XMPP.
Please help me.
Please note that you should
Provide what you have done so far.
Search for answers first.
Please check existing answers
question 1
question 2
question 3
question 4
There are two basic approaches to send media data
inband (message with attachment - refer to existing answers)
out-of-band (upload media file to server and send URL in message)
Sending inband data should only be used for small media data. I recommend to use the out-of-band approach.
Out-of-band solutions supported by XMPPFramework
XEP-0065
XEP-0096
Your own XMPP extension
You are the most flexible when you use your own extension, but a standard XMPP client will not understand this. If you implement your own clients the I recommend this approach as follows.
Send media message
Upload media file to server.
Send message with content attribute and out
Receive media message
Parse message received and detect content type and out-of-band file name
Download media file from server.
Delete media file from server.
Example for your own XMPP message extension
<message from=... to=... id=... type=chat>
<body></body>
<myapp xmlns=mycompany:myapp content=image>
<out_of_band_file>myuniquefilename.jpg</out_of_band_file>
</myapp>
</message>
This way you may define your own content types like image, video, audio.

Can I upload a wav file to twilio and get it transcribed?

We currently use twilio to send out SMS messages to our employees on the field. I see that twilio has a transcription service. We have many voicemails in-house which are wav files that needs to converted to text. I was looking at a way of uploading these voicemails into twilio and get it transcribed. Would it be possible?
Are these voicemails actually connected in any way to Twilio? It sounds like you have just some regular WAV audio files and are wondering if you can use the Twilio transcription API to convert audio files to text?
If this is the case then it looks like you might be better off using a more pure transcription-as-a-service API.
Maybe something like Speechmatics?
If these audio files are in fact from a Twilio received call then it looks like you can use the Twilio Transcription API to receive the text. Check out their API docs page: https://www.twilio.com/docs/api/rest/transcription

Resources