# 401 error when downloading recording with Server-to-Server OAuth token

**URL:** <https://devforum.zoom.us/t/401-error-when-downloading-recording-with-server-to-server-oauth-token/74351>\
**Category:** API and Webhooks\
**Tags:** recording\
**Created:** [August 16, 2022, 6:42pm UTC](https://devforum.zoom.us/t/401-error-when-downloading-recording-with-server-to-server-oauth-token/74351 "2022-08-16T18:42:42Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![david5](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/david5/32/40553_2.png) [@david5](https://devforum.zoom.us/u/david5)\
**Post date:** [August 16, 2022, 6:42pm UTC](https://devforum.zoom.us/t/401-error-when-downloading-recording-with-server-to-server-oauth-token/74351/1 "2022-08-16T18:42:42Z")

</div>

I’m attempting to download a recording using my Server-to-Server OAuth app’s access token but I’m getting a 401 HTTP error code. I can successfully download the URL using the token from my JWT app. This appears to be a variation of the bug that was discussed in this thread:

> [@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/67):
>
> @amritanshu.amrit, Please send this email from the account where you’re experiencing the issue, if possible. Thanks! Will

To get my OAuth token, I make a request like this:

`curl -s -H 'Accept: application/json' -XPOST --user [client id]:[client secret] 'https://zoom.us/oauth/token?grant_type=account_credentials&account_id=[account id]' | jq -r .access_token > /tmp/zoom-oauth`

I then use the “access\_token” to make a request for the recording:

httpz://my-org.zoom.us/rec/webhook\_download/[long string]?access\_token=[access token]

I can also download using the “download\_token” provided in the webhook request. However, this only lasts 24 hours. If I want to download the recording later, I need to use the OAuth token method.

Any ideas on whether this is a bug or something I’m missing in the way I make my requests?

Thanks!

David

---

<div class="post-metadata">

**Author:** ![gianni.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/gianni.zoom/32/32523_2.png) [@gianni.zoom](https://devforum.zoom.us/u/gianni.zoom)\
**Post date:** [August 16, 2022, 7:03pm UTC](https://devforum.zoom.us/t/401-error-when-downloading-recording-with-server-to-server-oauth-token/74351/2 "2022-08-16T19:03:12Z")

</div>

Hi @david5 , is your server-to-server OAuth app’s access token still valid? They expire after an hour.

@elisa.zoom@ojus.zoom can you confirm server-to-server OAuth access tokens can be used in the access token parameter for cloud recording webhook dowload?

Thank you!

---

<div class="post-metadata">

**Author:** ![david5](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/david5/32/40553_2.png) [@david5](https://devforum.zoom.us/u/david5)\
**Post date:** [August 16, 2022, 7:06pm UTC](https://devforum.zoom.us/t/401-error-when-downloading-recording-with-server-to-server-oauth-token/74351/3 "2022-08-16T19:06:48Z")

</div>

Yes, the access token is valid. I generated a fresh one right before doing the download.

---

<div class="post-metadata">

**Author:** ![gianni.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/gianni.zoom/32/32523_2.png) [@gianni.zoom](https://devforum.zoom.us/u/gianni.zoom)\
**Post date:** [August 16, 2022, 7:10pm UTC](https://devforum.zoom.us/t/401-error-when-downloading-recording-with-server-to-server-oauth-token/74351/4 "2022-08-16T19:10:02Z")

</div>

Okay thanks David. Please allow for a response from my colleagues that I’ve tagged above.

Appreciate your patience,  
Gianni

---

<div class="post-metadata">

**Author:** ![elisa.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/elisa.zoom/32/47836_2.png) [@elisa.zoom](https://devforum.zoom.us/u/elisa.zoom)\
**Post date:** [August 17, 2022, 1:37pm UTC](https://devforum.zoom.us/t/401-error-when-downloading-recording-with-server-to-server-oauth-token/74351/5 "2022-08-17T13:37:42Z")

</div>

Hi @david5  
I am trying to debug this issue but I am getting a different behavior.

Could you please confirm the steps that you are taking to make this request, along with the endpoints you are calling so I can try and replicate this on my end?

I also wanted to add that the access\_token generated with the Server-to-Server OAuth app, it is only valid for 1 hour so you will have to generate a new one once it expires.

Best,  
Elisa

---

<div class="post-metadata">

**Author:** ![david5](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/david5/32/40553_2.png) [@david5](https://devforum.zoom.us/u/david5)\
**Post date:** [August 17, 2022, 2:31pm UTC](https://devforum.zoom.us/t/401-error-when-downloading-recording-with-server-to-server-oauth-token/74351/6 "2022-08-17T14:31:30Z")

</div>

@elisa.zoom As mentioned in my initial report, I’m taking the following steps:

First, I generate a Server-to-Server OAuth access token using my account id, client id and client secret:

```nohighlight
curl -s -H 'Accept: application/json' -XPOST --user [client id]:[client secret] 'https://zoom.us/oauth/token?grant_type=account_credentials&account_id=[account id]' | jq -r .access_token > /tmp/zoom-oauth

```

I then take the `download_url` from the `recording.complete` webhook message I receive and add the `access_token` query parameter with the value genrated from the step above:

```nohighlight
curl -vs -o /tmp/recording.mp4 'https://my-org.zoom.us/rec/webhook_download/[long string]?access_token=[access token]'

```

When I attempt to run this download, I get an HTTP 401 response. When I use my JWT access token (which I’m trying to retire, per the deprecation guide from Zoom) I get a 301 redirect to a URL that contains the MP4 file.

---

<div class="post-metadata">

**Author:** ![david5](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/david5/32/40553_2.png) [@david5](https://devforum.zoom.us/u/david5)\
**Post date:** [August 19, 2022, 3:18pm UTC](https://devforum.zoom.us/t/401-error-when-downloading-recording-with-server-to-server-oauth-token/74351/7 "2022-08-19T15:18:57Z")

</div>

@elisa.zoom Any progress on this? I’m beginning to wonder if Server-to-Server OAuth isn’t quite ready for prime time and we should go back to using JWT until the kinks are worked out over the next few months.

---

<div class="post-metadata">

**Author:** ![elisa.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/elisa.zoom/32/47836_2.png) [@elisa.zoom](https://devforum.zoom.us/u/elisa.zoom)\
**Post date:** [August 19, 2022, 8:48pm UTC](https://devforum.zoom.us/t/401-error-when-downloading-recording-with-server-to-server-oauth-token/74351/8 "2022-08-19T20:48:15Z")

</div>

Hi @david5  
Thank you for your patience and for sharing more details with me.  
I have been trying to replicate this issue on my end and I was able to do so.  
I will reach out to our Engineering team about this and I will come back to you with an update.  
I do not know if this is expected or if this is a bug on our end. (ZSEE-62252 internal ticket for reference)

I will update you shortly.  
Best,  
Elisa

---

<div class="post-metadata">

**Author:** ![elisa.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/elisa.zoom/32/47836_2.png) [@elisa.zoom](https://devforum.zoom.us/u/elisa.zoom)\
**Post date:** [August 22, 2022, 11:52pm UTC](https://devforum.zoom.us/t/401-error-when-downloading-recording-with-server-to-server-oauth-token/74351/9 "2022-08-22T23:52:11Z")

</div>

Hi @david5  
I did some testing on my end and what I did was that I grabbed the download\_url from the payload that I received with me recording.complete webhook and then I used the download\_url along with the download\_token received in the same payload to get the recording, like so:

```auto
curl --location --request GET 'https://us02web.zoom.us/rec/webhook_download/{long_String}?access_token={download_token_from_payload}' \

```

Could you please give this a try and let me know if this works?

---

<div class="post-metadata">

**Author:** ![david5](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/david5/32/40553_2.png) [@david5](https://devforum.zoom.us/u/david5)\
**Post date:** [August 23, 2022, 8:42pm UTC](https://devforum.zoom.us/t/401-error-when-downloading-recording-with-server-to-server-oauth-token/74351/10 "2022-08-23T20:42:40Z")

</div>

@elisa.zoom Using the download\_token from the webhook message works fine (always has). The problem is that the token is only good for 1 hour after the message is received. If I need to reprocess the message or download the recording at a later date, I am unable to do so because my Server-to-Server OAuth token is not accepted in this scenario.

---

<div class="post-metadata">

**Author:** ![elisa.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/elisa.zoom/32/47836_2.png) [@elisa.zoom](https://devforum.zoom.us/u/elisa.zoom)\
**Post date:** [August 24, 2022, 11:36am UTC](https://devforum.zoom.us/t/401-error-when-downloading-recording-with-server-to-server-oauth-token/74351/11 "2022-08-24T11:36:58Z")

</div>

Right… let me reach out to the proper team about this and will come back to you with an update.  
@david5

---

<div class="post-metadata">

**Author:** ![david5](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/david5/32/40553_2.png) [@david5](https://devforum.zoom.us/u/david5)\
**Post date:** [August 26, 2022, 4:09pm UTC](https://devforum.zoom.us/t/401-error-when-downloading-recording-with-server-to-server-oauth-token/74351/12 "2022-08-26T16:09:25Z")

</div>

@elisa.zoom Curious what you were able to find related to this particular issue?

---

<div class="post-metadata">

**Author:** ![jbassi](https://avatars.discourse-cdn.com/v4/letter/j/e99b99/32.png) [@jbassi](https://devforum.zoom.us/u/jbassi)\
**Post date:** [October 3, 2022, 6:40pm UTC](https://devforum.zoom.us/t/401-error-when-downloading-recording-with-server-to-server-oauth-token/74351/13 "2022-10-03T18:40:49Z")

</div>

Hi,  
I am having the same issue with trying to download a recording using a server-to-server OAuth access token and I am getting a 401 error, whereas if I use my old JWT token it works fine. I’m wondering if there is any progress on this issue?

---

<div class="post-metadata">

**Author:** ![david5](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/david5/32/40553_2.png) [@david5](https://devforum.zoom.us/u/david5)\
**Post date:** [October 27, 2022, 3:36pm UTC](https://devforum.zoom.us/t/401-error-when-downloading-recording-with-server-to-server-oauth-token/74351/14 "2022-10-27T15:36:18Z")

</div>

@elisa.zoom What were you able to find regarding this issue?

---

<div class="post-metadata">

**Author:** ![elisa.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/elisa.zoom/32/47836_2.png) [@elisa.zoom](https://devforum.zoom.us/u/elisa.zoom)\
**Post date:** [November 1, 2022, 5:25pm UTC](https://devforum.zoom.us/t/401-error-when-downloading-recording-with-server-to-server-oauth-token/74351/15 "2022-11-01T17:25:14Z")

</div>

Hi @david5  
Unfortunately I do not have any updates at the moment

---

<div class="post-metadata">

**Author:** ![pfa\_zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/pfa_zoom/32/45139_2.png) [@pfa\_zoom](https://devforum.zoom.us/u/pfa_zoom)\
**Post date:** [February 14, 2023, 6:15pm UTC](https://devforum.zoom.us/t/401-error-when-downloading-recording-with-server-to-server-oauth-token/74351/16 "2023-02-14T18:15:31Z")

</div>

@elisa.zoom I was wondering if there were any updates here? It seems we’re not receiving the “download\_token” field in our “recording.completed” webhook event and still are not able to use the Server to Server OAuth access token for downloading. There’s no good workaround other than to fail back to the JWT app type for this particular use case which I’d like to avoid if possible.

---

<div class="post-metadata">

**Author:** ![gianni.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/gianni.zoom/32/32523_2.png) [@gianni.zoom](https://devforum.zoom.us/u/gianni.zoom)\
**Post date:** [March 14, 2023, 3:37am UTC](https://devforum.zoom.us/t/401-error-when-downloading-recording-with-server-to-server-oauth-token/74351/17 "2023-03-14T03:37:09Z")

</div>

@david5 @pfa_zoom please confirm the following :

- `recording:read:admin` scope on Server-to-Server OAuth app
- That you have the Recording management and `View` the recording content permissions assigned on the user role that’s trying to download the recording

Thanks.

---

<div class="post-metadata">

**Author:** ![daichi](https://avatars.discourse-cdn.com/v4/letter/d/94ad74/32.png) [@daichi](https://devforum.zoom.us/u/daichi)\
**Post date:** [April 23, 2023, 9:58am UTC](https://devforum.zoom.us/t/401-error-when-downloading-recording-with-server-to-server-oauth-token/74351/19 "2023-04-23T09:58:07Z")

</div>

Hi, All  
I have the same problem.  
I think zoom will shutdown JWT app type end of next month. Is the issue fixed? If no, We will lost way to download recording file without only 1 hour token. That is very bad for our program.

Thanks

---

<div class="post-metadata">

**Author:** ![gianni.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/gianni.zoom/32/32523_2.png) [@gianni.zoom](https://devforum.zoom.us/u/gianni.zoom)\
**Post date:** [May 1, 2023, 4:22pm UTC](https://devforum.zoom.us/t/401-error-when-downloading-recording-with-server-to-server-oauth-token/74351/20 "2023-05-01T16:22:58Z")

</div>

Hi @daichi ,

Can you please confirm the following?:

> [@401 error when downloading recording with Server-to-Server OAuth token](https://devforum.zoom.us/t/401-error-when-downloading-recording-with-server-to-server-oauth-token/74351/17):
>
> @david5 @pfa_zoom please confirm the following : recording:read:admin scope on Server-to-Server OAuth app That you have the Recording management and View the recording content permissions assigned on the user role that’s trying to download the recording Thanks.

---

<div class="post-metadata">

**Author:** ![daichi](https://avatars.discourse-cdn.com/v4/letter/d/94ad74/32.png) [@daichi](https://devforum.zoom.us/u/daichi)\
**Post date:** [May 2, 2023, 12:36am UTC](https://devforum.zoom.us/t/401-error-when-downloading-recording-with-server-to-server-oauth-token/74351/21 "2023-05-02T00:36:51Z")

</div>

@gianni.zoom

Yes, My app have following scopes

> View and manage sub account’s user meetings /meeting:masterDelete  
> View all user meetings /meeting:read:adminDelete  
> Get a meeting’s encoded SIP URI /meeting:read:admin:sip\_dialingDelete  
> View and manage all user meetings /meeting:write:adminDelete  
> View live streaming meeting token information /meeting\_token:read:admin:live\_streamingDelete  
> View local archiving meeting token information /meeting\_token:read:admin:local\_archivingDelete  
> This scope allows an app to view an account’s users’ local recording meeting token information /meeting\_token:read:admin:local\_recordingDelete  
> View all user recordings /recording:read:adminDelete  
> View and manage all user recordings /recording:write:adminDelete  
> View all user information /user:read:adminDelete

Currently the app uses download\_token instead.  
Because s2s’s token was not pass authentication with download.  
Thanks

[Next page](https://devforum.zoom.us/t/401-error-when-downloading-recording-with-server-to-server-oauth-token/74351.md?page=2)
