# Get account recordings API Error

**URL:** <https://devforum.zoom.us/t/get-account-recordings-api-error/97989>\
**Category:** Video SDK\
**Created:** [November 7, 2023, 6:07am UTC](https://devforum.zoom.us/t/get-account-recordings-api-error/97989 "2023-11-07T06:07:54Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![y-ka](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/y-ka/32/53659_2.png) [@y-ka](https://devforum.zoom.us/u/y-ka)\
**Post date:** [November 7, 2023, 6:07am UTC](https://devforum.zoom.us/t/get-account-recordings-api-error/97989/1 "2023-11-07T06:07:54Z")

</div>

When we call this API, we always get a Authorization failed error.

> **[Video SDK - web - Cloud recording](https://developers.zoom.us/docs/video-sdk/web/recording/#get-account-recordings)**
>
> The Zoom Developer Platform is an open platform that allows third-party developers to build applications and integrations upon Zoom’s video-first unified communications platform.

We tried to recreate a jwt token just like this :  
[https://developers.zoom.us/docs/video-sdk/create/](https://developers.zoom.us/docs/video-sdk/create/)

but not working.

---

<div class="post-metadata">

**Author:** ![jenzushsu](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/jenzushsu/32/34251_2.png) [@jenzushsu](https://devforum.zoom.us/u/jenzushsu)\
**Post date:** [November 7, 2023, 7:40am UTC](https://devforum.zoom.us/t/get-account-recordings-api-error/97989/2 "2023-11-07T07:40:15Z")

</div>

Hi @y-ka,

Thank you for reaching out on the Developer Forum.

If you are looking to invoke VSDK APIs, you should be referring to this documentation on creating Video SDK API JWT [Make API requests](https://developers.zoom.us/docs/video-sdk/api-request/#generate-video-sdk-api-jwt).

The other link you referenced is for generating a JWT Token for Video SDK Authorization.

---

<div class="post-metadata">

**Author:** ![y-ka](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/y-ka/32/53659_2.png) [@y-ka](https://devforum.zoom.us/u/y-ka)\
**Post date:** [January 15, 2024, 9:02am UTC](https://devforum.zoom.us/t/get-account-recordings-api-error/97989/3 "2024-01-15T09:02:10Z")

</div>

We tried to get token use this method

```auto
require('dotenv').config();
const KJUR = require('jsrsasign')

export default function generateVideoSdkApiJwt() {

  const sdkApiKey = 'xxx';
  const sdkApiSecret = "xxxx";

  const iat = Math.round((new Date().getTime() - 30000) / 1000)
  const exp = iat + 60 * 60 * 2
  const oHeader = { alg: 'HS256', typ: 'JWT' }

  const oPayload = {
    iss: sdkApiKey,
    iat: iat,
    exp: exp
  }

  const sHeader = JSON.stringify(oHeader)
  const sPayload = JSON.stringify(oPayload)
  const videosdk_api_token = KJUR.jws.JWS.sign('HS256', sHeader, sPayload, sdkApiSecret)
  return videosdk_api_token
}

```

And we are sure to got a token string,  
But When we call The API use this token,we got the same error:

Error: Request failed with status code 401

Could you please help me to research about it

---

<div class="post-metadata">

**Author:** ![y-ka](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/y-ka/32/53659_2.png) [@y-ka](https://devforum.zoom.us/u/y-ka)\
**Post date:** [January 19, 2024, 4:41am UTC](https://devforum.zoom.us/t/get-account-recordings-api-error/97989/4 "2024-01-19T04:41:01Z")

</div>

We found these from the link you gave me

> JWTs consist of three core parts: **Header** , **Payload** , and **Signature**. When combined, these parts are separated by a period to form a token: `1111111.2222222.3333333` .

So we fix the method like this:

```auto
require('dotenv').config();
const KJUR = require('jsrsasign')
const base64url = require('base64url');

export default function generateVideoSdkApiJwt() {

  const sdkApiKey = 'Jmoscb1Kdl1KxWuUsi0bX5DqlI9X2j9vpXpX';
  const sdkApiSecret = "CDmZIv1vWUNIm317SCv0V98UBkrkUs1fn0qz";

  const iat = Math.round((new Date().getTime() - 30000) / 1000)
  const exp = iat + 60 * 60 * 2
  const oHeader = { alg: 'HS256', typ: 'JWT' }

  const oPayload = {
    iss: sdkApiKey,
    exp: exp,
    iat: iat
  }

  const sHeader = JSON.stringify(oHeader)
  const sPayload = JSON.stringify(oPayload)
  const videosdk_api_token = KJUR.jws.JWS.sign('HS256', sHeader, sPayload, sdkApiSecret)

  const header = base64url(sHeader)
  const payload = base64url(sPayload)
  return header + '.' + payload + '.' + videosdk_api_token
}

```

But we got the same error:  
Error: Request failed with status code 401

I wondered if you can help us.
