I got quite far following the hints from Pulling Excel.xlsx workbook from Sharepoint site using Microsoft Graph API but now I am stuck and would appreciate some help.
I want to call the Graph API Excel endpoint from a Power Automate flow and first I am testing things in the Graph Explorer but cannot get beyond a point.
What works (and confirms that the file's "mimeType" is "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"):
https://graph.microsoft.com/v1.0/sites/<tenantid>.sharepoint.com:/sites/<siteid>:/lists/<listid>/items/19/driveitem
But when I try this:
https://graph.microsoft.com/v1.0/sites/<tenantid>.sharepoint.com:/sites/<siteid>:/lists/<listid>/items/19/driveitem/workbook
... it generates error:
{
"error": {
"code": "-1, Microsoft.SharePoint.Client.InvalidClientQueryException",
"message": "The parameter name path is not valid.",
"innerError": {
"date": "2020-10-22T08:04:16",
"request-id": "aad38960-538d-4a5b-b3c6-097d19f07b09",
"client-request-id": "a029dea8-f9f9-9a04-d4a3-7901be8d1eca"
}
}
Any suggestion?
Thanks!
P
Can you please have a try below endpoint?
https://graph.microsoft.com/v1.0/sites/<siteid>/lists/<listid>/items/8253/driveitem/workbook/worksheets
Below is my test:
Related
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?
I had used below API to read its content from Sharepoint using Microsoft Graph API.
https://graph.microsoft.com/v1.0/sites/{hostname},{spsite-id},{spweb-id}/drives/<drive-id>/items/<items-id>/content
Two days before, It properly get file content from root site properly. but today i have checked to get the same file content it leads below issue.
{
"error": {
"code": "itemNotFound",
"message": "Item not found",
"innerError": {
"request-id": "<request_id>",
"date": "<date_time>"
}
}
}
Don't know what it could cause this? Am googling it not found better solution for it.
Anyone suggest me the way to resolve above issue.
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.
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.
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.