# Code:124 Invalid Access Token Error

**URL:** <https://devforum.zoom.us/t/code-124-invalid-access-token-error/104005>\
**Category:** Meeting SDK\
**Created:** [February 16, 2024, 12:48pm UTC](https://devforum.zoom.us/t/code-124-invalid-access-token-error/104005 "2024-02-16T12:48:44Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![iampentext](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/iampentext/32/56672_2.png) [@iampentext](https://devforum.zoom.us/u/iampentext)\
**Post date:** [February 16, 2024, 12:48pm UTC](https://devforum.zoom.us/t/code-124-invalid-access-token-error/104005/1 "2024-02-16T12:48:44Z")

</div>

Hi team,

I’m facing the error **“Invalid access token”** while trying to create a new meeting via the API.I am using **jsonwebtoken** to create authToken using sdk key and sdk secret , when I attempt to create a meeting using this token through the following endpoint I receive the above error message. I’m unsure how to resolve this issue.

async generateToken() {  
return await jwt.sign({  
iss: apiKeys.zoomJwtApiKey  
},  
apiKeys.zoomJwtApiSecret, {  
algorithm: “HS256”,  
expiresIn: 120  
}  
);  
}

async createEvent(request) {  
let jwtToken = await this.generateToken();  
let startDate = request.date.split(“T”)[0] + “T” + request.time + “:00”;  
var options = {  
method: “POST”,  
uri: “[https://api.zoom.us/v2/users/](https://api.zoom.us/v2/users/)” + apiKeys.zoomAccountMail + “/meetings”,  
body: {  
topic: request.ad.title,  
type: 2,  
startTime: startDate,  
duration: 60,  
timezone: “Asia/Tashkent”,  
agenda: request.ad.title,  
settings: {  
join\_before\_host: “true”,  
jbh\_time: 10,  
waiting\_room: false,  
},  
},  
auth: {  
bearer: jwtToken,  
},  
headers: {  
“User-Agent”: “Zoom-api-Jwt-Request”,  
“content-type”: “application/json”,  
},  
json: true,  
};

```
return await rp(options);

```

}

---

<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:** [February 23, 2024, 5:07am UTC](https://devforum.zoom.us/t/code-124-invalid-access-token-error/104005/2 "2024-02-23T05:07:34Z")

</div>

@iampentext ,

To call the REST API, you need to either use the Server to Server OAuth App or OAuth App.

You cannot use SDK Key and SDK Secret as they are only used for SDK Authentication.

Please tag me in your response
