Graph API encounter 400 failed to get drive in china - azure

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.

Related

The caller does not have permission. Google Adsense Management Api

{ "error": { "code": 403, "message": "The caller does not have permission", "errors": [ { "message": "The caller does not have permission", "domain": "global", "reason": "forbidden" } ], "status": "PERMISSION_DENIED" } }
It says you don't have permission. But I am logging in oauth2 with the adsense account itself. So it's not from a different account. It seems silly to me that there is an access permission issue here. I couldn't get past this error for about 1 day.
By the way, I get the same result in google's 'try this method' service.
SOLVED
I was entering the adsense email as the accounts parameter, the problem was here. API worked when using account name

Access denied issue for Microsoft graph api

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"
}
}
}

Issue Getting User Chats - Graph API

I am trying to get signed in user's chat messages in a B2C Tenant. I am getting 401 Unauthorized error. Tried the same with graph explorer which is also giving same error. I am using https://graph.microsoft.com/beta/me/chats endpoint. As per MSDN documentation, I have already given permissions to my Azure app. When I am trying this with a non B2C tenant, the API call succeeds.
Please help me with this issue. Error I am seeing is given below.
{
"error": {
"code": "Unauthorized",
"message": "Unauthorized",
"innerError": {
"date": "2021-06-24T15:30:29",
"request-id": "f2804d78-59d2-4917-ae2e-cb73b3eb0872",
"client-request-id": "52452dfc-cae9-d409-92b9-9e9586cab6c3"
}
}
}
With some research I found out that B2C tenants don't allow Teams at the first place. I have switched to a B2B tenant and it started working like a charm.

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:

Microsoft Graph InTune Beta API's - Unable to add app to app policy

I am attempting to use Intune specific beta Graph APIs to assign apps to an iOS managed app protection policy. I am able to create the app policies using the endpoint documented below:
https://graph.microsoft.io/en-us/docs/api-reference/beta/api/intune_mam_iosmanagedappprotection_create
When created via API, the app "deployedCount" is 0 until specific apps are added in the admin console UI.
Now, I am attempting to retrieve apps added to any policy by API using the endpoint documented below.
https://graph.microsoft.io/en-us/docs/api-reference/beta/api/intune_mam_mobileappidentifierdeployment_list
I get a 400 bad request response that appears to say this endpoint either does not exist or is not responding correctly. This seems unlike if I mistyped an endpoint.
Response I receive:
{
"error": {
"code": "No method match route template",
"message": "No OData route exists that match template ~/entityset/key/navigation with http verb GET for request /MAMAdmin/MAMAdminFEService/managedAppPolicies('T_338de6df-386d-4f1b-a51c-a0d189c61722')/mobileAppIdentifierDeployments.",
"innerError": {
"request-id": "79514f29-4dca-48a5-a2de-5d14138577d7",
"date": "2017-02-08T17:46:52"
}
}
}
Response if I mistyped:
{
"error": {
"code": "BadRequest",
"message": "Resource not found for the segment 'asdfasdf'.",
"innerError": {
"request-id": "e86d84ab-f062-4780-af3c-9afae6e7bc82",
"date": "2017-02-08T18:53:29"
}
}
}
Hello this is Alemeshet Alemu from MSFT.
Sorry, the API documentation is a bit out sync. Could you try with $expand?
GET /managedAppPolicies/{managedAppPoliciesId}?$expand=mobileAppIdentifierDeployments
Alemeshet Alemu (MSFT)

Resources