Access denied issue for Microsoft graph api - excel

When I share excel url with personal one drive account and doing get request of URL details with office account token I have an issue when using shared url from personal drive which has the format
https://1drv.ms/x/s!{token}
or
https://onedrive.live.com/view.aspx?resid=B4FDB33875A82&ithint=file%2cxlsx&authkey=!EKQJrE3T5A
Permissions Scopes I have given as per documentation
Request :
GET https://graph.microsoft.com/v1.0/shares/{shareIdOrEncodedSharingUrl}/driveItem
Response :
{
"error": {
"code": "accessDenied",
"message": "The sharing link no longer exists, or you do not have permission to access it.",
"innerError": {
"date": "2022-06-29T12:49:15",
"request-id": "e1e9f673-1b66-49f3-8abd-70a1240f5442",
"client-request-id": "e1e9f673-1b66-49f3-8abd-70a1240f5442"
}
}
}

Related

Outlook Open Another Mailbox Access Denied

I am trying to open another mailbox from Outlook/Access a different email account using the Graph API. Within the exchange admin centre, I have enabled Full Access to the mailbox I am trying to access. However when I try open the account the account from Outlook using 'Open Another mailbox' I get this error:
UTC Date: 2022-01-20T04:32:42.882Z
BootResult: accessDenied
Client Version: 20220110007.08
err: Microsoft.Exchange.Data.StoreObjects.AccessDeniedException
esrc: StartupData
et: ServerError
estack: Microsoft.Mapi.MapiExceptionNoAccess
st: 500
ehk: X-OWA-Error
efe: SY6PR01CA0002
ebe: SY4PR01MB6948
ewsver: 15.20.4909.8
emsg: ErrorPermissionDenied
I've also tried doing this through the Graph Explorer using the endpoint (https://graph.microsoft.com/v1.0/users/userId/messages)But I get an error saying the folder is unavailable.
{
"error": {
"code": "ErrorFolderNotFound",
"message": "The specified folder could not be found in the store.",
"innerError": {
"date": "2022-01-20T04:41:59",
"request-id": "4f835246-029b-47af-86d5-15f5dbb52bde",
"client-request-id": "20ae4819-d85e-dd92-fe6b-14fda438e947"
}
}
}
Am I missing some permission set or something? The user I am using I believe is an admin.

Getting error while creating online meeting using graph api

Here i am using Microsoft graph api for creating online meeting events but after generating toke when i am requesting to create an online meeting i am getting this error
{
"error": {
"code": "ResourceNotFound",
"message": "User not found",
"innerError": {
"date": "2021-09-01T17:54:57",
"request-id": "fa773652-e824-4c9e-af05-085e249fb489",
"client-request-id": "fa773652-e824-4c9e-af05-085e249fb489"
}
}
}
enter image description here
Based on the So thread reference,
Use Delegated permissions to create an onlineMeeting
You must log in as a user, and you cannot use the client credential flow. You need to use the auth code flow to obtain the token.
Ref link - Delegated Permission: https://learn.microsoft.com/en-us/graph/api/application-post-onlinemeetings?view=graph-rest-1.0&tabs=csharp
SO Reference: 404 error while creating Online Meeting using microsoft graph api c# without login into AzureActiveDirectory

Error access denied in microsoft graph api to read user messages

When I call https://graph.microsoft.com/v1.0/me/messages in Postman, it returns this error:
{
"error": {
"code": "ErrorAccessDenied",
"message": "Access is denied. Check credentials and try again.",
"innerError": {
"request-id": "ea5ef6c7-5c89-4ad6-975f-aec77e6f5064",
"date": "2019-02-25T12:00:07"
}
}
}
Provide all permission that the app needs. Except this "Use Exchange Web Services with full access to all mailboxes" in office 365 Exchange online and also give grant permission but still can't access.
I recommend you set the permissions for your app in the Azure Portal here:

Search for sites returns 403 Access Denied

We've seen a change in functionality with the Microsoft Graph /sites?search endpoint.
Within the past couple of days, when making this call:
https://graph.microsoft.com/v1.0/sites?search=
for certain tenants, we now receive:
{
"error": {
"code": "accessDenied",
"message": "The caller does not have permission to perform the action.",
"innerError": {
"request-id": "a37ae18e-dcd2-481d-bb06-0a0f5cade4f4",
"date": "2018-09-28T13:54:56"
}
}
}
We are using app only authentication with the following roles:
"roles": [
"Directory.Read.All",
"User.Read.All"
],
Has there been a change in permissions required for this call?
According to the documentation, you need either Sites.Read.All or Sites.ReadWrite.All in order to use /sites?search={query}.

Graph API encounter 400 failed to get drive in china

Before a day, the operation works fine.
https://microsoftgraph.chinacloudapi.cn/v1.0/users/{user_id}/drives
Suddenly, it keeps encounter this error:
{
"error": {
"code": "BadRequest",
"message": "Unable to retrieve user's mysite URL.",
"innerError": {
"request-id": "d50647af-33c2-4503-a6c1-eb046173108c",
"date": "2018-04-03T08:33:58"
}
}
}
I have checked the subscription and APP permission in graph API, all permission is enabled
And I have tested another APP using the same graph API permission which works fine.
Do not know what going wrong here
Thanks you.

Resources