# How to download a recording using C#

**URL:** <https://devforum.zoom.us/t/how-to-download-a-recording-using-c/5880>\
**Category:** API and Webhooks\
**Created:** [September 12, 2019, 2:56pm UTC](https://devforum.zoom.us/t/how-to-download-a-recording-using-c/5880 "2019-09-12T14:56:48Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![alan.stewart](https://avatars.discourse-cdn.com/v4/letter/a/d2c977/32.png) [@alan.stewart](https://devforum.zoom.us/u/alan.stewart)\
**Post date:** [September 12, 2019, 2:56pm UTC](https://devforum.zoom.us/t/how-to-download-a-recording-using-c/5880/1 "2019-09-12T14:56:48Z")

</div>

I’ve written some C# code to retrieve the following values using the Zoom API’s:

- List All Users
- List User Recordings

But I can’t seem to download recording files successfully using the WebClient C# class.  
It seems to download the HTML for the Sign In page.  
I’ve also tried setting the Authorization header the same way as I do to retrieve values using the Zoom API’s. But it doesn’t download any data when I set the Authorization header before trying to download the recording files.

Can someone please kindly show me a C# example on how to download Zoom recording files?

Thank you

---

<div class="post-metadata">

**Author:** ![tommy](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/tommy/32/72769_2.png) [@tommy](https://devforum.zoom.us/u/tommy)\
**Post date:** [September 12, 2019, 7:31pm UTC](https://devforum.zoom.us/t/how-to-download-a-recording-using-c/5880/2 "2019-09-12T19:31:29Z")

</div>

Hey @alan.stewart,

Are your recording files set to password protected or private in your [settings](https://zoom.us/profile/setting?tab=recording)?

 ![48%20PM](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/2X/0/0ec17c2fc39ec7abe704515ac8fb5505e3192841.png)

If so you need to follow this flow:

> [@BUG downloading cloud recordings with access token set results in an invalid response](https://devforum.zoom.us/t/bug-downloading-cloud-recordings-with-access-token-set-results-in-an-invalid-response/4292/25):
>
> @patricio.giacomino, @matt, @ryan As of now to download a private or password protected cloud recording you must use a [Zoom JWT App Type](https://marketplace.zoom.us/docs/guides/getting-started/app-types/create-jwt-app). Use the download\_url from the [Get Recordings Endpoint](https://marketplace.zoom.us/docs/api-reference/zoom-api/cloud-recording/recordingslist) or the download\_url from the [Recording Completed Webhook](https://marketplace.zoom.us/docs/api-reference/webhook-reference/recording-events/recording-completed) and add the access\_token query param to the end of the url with your JSON Web Token as the value. Example: https://api.zoom.us/recording/download/{{ Download Path }}?access\_token={{ JWT Token }} [19%20PM] The only way to use OAuth to download a …

Thanks,  
Tommy

---

<div class="post-metadata">

**Author:** ![alan.stewart](https://avatars.discourse-cdn.com/v4/letter/a/d2c977/32.png) [@alan.stewart](https://devforum.zoom.us/u/alan.stewart)\
**Post date:** [September 13, 2019, 3:43pm UTC](https://devforum.zoom.us/t/how-to-download-a-recording-using-c/5880/3 "2019-09-13T15:43:58Z")

</div>

Hi Tommy

I’ve checked the settings you mentioned. The “Share cloud recordings only with members of my account” option was ON, and the other option was OFF. I’ve made sure both options are off.

Initially I was using the WebClient.DownloadFile C# method to try and download a file, with no luck. I’ve also tried to download a file using the HttpWebClient class. It threw a WebException when it called the “request.GetResponse()” method with the following exception message:

**The remote server returned an error: (401) Unauthorized.**

I’ve pasted the C# code I’m using below.  
Do you have a C# code example on how to download recording files please?

C# Code  
HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(url);

// The Bearer property returns $“Bearer {GetAccessToken()}”  
request.Headers.Add(System.Net.HttpRequestHeader.Authorization, Bearer);

byte fileData = new byte[0];

using (Stream sr = request.GetResponse().GetResponseStream())  
{  
using (MemoryStream ms = new System.IO.MemoryStream())  
{  
byte buffer = new byte[0x1000];  
int bytes;  
while ((bytes = sr.Read(buffer, 0, buffer.Length)) \> 0)  
{  
ms.Write(buffer, 0, bytes);  
}

```
    fileData = ms.ToArray();
}

```

}

Many thanks

---

<div class="post-metadata">

**Author:** ![tommy](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/tommy/32/72769_2.png) [@tommy](https://devforum.zoom.us/u/tommy)\
**Post date:** [September 13, 2019, 10:07pm UTC](https://devforum.zoom.us/t/how-to-download-a-recording-using-c/5880/4 "2019-09-13T22:07:10Z")

</div>

Hey @alan.stewart,

As I am unfamiliar with the WebClient C# class, please reference this stack over flow answer.

> <https://stackoverflow.com/questions/307688/how-to-download-a-file-from-a-url-in-c/308336#308336>

Can you try going to the download\_url via the browser and see if you still get the Unauthorized error?

Thanks,  
Tommy

---

<div class="post-metadata">

**Author:** ![alan.stewart](https://avatars.discourse-cdn.com/v4/letter/a/d2c977/32.png) [@alan.stewart](https://devforum.zoom.us/u/alan.stewart)\
**Post date:** [September 15, 2019, 10:55pm UTC](https://devforum.zoom.us/t/how-to-download-a-recording-using-c/5880/5 "2019-09-15T22:55:55Z")

</div>

Hi Tommy  
Thank you for attaching a StackOverflow link.  
Using the WebClient.DownloadFile method was the first thing I tried. But when that didn’t work I thought the Token or User Credentials were required to download a file. But unfortunately, that didn’t work either.

When I try and download a file from Google Chrome using the Download URL, it works if I’ve logged into my Zoom user account on [zoom.us](http://zoom.us).

But if I try and download a file from IE using the Download URL, when I haven’t logged into my Zoom user account, it displays the following message and doesn’t download the file:  
**Download has been disabled by the administrator (200)**

Many thanks

---

<div class="post-metadata">

**Author:** ![tommy](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/tommy/32/72769_2.png) [@tommy](https://devforum.zoom.us/u/tommy)\
**Post date:** [September 16, 2019, 3:27pm UTC](https://devforum.zoom.us/t/how-to-download-a-recording-using-c/5880/6 "2019-09-16T15:27:48Z")

</div>

Hey @alan.stewart,

Thanks for the details.

It sounds like the settings I mentioned above are turned on at the Admin level, hence not allowing you to download the recordings.

Make sure to match these [settings at the Admin level](https://zoom.us/account/setting?tab=recording), OR [use a JWT token to download the private/password protected recordings](https://devforum.zoom.us/t/bug-downloading-cloud-recordings-with-access-token-set-results-in-an-invalid-response/4292/25).

![46%20AM](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/2X/f/fec880f6458f35ccf68dfa4a3b747974f568b46c.png)

Thanks,  
Tommy

---

<div class="post-metadata">

**Author:** ![DeveloperBot](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/developerbot/32/12632_2.png) [@DeveloperBot](https://devforum.zoom.us/u/DeveloperBot)\
**Post date:** [August 21, 2020, 6:42pm UTC](https://devforum.zoom.us/t/how-to-download-a-recording-using-c/5880/7 "2020-08-21T18:42:03Z")

</div>

Closed on August 21, 2020, 6:42pm UTC


