I'm getting 403 forbidden error in my SPFx web part when trying to access Teams presence (mine and other users as well). I have set permissions in package-solution:
Permissions:
{
"resource": "Microsoft Graph",
"scope": "Presence.Read"
},
{
"resource": "Microsoft Graph",
"scope": "Presence.Read.All"
}
Call for presence:
this.context.msGraphClientFactory
.getClient()
.then((client: MSGraphClient) => {
client
.api(`users/{username}/presence`)
.version("beta")
.get((err, res) => {
if (err) {
alert(JSON.stringify(err));
return;
}
console.log(res);
});
});
Any idea what is wrong please?