Does ms graph API support outlook on office 365 on Germany endpoint? - azure

I found that graph API in Germany endpoint seems not to support
GET /users/<id>/mailFolders/delta
it returns
**400**
{
"error": {
"code": "ErrorInvalidIdMalformed",
"message": "Id is malformed.",
"innerError": {
"request-id": "cf713386-f050-40b4-b987-43cc2384eade",
"date": "2017-12-12T07:13:10"
}
}
}
However it works fine at
GET /users/<id>/mailFolders
Thanks for help

I had been in the same trouble, but I resolved.
Your request to:
GET /users/<id>/mailFolders/delta
is not correct, I think.
I guess that this mail folder delta was made by you, doesn't it?
To specify a mail folder, you need to use folder id, not display name.
Though you might already get the folder id, you can get the folder id by sending a request
GET /users/<id>/mailFolders
Note: Actually, we can get folder_ids via powershell:
Get-MailboxFolderStatistics
cmdlet on Exchange. However, these folder_id are malformed in ms-graph request. So you need to use the id which you can get as described above.

Related

How do you update your profile picture using Microsoft Graph API?

I'm experimenting on Microsoft Graph API to update the profile picture.
Although there is a documentation about it (See Link Here: https://learn.microsoft.com/en-us/graph/api/profilephoto-update?view=graph-rest-1.0&tabs=javascript), I can't seem to understand it.
I tried sending a random data to see if something would work, however I can only get the GET Method to work but somehow trying to make the PUT Method work returns an error.
{
"error": {
"code": "ErrorInsufficientPermissionsInAccessToken",
"message": "Exception of type 'Microsoft.Fast.Profile.Core.Exception.ProfileAccessDeniedException' was thrown.",
"innerError": {
"date": "2022-04-15T07:10:11",
"request-id": "********-****-****-****-************",
"client-request-id": "********-****-****-****-************"
}
}
}
Basically the two concerns are:
How to use the PUT Method for updating the profile picture using Microsoft Graph API
Why am I receiving the error as if I'm not allowed to update?
Is it because I'm doing the PUT Method incorrectly?
Is it because I need some sort of subscription to use the API?

MS Flow SharePoint "Grant Access" action fails with "Item does not exist"

I'm getting an error in my flow when using the Grant Access to an item or folder action to grant view access to an account on a list item. I've tested this action on a SharePoint site (comm-site) configured exactly the same (99% certain) in the same tenant and it works fine. In this instance, I have a get item action on the same ID right after it, and that action works fine. The error that I get looks like this:
"body": {
"error": {
"code": 502,
"source": "flow-apim-msmanaged-na-westus2-01.azure-apim.net",
"clientRequestId": "9f16fa13-287c-441d-9331-3e7e93a5811f",
"message": "BadGateway",
"innerError": {
"status": 500,
"message": "Item does not exist. It may have been deleted by another user.\r\nclientRequestId: 9f16fa13-287c-441d-9331-3e7e93a5811f\r\nserviceRequestId: 9f16fa13-287c-441d-9331-3e7e93a5811f"
}
}
}
}
Request Ids (not sure which are important):
From inner error:
"clientRequestId": "9f16fa13-287c-441d-9331-3e7e93a5811f"
From error response header:
"SPRequestGuid": "9f16fa13-287c-441d-9331-3e7e93a5811f"
"request-id": "9f16fa13-287c-441d-9331-3e7e93a5811f"
I'm not sure if this is the sharepoint API, or graph API under the hood - but the behaviour is completely stumped me and I have no clue what is going on.
Per my test, this issue happens when we try to grant access to a list item which does not exist. So make sure the list item with the ID exist in this list.
You could add a "Get item" action and use the id, check whether you could get the item with this id.
I deleted the action and re-created it. It worked fine after that.
This was likely my mistake: I had made this flow by exporting a flow from a solution ("solution-aware flow") and importing it is a regular flow. There was a dialog that said "this is for importing normal flows, to import a flow from a solution go to solutions" which I .. disregarded. The problem was likely a result of that mis-step.

