I have tried to get the folders and mails from inbox, but the service return:
INFO >>> https://graph.microsoft.com/v1.0/users/5649abd6-XXXX-XXXX-XXXX-0767bc050a17/mailfolders
INFO >>> 401
INFO >>> {
error: {
code: 'OrganizationFromTenantGuidNotFound',
message: "The tenant for tenant guid 'ce8b31cb-xxxx-xxxx-xxxx-03348390cf64' does not exist.",
innerError: {
oAuthEventOperationId: 'a0db5745-51a3-4d84-add1-8d1aa9fbae43',
oAuthEventcV: 'xS+BPnF2zF/LMKqaTCkG6w.1.1',
errorUrl: 'https://aka.ms/autherrors#error-InvalidTenant',
requestId: 'cecd0af5-27bf-4db8-92d3-7a158a685100',
date: '2023-03-04T00:48:14'
}
}
}
INFO >>> https://graph.microsoft.com/v1.0/users/5649abd6-XXXX-XXXX-XXXX-0767bc050a17/mailfolders/Inbox/messages
INFO >>> 401
INFO >>> {
error: {
code: 'OrganizationFromTenantGuidNotFound',
message: "The tenant for tenant guid 'ce8b31cb-xxxx-xxxx-xxxx-03348390cf64' does not exist.",
innerError: {
oAuthEventOperationId: '0c702d3b-1ddd-4e08-93a9-093ffb874e02',
oAuthEventcV: 'uzb3lIQBhNPTXHJECKZgKw.1',
errorUrl: 'https://aka.ms/autherrors#error-InvalidTenant',
requestId: '56f99cd2-5f22-49e7-9d38-63ad18481496',
date: '2023-03-04T00:48:15'
}
}
}
I have configured my app with api application permission
The token returned from https://login.microsoftonline.com/${tenantId}/oauth2/v2.0/token only work for list all users
INFO >>> https://graph.microsoft.com/v1.0/users/
INFO >>> 200
INFO >>> {
'@odata.context': 'https://graph.microsoft.com/v1.0/$metadata#users',
value: [
{
businessPhones: [],
displayName: '...',
givenName: '...',
jobTitle: null,
mail: null,
mobilePhone: null,
officeLocation: null,
preferredLanguage: 'en',
surname: '...',
userPrincipalName: '....',
id: '5649abd6-XXXX-XXXX-XXXX-0767bc050a17'
}
]
}