Twilio: How to get the call record mp3 file? - twilio

I am using this API for getting Twilio call logs. Some of the calls are recorded, so I need to get the corresponding mp3 file. Under the subresource_uris section I found recordings, but it is a .json file.
How can I get the mp3 file link of call records? I am using c# codes.

The .json is to retrieve the metadata.
If you want to retrieve the actual recording leave out the .json (will deliver .wav) or add a .mp3, i.e. https://api.twilio.com/2010-04-01/Accounts/ACXXXXX.../Recordings/REXXXXX....mp3.
See also the Twilio documentation "Fetch a recording media file".
The Twilio media URLs should be public by default, see "Fetch a Recording resource":
Because the URLs that host individual recordings are useful for many external applications, they are public and do not require HTTP Basic Auth to access.
However you can turn on HTTP Basic Auth via the settings:

Related

Using Google's text to speech API with Hyperstack

I would like to use the Google text-speech API to let my user type text into a text control, and then click a button which would send the text to my Rails server, where it would use the Google TextToSpeach API to create an mp3 file of that speech.
The Google API looks very simple to use: https://cloud.google.com/text-to-speech/docs/create-audio
In a traditional Rails application, I would write an API to pass the text to be transcribed and would expect that API call to return the path to the MP3 file created for the user to download.
It seems that a Hyperstack Isomorphic Operations would be the right approach for this, but how do I ensure the operation only runs on the server and not on the client though and how do I get the output value of the Operation (ie the file created) so I can display it in the browser for the user to download?
I should stress that I only need the Google API to Create the Audio file on the server (not play it). The user will then download the created file so their own use.
An operation is not going to help you here. Why?
Because unless you know a trick I don't, the only way to play an audio file without a lot of extra work, is to point an HTML audio tag's source at a url on the server.
This is then very easily done by a standard rails controller method that decodes the string from the URL params and returns the mp3 file in the response body.
For example /utils/text2speech.mp3?text=Hello%020There would just return the MP3 file.
Just to fully answer your question however, the Hyperstack::ServerOp class is a subclass of Operation that only runs on the server, but can be called from the client.
Too bad its no help here :-)

generate URL for mpd videos

I hope that I am posting using the right tags.
I added the dash.js player to a page in my website
I did create some mpd files from mp4 ones.
I wanted to know how can I generate URL for these files so that my app can access them.
In case it will help I am using Apache2 to serve my application.
The mpd file provides an index with pointers to the individual steams for your video - e.g. the different bitrate video files, the Audi stream, and subtitles etc.
The pointers in the mpd file are relative or absolute URL's which the client, e.g. the browser can access.
To allow the browser access the mpd itself you just have to put it someplace in your server file structure that clients can access, or that the server will redirect client requests for video to.
The online apache documentation provides an overview of how you can match URL requests to file locations:
https://httpd.apache.org/docs/trunk/urlmapping.html

How to programmatically check if a live YouTube channel is streaming?

My company runs a live web stream and has started duplicating this to YouTube. Unfortunately the staff won't check if it's live and internet issues cause our web encoder to stop encoding at times.
Is there a programmatic way I can tell if a channel is ACTUALLY streaming? i.e. if live video is coming out the channel and not just that "the channel is live"?
You may use Search: list.
Using this request returns a collection of search results that match the query parameters that you have specified in the API request. Add part=snippet in your request since this is a required parameter. Then, you may add the following optional parameters with their corresponding values in your HTTP request:
channelId=[channelId] - to search resources created by a particular channel.
type=video - to retrieve a particular type of resource
eventType=live - to return only active broadcasts. Please note that if you use eventType, also set the type parameter's value to video.
Combining all of these parameters, you may send HTTP request using the following format:
https://www.googleapis.com/youtube/v3/search?part=snippet&channelId=UCXswCcAMb5bvEUIDEzXFGYg&type=video&eventType=live
To better filter your search, you may also opt to add more parameters that are listed in supported parameters.
Lastly, solution in this related SO post - How to check if YouTube channel is streaming live might also help.

Using Dailymotion API to retrieve Video IDs

I am trying to make a certain request work via the Dailymotion API, for work. Our client is a Dailymotion Partner who asked us to do 2 things from our application :
Generate a XML file to MRSS-upload their videos on Dailymotion (but we do not do the actual uploading, only the XML file creation)
Later, once they have uploaded their video, we have to get its Dailymotion ID (for logs necessities).
The thing is that this process has been developed circa 2012, and not fully tested. My job today is to make sure the process works now for good. In order to get the ID, we have been using this request:
https://api.dailymotion.com/video/PARTNER_NAME:GUID?fields=id
but I can't find any mention of "partner" and "guid" in the Dailymotion Documentation today. All I know is that we use the name of the channel as PARTNER_NAME and the guid we put in the XML file as GUID.
The thing I don't understand is that:
sometimes, the request does succeed and I get the ID,
most of the time, I get alternatively "400" and "403" errors from the API.
First, I tried to set the attribute "private" in the XML file to 'false', and it helped get the ID of some videos imported as public, but it does not do the trick for all videos.
Could someone show some light on this matter?

EBAY - Sending a file via http post?

I've a file I want to send to the ebay system to support the LMS.
All the samples I've found include the use of the API, but the environment I'm working in doesn't have the ability to use it (the api).
So I'm forced to send the file with an HTTP post. But the doc's seem lacking.
Has anyone constructed/found an example of a HTTP post that will send a given file.
EDIT:
Oh.. what I see in the samples I have found is an area that seems it's supposed to have the data, but in the sample, there's nothing I'd consider real data.
Are you talking about the file transfer service or the bulk upload service? Don't you just generate an xml document and post the url like in this example:
http://developer.ebay.com/DevZone/file-transfer/CallRef/uploadFile.html#Samples

Resources