Accessing Files in a SharePoint Site via Graph: Bad Request

The documentation for using the MS Graph 1.0 API for accessing SharePoint files from libraries seems clear enough, if a bit indirect. My understanding is that I should be able to access the top level item of a library (and then its children via /children) by the following url scheme:
https://graph.microsoft.com/v1.0/sites/<my-tenant>.sharepoint.com:/sites/my-test-site:/drive/root
But I am only getting back an error telling me the Url is invalid:
{
"error": {
"code": "BadRequest",
"message": "Url specified is invalid.",
"innerError": {
"request-id": "08bb72aa-f3be-4df0-b253-dacc4a8fe390",
"date": "2019-07-08T16:38:07"
}
}
}
I've tried a few other url formats as well, such as specifying the drive specifically by Id /drives/<driveId>/root but had the same luck. I'm sure I am misunderstanding something. I'm using the "Path" format (:/sites/path-to-site:/ in the API because it is more natural than going and fetching an Id for everything I need to query.
You need provide global Id of the site you want to access (global Id is <hostName>,<siteCollectionId>,<siteId>).To get the global id, in you test, we can use this.
https://graph.microsoft.com/v1.0/sites/<my-tenant>.sharepoint.com:/sites/my-test-site:/
And below API gives us a list of files on a specified site's default drive:
https://graph.microsoft.com/v1.0/sites/<hostName>,<siteCollectionId>,<siteId>/drive/root/children
If you want to access files on a specific list, all you need is the id of the list:
https://graph.microsoft.com/v1.0/sites/<hostName>,<siteCollectionId>,<siteId>/lists/<listId>/drive/root/children

Get document libraries for domain-my.sharepoint.com

I am trying to access the document libraries created by a user in their own domain-my.sharepoint.com, based on the documentation I inferred that the way to do it is
https://graph.microsoft.com/beta/sites/domain-my.sharepoint.com/drives
As drives map to document library(?)
I'm able to make this work with domain.sharepoint.com, but unable to make it work with domain-my.sharepoint.com
here is what it says:
{
"error": {
"code": "invalidRequest",
"message": "Provided id is not suitable for the current host",
"innerError": {
"request-id": "09c5722c-cfc3-4589-ba76-e57c44590d16",
"date": "2017-06-27T06:53:59"
}
}
}
Any help will be appreciated.
I believe what you're looking for is the OneDrive endpoint. You can access the current user's drive using https://graph.microsoft.com/v1.0/me/drive/
Another way to get what you want is via a request to:
https://domain-my.sharepoint.com/_api/v2.0/sites/domain-my.sharepoint.com/drives
Basically the /_api/v2.0/sites endpoints seems to support everything that is documented in the corresponding Graph API docs.

expand=fields($select=***,****) on the SharePoint Graph resource doesn't work and how about filtering?

I'm playing with the microsoft graph and especially the sharepoint beta api and i am constantly running into issues. I know its beta, but still;)
I'm getting out my expanded fields but i'm not able to select other than id.
/items?expand=fields(select=id) <-- works
/items?expand=fields(select=Title) <-- fails with response being
{
"error": {
"code": "invalidRequest",
"message": "The request is malformed or incorrect.",
"innerError": {
"request-id": "f460cded-46da-468c-a027-f027707a62fc",
"date": "2017-05-10T09:00:10"
}
}
}
Further on trying to filter the request with the request /items?expand=fields&$filter=fields/id eq '421' doesn't work and after a long period just returns a response without taken the filter into account.
Can someone respond if the experience the same or if my syntax is wrong or whatever would be nice. Thanks in advance. Ole Bergtun
i changed /items?expand=fields(select=Title) to /items?expand=fields(select%3DTitle) and it works for me.

Resources