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.
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.