# Server-to-Server OAuth Invalid access token - Update meeting

**URL:** <https://devforum.zoom.us/t/server-to-server-oauth-invalid-access-token-update-meeting/114337>\
**Category:** API and Webhooks\
**Tags:** api, server-to-server\
**Created:** [July 25, 2024, 5:46am UTC](https://devforum.zoom.us/t/server-to-server-oauth-invalid-access-token-update-meeting/114337 "2024-07-25T05:46:25Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![collo060](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/collo060/32/61790_2.png) [@collo060](https://devforum.zoom.us/u/collo060)\
**Post date:** [July 25, 2024, 5:46am UTC](https://devforum.zoom.us/t/server-to-server-oauth-invalid-access-token-update-meeting/114337/1 "2024-07-25T05:46:25Z")

</div>

Hello wonderful community,

I am trying to set up server-to-server OAuth and I’m stuck. My goal is to use Server-to-server Authentication to update a meeting (PATCH /v2/meetings/[meetingId]).

I can successfully perform the server-to-server Get access token API call, but the token cannot be used by subsequent API calls.

Here’s how I set up my access token request: _curl --location --request POST ‘[https://zoom.us/oauth/token?token\_index=0&grant\_type=account\_credentials&account\_id=](https://zoom.us/oauth/token?token_index=0&grant_type=account_credentials&account_id=)**’ \*  
\*–header 'Authorization: Basic ’ \*  
 –header 'Cookie: \_\_cf\_bm=; \_zm\_chtaid=476; \_zm\_ctaid=**; \_zm\_mtk\_guid=\*\*\*\*’_

When I execute the above curl command on Postman, I get an access token.

However, trying to use this token in subsequent calls results in:  
_{_

- “code”: 124,\*
- “message”: “Invalid access token.”\*  
_}_

If anyone has any ideas on how to resolve this, I would greatly appreciate it. I’ve been stuck for hours, wondering if I’m doing something wrong with the access token or if server-to-server OAuth is just overly complex.

I really appreciate your input.

---

<div class="post-metadata">

**Author:** ![chunsiong.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/chunsiong.zoom/32/35488_2.png) [@chunsiong.zoom](https://devforum.zoom.us/u/chunsiong.zoom)\
**Post date:** [July 26, 2024, 4:33am UTC](https://devforum.zoom.us/t/server-to-server-oauth-invalid-access-token-update-meeting/114337/2 "2024-07-26T04:33:15Z")

</div>

@collo060 is this specific to postman setup or just curl in general?

```auto
client_id="QkZ04UroQRizg2ZTj4FURQ"
client_secret="xxxxxxxxxxxxxxxxxxxxxxxxxxx"
account_id="9sS_PB2yR827nmtssg9wgQ"

oauth_url="https://zoom.us/oauth/token?grant_type=account_credentials&account_id=$account_id"

auth_header=$(echo -n "$client_id:$client_secret" | base64)

response=$(curl -s -X POST "$oauth_url" \
  -H "Authorization: Basic $auth_header")

http_code=$(echo "$response" | jq -r '. | if .access_token then 200 else 400 end')
if ["$http_code" -eq 200]; then
  access_token=$(echo "$response" | jq -r '.access_token')
  echo "Access Token: $access_token"
else
  echo "OAuth Request Failed: $response"
fi

```

---

<div class="post-metadata">

**Author:** ![chunsiong.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/chunsiong.zoom/32/35488_2.png) [@chunsiong.zoom](https://devforum.zoom.us/u/chunsiong.zoom)\
**Post date:** [July 26, 2024, 4:36am UTC](https://devforum.zoom.us/t/server-to-server-oauth-invalid-access-token-update-meeting/114337/3 "2024-07-26T04:36:15Z")

</div>

@collo060 the response should be something like this.

```auto
Access Token: eyJzdiI6IjAwMDAwMSIsImFsZyI6IkhTNTEyIiwidiI6IjIuMCIsImtpZCI6IjdkNjNjOTI2LTJhZDMtNDY0Yy1iMWY4LWU0Y2QwODFlNzQyYSJ9.eyxxxxxxxxxxxxxxxxxxxxxxxxLQks4ODVRIiwidmVyIjo5LCJhdWlkIjoiZDI4YWMwNGM5MTQxZmFhOTg3OTc1YTA3NjY0YjlmOGMiLCJuYmxxxxxxxxxxxxxxxxxOiJHbVRLR1ZqRlFSZTlTU256WVlQZzlnblhBQ2c0Mm8xQ3YiLCJpc3MiOiJ6bTpjaWQ6UWtaMDRVcm9RUml6ZzJaVGo0RlVSUSxxxxxxxxxxxxxxxxxxxxxxxxxxx.lI3SDhq-RosvxAjuqsrP-c_nTtXykEgxwX0AUit8_9VPiTxgI6sgabpveVT2zckuyBn_pyQivwvqBS2LuYs5xw

```

You will want to use only the portion below in the bearer when making your API call . Omit "Access Token: "

```auto
eyJzdiI6IjAwMDAwMSIsImFsZyI6IkhTNTEyIiwidiI6IjIuMCIsImtpZCI6IjdkNjNjOTI2LTJhZDMtNDY0Yy1iMWY4LWU0Y2QwODFlNzQyYSJ9.eyxxxxxxxxxxxxxxxxxxxxxxxxLQks4ODVRIiwidmVyIjo5LCJhdWlkIjoiZDI4YWMwNGM5MTQxZmFhOTg3OTc1YTA3NjY0YjlmOGMiLCJuYmxxxxxxxxxxxxxxxxxOiJHbVRLR1ZqRlFSZTlTU256WVlQZzlnblhBQ2c0Mm8xQ3YiLCJpc3MiOiJ6bTpjaWQ6UWtaMDRVcm9RUml6ZzJaVGo0RlVSUSxxxxxxxxxxxxxxxxxxxxxxxxxxx.lI3SDhq-RosvxAjuqsrP-c_nTtXykEgxwX0AUit8_9VPiTxgI6sgabpveVT2zckuyBn_pyQivwvqBS2LuYs5xw

```

---

<div class="post-metadata">

**Author:** ![chunsiong.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/chunsiong.zoom/32/35488_2.png) [@chunsiong.zoom](https://devforum.zoom.us/u/chunsiong.zoom)\
**Post date:** [July 29, 2024, 2:20am UTC](https://devforum.zoom.us/t/server-to-server-oauth-invalid-access-token-update-meeting/114337/4 "2024-07-29T02:20:35Z")

</div>

Closed on July 29, 2024, 2:20am UTC


