Description
When calling the endpoint https://api.zoom.us/v2/phone/call_logs
i get { code: 124, message: 'Invalid access token' }
. However, using the same code and pointing to https://api.zoom.us/v2/users
works.
If I copy the JWT token into PostMan, the call works, so there is nothing wrong with the JWT.
If I change the URL in my code to https://api.zoom.us/v2/users
it works, so there is nothing wrong with my code.
Error
{ code: 124, message: ‘Invalid access token’ }
Which App Type (OAuth / Chatbot / JWT / Webhook)?
JWT
using node jsonwebtokens
same code is used to call other endpoints successfully
Which Endpoint/s?
https://api.zoom.us/v2/phone/call_logs
How To Reproduce (If applicable)
Steps to reproduce the behavior:
async function getCallLog() {
try {
//Use the ApiKey and APISecret from config.js
const token = getToken()
let options = {
url: `https://api.zoom.us/v2/phone/call_logs`,
method: 'GET',
headers: {
Authorization: `Bearer ${token}`,
'User-Agent': 'Zoom-api-Jwt-Request',
'content-type': 'application/json'
}
};
let returnData = await axios(options)
return returnData.data;
} catch (error) {
console.log(error.response);
}
}
function getToken(){
const payload = {
iss: process.env.ZOOM_APIKEY,
exp: ((new Date()).getTime() + 5000)
};
const token = jwt.sign(payload, process.env.ZOOM_APISECRET);
return token;
}
Screenshots (If applicable)
Code example
PostMan example
Same code, different endpoint
Additional context
If it was a JWT generation issue then the token wouldn’t work in PostMan
If it was a code issue, then it wouldn’t work with other endpoints.
Endpoint in question is not a Master Account and is part of the Zoome Phone SDK: Zoom Phone API
BIZARRRO!