Getting error to answer call using microsoft graph api
Here is the code
function answerCall(CommID) { let answergraphURL = 'https://graph.microsoft.com/beta/communications/calls/' + CommID + '/answer'; console.log('This is the endpoint to answer: ' + answergraphURL); request.post( { url:answergraphURL, json: { "callbackUri": process.env.ngrok + "/api/calls/hub", "tenantId": process.env.tenantID, "acceptedModalities": [ "audio" ], "mediaConfig": { "@odata.type": "#microsoft.graph.serviceHostedMediaConfig" } } }, function (err, httpResponse, body) { console.log('err: '+err); console.log('httpResponse: '+httpResponse); console.log('body: '+JSON.stringify(body)); }).auth(null, null, true, accessToken);}
an here is the error
{"error":{"code":"7505","message":"Mismatch between request authorization tenant and call tenant.","innerError":{"date":"2021-01-19T12:14:54","request-id":"1f5357a9-65ea-4ffb-a0bf-448cf5577273","client-request-id":"1f5357a9-65ea-4ffb-a0bf-448cf5577273"}}}