# Getting Invalid Access token error recently on working code

**URL:** <https://devforum.zoom.us/t/getting-invalid-access-token-error-recently-on-working-code/67193>\
**Category:** Cloud Recordings\
**Created:** [April 7, 2022, 10:30am UTC](https://devforum.zoom.us/t/getting-invalid-access-token-error-recently-on-working-code/67193 "2022-04-07T10:30:02Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Harshal123](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/harshal123/32/36693_2.png) [@Harshal123](https://devforum.zoom.us/u/Harshal123)\
**Post date:** [April 7, 2022, 10:30am UTC](https://devforum.zoom.us/t/getting-invalid-access-token-error-recently-on-working-code/67193/1 "2022-04-07T10:30:02Z")

</div>

Hi, Recently, One of my lambda function has stopped working where I was fetching cloud recording from my zoom account and feeding it to my DB.

```auto
function someFunction() {
  let Arr_Key = APIKey.split("|");
  let Arr_secretkey = APISecret.split("|");
  for (let i = 0; i < Arr_Key.length; i++) {
    const payload = {
      iss: Arr_Key[i],
      exp: ((new Date()).getTime() + 15000)
    };
    const token = jwt.sign(payload, Arr_secretkey[i]);
    const config = {
      headers: {
        "Authorization": "Bearer " + token,
        'User-Agent': 'Zoom-api-Jwt-Request',
        'content-type': 'application/json'
      }
    }
    axios.get(Zoom_End_Point, config)
      .then(async function (response) {
        let data = {};
        let Empty_arr = [];
        let recordings = response.data.meetings;
        if (!recordings || !Object.keys(recordings).length) {
          data = {
            secretKey: adminSecretKey,
            response: Empty_arr,
            ids: Empty_arr
          };
        }
        else {
          let { meetingIds, requiredMeetings, meetingAgendas } = await getDesiredRecordings(recordings,config);
          modifyMeetings(requiredMeetings, token);
          data = {
            secretKey: adminSecretKey,
            response: requiredMeetings,
            ids: meetingIds,
            agendas: meetingAgendas
          };
        }
        try {
          const res = await axios.post(Insert_API_End_Point, data);
          return {
            statusCode: 200,
            body: res
          };
        } catch (e) {
          return {
            statusCode: 400,
            body: JSON.stringify(e)
          };
        }
      })
      .catch(function (error) {
         console.log(error) //Flow coming here
        return {
          statusCode: 400,
          body: JSON.stringify(error)
        }
      })
  }
}

```

In API key I have Three keys seperated with | API\_key=oVxxxxx…|l4xxx…|7Xxxx…  
same with Api secret key.  
I’m getting error 401 with **data: { code: 124, message: ‘Invalid access token.’ }**  
Has something changed in zoom recently? why is my function throwing error in past few days where as it was working fine earlier.

---

<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:** [April 8, 2022, 9:32pm UTC](https://devforum.zoom.us/t/getting-invalid-access-token-error-recently-on-working-code/67193/2 "2022-04-08T21:32:22Z")

</div>

Hi @Harshal123  
Was this function working previously?  
Did you change any settings in your account?
