# Can't use OAuth 2 api's to cURL into api and get new access token and refresh token

**URL:** <https://devforum.zoom.us/t/cant-use-oauth-2-apis-to-curl-into-api-and-get-new-access-token-and-refresh-token/7484>\
**Category:** API and Webhooks\
**Created:** [January 13, 2020, 11:03pm UTC](https://devforum.zoom.us/t/cant-use-oauth-2-apis-to-curl-into-api-and-get-new-access-token-and-refresh-token/7484 "2020-01-13T23:03:54Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![Don](https://avatars.discourse-cdn.com/v4/letter/d/ed655f/32.png) [@Don](https://devforum.zoom.us/u/Don)\
**Post date:** [January 13, 2020, 11:03pm UTC](https://devforum.zoom.us/t/cant-use-oauth-2-apis-to-curl-into-api-and-get-new-access-token-and-refresh-token/7484/1 "2020-01-13T23:03:54Z")

</div>

I need to get a new access token and a refresh token using OAuth via cURL. I have worked with Jakob at Zoom support and he helped me set it up in Postman 2. When I copy that into a cURL statement from my software (FileMaker Pro cURL function), I do not get back both tokens.

Instead, I get this error: {“reason”:“Invalid client\_id or client\_secret”,“error”:“invalid\_client”}

**The cURL request I copied from Postman looks like this:**

xcurl --location --request POST ‘[https://zoom.us/oauth/token?grant\_type=refresh\_token&refresh\_token=REFRESH\_TOKEN](https://zoom.us/oauth/token?grant_type=refresh_token&refresh_token=REFRESH_TOKEN)’   
–header ‘Authorization: Basic key:secret’   
–header ‘Authorization: Bearer ACCESS\_TOKEN’

The Endpoints and command are in the cURL statement above, and the token info has been truncated along with the auth info.

To run this in FileMaker, I have to enclose the entire string above in double quotes, but all that does is render what is between the quotes, which matches the info above.

I have verified the refresh token and the access token strings, but no luck.

Any help is really appreciated.

---

<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:** [January 14, 2020, 5:44pm UTC](https://devforum.zoom.us/t/cant-use-oauth-2-apis-to-curl-into-api-and-get-new-access-token-and-refresh-token/7484/2 "2020-01-14T17:44:23Z")

</div>

Hey @Don,

It appears you are setting both Basic, and Bearer authentication in this CURL request.

To make things easier, have you considered using a [JWT Token](https://marketplace.zoom.us/docs/guides/getting-started/app-types/create-jwt-app) instead of OAuth? You can call our APIs immediately via:

```auto
curl --request GET \
  --url 'https://api.zoom.us/v2/users' \
  --header 'authorization: Bearer JWT_TOKEN_HERE'

```

When using CURL, I recommend using JWT.

Thanks,  
Tommy

---

<div class="post-metadata">

**Author:** ![Don](https://avatars.discourse-cdn.com/v4/letter/d/ed655f/32.png) [@Don](https://devforum.zoom.us/u/Don)\
**Post date:** [January 14, 2020, 11:15pm UTC](https://devforum.zoom.us/t/cant-use-oauth-2-apis-to-curl-into-api-and-get-new-access-token-and-refresh-token/7484/3 "2020-01-14T23:15:33Z")

</div>

Thanks, Tommy. JWT doesn’t work to download Zoom recording links. An Oauth Access token is required for that function.

Don

---

<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:** [January 14, 2020, 11:21pm UTC](https://devforum.zoom.us/t/cant-use-oauth-2-apis-to-curl-into-api-and-get-new-access-token-and-refresh-token/7484/4 "2020-01-14T23:21:33Z")

</div>

Hey @Don,

JWT Tokens should work to download recording links. Try adding this query param to the end of the `download_url`:

?access\_token=JWT\_TOKEN\_HERE

Thanks,  
Tommy

---

<div class="post-metadata">

**Author:** ![Don](https://avatars.discourse-cdn.com/v4/letter/d/ed655f/32.png) [@Don](https://devforum.zoom.us/u/Don)\
**Post date:** [January 14, 2020, 11:34pm UTC](https://devforum.zoom.us/t/cant-use-oauth-2-apis-to-curl-into-api-and-get-new-access-token-and-refresh-token/7484/5 "2020-01-14T23:34:15Z")

</div>

Will do. Support was my indicated that an Oauth token was needed. I’ll give it a try.

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:** [January 15, 2020, 12:19am UTC](https://devforum.zoom.us/t/cant-use-oauth-2-apis-to-curl-into-api-and-get-new-access-token-and-refresh-token/7484/6 "2020-01-15T00:19:51Z")

</div>

Give it a try and let me know if you run into any trouble! 🙂

Thanks,  
Tommy

---

<div class="post-metadata">

**Author:** ![Don](https://avatars.discourse-cdn.com/v4/letter/d/ed655f/32.png) [@Don](https://devforum.zoom.us/u/Don)\
**Post date:** [January 15, 2020, 2:05am UTC](https://devforum.zoom.us/t/cant-use-oauth-2-apis-to-curl-into-api-and-get-new-access-token-and-refresh-token/7484/7 "2020-01-15T02:05:52Z")

</div>

I am able to grab the download link, but I when I try to open it (even on the browser where I am logged in to Zoom) I get this error message:

# Whitelabel Error Page

This application has no explicit mapping for /error, so you are seeing this as a fallback.

Wed Jan 15 02:01:43 GMT 2020

There was an unexpected error (type=Not Acceptable, status=406).

Could not find acceptable representation

---

<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:** [January 15, 2020, 4:53pm UTC](https://devforum.zoom.us/t/cant-use-oauth-2-apis-to-curl-into-api-and-get-new-access-token-and-refresh-token/7484/8 "2020-01-15T16:53:34Z")

</div>

Hey @Don,

Can you please share the download link you are using so I can debug?

Thanks,  
Tommy

---

<div class="post-metadata">

**Author:** ![Don](https://avatars.discourse-cdn.com/v4/letter/d/ed655f/32.png) [@Don](https://devforum.zoom.us/u/Don)\
**Post date:** [January 16, 2020, 2:15am UTC](https://devforum.zoom.us/t/cant-use-oauth-2-apis-to-curl-into-api-and-get-new-access-token-and-refresh-token/7484/9 "2020-01-16T02:15:48Z")

</div>

Sure thing, Tommy: [https://zoom.us/v2/phone/recording/download/5DV6Zj-FRUucKBNMCKnKfw](https://mailtrack.io/trace/link/466ad663769e59ad4ab3a513a2f6e44bb5d87381?url=https%3A%2F%2Fzoom.us%2Fv2%2Fphone%2Frecording%2Fdownload%2F5DV6Zj-FRUucKBNMCKnKfw&userId=3737001&signature=0201f5fba5a0827e)

This is the cURL request I sent:

“curl --location --request GET  
–header ‘Authorization: Bearer JWT’”

Thanks for all you help. I really appreciate it.

---

<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:** [January 16, 2020, 5:30pm UTC](https://devforum.zoom.us/t/cant-use-oauth-2-apis-to-curl-into-api-and-get-new-access-token-and-refresh-token/7484/10 "2020-01-16T17:30:28Z")

</div>

Hey @Don,

I was able to download the recording via this url:

`https://zoom.us/v2/phone/recording/download/5DV6Zj-FRUucKBNMCKnKfw?access_token=JWT_TOKEN_HERE`

Please try pasting that url replacing `JWT_TOKEN_HERE` with your JWT Token and see if it downloads the recording.

Thanks,  
Tommy

---

<div class="post-metadata">

**Author:** ![Don](https://avatars.discourse-cdn.com/v4/letter/d/ed655f/32.png) [@Don](https://devforum.zoom.us/u/Don)\
**Post date:** [January 20, 2020, 2:59pm UTC](https://devforum.zoom.us/t/cant-use-oauth-2-apis-to-curl-into-api-and-get-new-access-token-and-refresh-token/7484/11 "2020-01-20T14:59:56Z")

</div>

Sorry for the delayed response, Tommy. Your idea worked perfectly! I am able to download the files now and listen to them.

Thanks so much for your help.

---

<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:** [January 21, 2020, 4:47pm UTC](https://devforum.zoom.us/t/cant-use-oauth-2-apis-to-curl-into-api-and-get-new-access-token-and-refresh-token/7484/12 "2020-01-21T16:47:06Z")

</div>

Glad to hear it is working! 🙂

You are welcome!

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, 7:11pm UTC](https://devforum.zoom.us/t/cant-use-oauth-2-apis-to-curl-into-api-and-get-new-access-token-and-refresh-token/7484/13 "2020-08-21T19:11:27Z")

</div>

Closed on August 21, 2020, 7:11pm UTC


