Voice Recording URL not returning valid Data
Posted Mar 10, 2021
I want my private Zendesk App to store Voice recordings of Tickets on an external server.
While the File-saving functionality works, I am getting empty mp3 files on my server side.
Through Support API, I am getting the ticket's recording URL and trying the following:
let res = await client.request(recordingURL).then(res => res);
What I am getting returned is a String object that does not have the option to be converted to a Blob/File object of type mpeg or mp3. The string also looks like a massive unreadable character set.
Constructing a Blob Object with the request's string-result gives me a file of size 2.2MB whereas the manual download gives me a 1.3MB mp3-file.
What can I do to get a readable stream of the Recording located in the recordingURL?
Or at least, what can I do to get a response that I can work with?
0
3 comments
JC Tubino
Hi!
Do we have any updates on this? I am facing the same issue and would like to have a solution for this. Thanks.
0
Dominik Tajak
Hi Greg, thanks for responding!
My App runs in the sidebar and I am looking at the current ticket, which gives me the following data after a comments-get-request with the ZAFClient object:
"type": "VoiceComment",
"public": false,
"data": {
"from": "+1111111111",
"to": "+222222222",
"recording_url": "https://{mysubdomain}.zendesk.com/api/v2/channels/voice/calls/{Some Letters to represent ID}/twilio/call/recording",
"recording_type": "voicemail",
So, clicking on that link navigates me to the audio recording in the browser and I can download it from there.
But I need to store the mp3 file within my code in Blob or File Format to send it to my server in FormData format.
Using res = await ZAFClient.get(recordingURL) returns a string with a lof of unidentifiable characters (dimaond question marks), and I cannot find a way to decode/encode this string to then convert to or pass into a Blob object.
I believe the Zendesk API documentation states to only return Text or Json from ZAFClient requests but I need some sort of stream or any object that facilitates the conversion to Blob format.
Is that enough information?
0
Greg Katechis
Hi Dominik! It's hard to say what may be happening here, but if you share the snippet where you pull the URL, as well as any other relevant code, I'd be happy to take a look at it for you!
0
Sign in to leave a comment.