Skip to main content
Solved

How can I know if a recording is available?

  • February 19, 2025
  • 7 replies
  • 42 views

Hello all, I understand that there are no webhooks to know if a recording is available, I’ve done most of my integration, I’m getting the recordingId from the telephony event “disconnect”, now I need to get the recording, Tech Support said that the recording is not available real time that I will have to poll the content API, which should be this one: /restapi/v1.0/account/accountId/recording/recordingId/content, however in the docs it says that that API only returns 200 with the recording media as the body, so, my question is, how does the return code and body looks like when the recording is not available to download? should I check for a 404 status code and retry later? how does that work?

 

Thanks,

Raul

Best answer by PhongVu

rsandrea wrote:

hello ​@PhongVu, thank you for your response,

I know how to download it, what I would like to know is when I poll the content API, what will the payload look like if the recording is not available to download? will I get a 404? I already have the recordingId from the disconnect webhook, I just need to know what will happen if I query /restapi/v1.0/account/~/recording/{my-recording-id}/content and the recording is still not ready to be downloaded.

 

Thanks!

Since there is no exact event notification for this. I work around it be first setting a delay to 30-40 secs before I try to get the recording using the contentUri. However, for long call recordings, it may take even longer than 40 secs. in case I will get 404, I will set the delay for another 30-40 secs and try again.
 

View original
Did this thread help you find an answer to your question?

7 replies

PhongVu
Community Manager
Forum|alt.badge.img
  • Community Manager
  • 2329 replies
  • February 19, 2025

You are right about there is no push notification for a call recording event. However, using the telephony session event notification with the disconnected event should work.

Read this article to learn how to download the recording binary file.


  • Author
  • New Participant
  • 3 replies
  • February 19, 2025

hello ​@PhongVu, thank you for your response,

I know how to download it, what I would like to know is when I poll the content API, what will the payload look like if the recording is not available to download? will I get a 404? I already have the recordingId from the disconnect webhook, I just need to know what will happen if I query /restapi/v1.0/account/~/recording/{my-recording-id}/content and the recording is still not ready to be downloaded.

 

Thanks!


PhongVu
Community Manager
Forum|alt.badge.img
  • Community Manager
  • 2329 replies
  • Answer
  • February 21, 2025
rsandrea wrote:

hello ​@PhongVu, thank you for your response,

I know how to download it, what I would like to know is when I poll the content API, what will the payload look like if the recording is not available to download? will I get a 404? I already have the recordingId from the disconnect webhook, I just need to know what will happen if I query /restapi/v1.0/account/~/recording/{my-recording-id}/content and the recording is still not ready to be downloaded.

 

Thanks!

Since there is no exact event notification for this. I work around it be first setting a delay to 30-40 secs before I try to get the recording using the contentUri. However, for long call recordings, it may take even longer than 40 secs. in case I will get 404, I will set the delay for another 30-40 secs and try again.
 


  • Author
  • New Participant
  • 3 replies
  • February 21, 2025

hello ​@PhongVu thanks for getting back to me, just to clarify, the content URL included in the disconnect event, will return 404 if the recording is not available and 200 when it is, did I get it right?


PhongVu
Community Manager
Forum|alt.badge.img
  • Community Manager
  • 2329 replies
  • February 21, 2025
rsandrea wrote:

hello ​@PhongVu thanks for getting back to me, just to clarify, the content URL included in the disconnect event, will return 404 if the recording is not available and 200 when it is, did I get it right?

No, you call this API to check.

Note, the disconnected event does not give you the contentUri, just the the recording id as I remember.


  • Author
  • New Participant
  • 3 replies
  • February 21, 2025

yes, you are correct it gives me the ID, but yet again, how can I check if the recording is available???

If I query this API will it return 404 if the recording is not available?


PhongVu
Community Manager
Forum|alt.badge.img
  • Community Manager
  • 2329 replies
  • February 21, 2025
rsandrea wrote:

yes, you are correct it gives me the ID, but yet again, how can I check if the recording is available???

If I query this API will it return 404 if the recording is not available?

I just can’t remember what it would return. It happens to my app sometimes. You can quickly test and find out, or if I have some spare time next week, I will try and let you know.


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings