09-05-23 05:29 AM
Hi Team,
In our process, we need to utilize the SharePoint Graph API to access a particular library within a SharePoint site of a site collection. This is due to the client's stringent internal security policies. However, I am currently encountering difficulties in retrieving the necessary attributes for carrying out SharePoint operations.
I am using the below the VBO for the sharepoint operations.
https://digitalexchange.blueprism.com/dx/entry/3439/solution/microsoft-graph-api---sharepoint
Also I used the following VBO to obtain token with delegated access. PFA Azure AD API Permissions.
https://digitalexchange.blueprism.com/dx/entry/9648/solution/microsoft-graph-api---authentication
Basically I need to perform the below actions:
Download File(VBO Action Name) - Access token , Site Id, Drive Id, File ItemId (Parameters)
Create Folder - AccessToken, SiteId, DriveId , Parent FoldrId, FolderName , Conflict Behaviour
Move File - Access Token , SiteId, Source File ItemId , Source DriveId, Destination Folder ItemId, Destination File Name , Destination DriveId
Upload File - AccessToken , SiteId, DriveId, File Path, File Name , File.
I am able to run the "Get Root Site" action and obtain the root site ID. However, when I attempt to run the "Get drive Items" action using the root site ID to obtain the required attributes, I am receiving "Access denied" errors. Please find attached a screenshot of the error from BP.
Could someone please help me with this.
Note - I have been granted access to the specific libraries within a SharePoint site, but not to the entire site.
09-05-23 05:56 AM
Hi Jinil,
For Get Drive Items you would need permissions as listed here on the page - https://learn.microsoft.com/en-us/graph/api/driveitem-list-children?view=graph-rest-1.0&tabs=http ;
10-05-23 08:45 AM
Hi Shashank,
Thank you for your response.
While the client has added the recommended API permissions, I am still unable to retrieve the necessary attributes to navigate the SharePoint library.
My primary challenge is to gather the necessary attributes for navigating the SharePoint library.
In order to run the "Get drive Items" , I need the parameters like Folder Id, Drive ID etc however I am not able to get them.
I was able to execute the "Get Root Site" action and retrieve the Site ID successfully. Afterward, I used this Site ID to run the "Get All Drives" action. However, I did not receive any output in the collection, even though the status code was 200, indicating that the operation was successful. Additionally, the 'Get Default Drive Details' action resulted in an 'Access denied' error. Please find the below response content by running "Get All Drives" Action.
Also please find the revised API permissions as follows:
Just to clarify, I would like to mention(as already mentioned before) that the user in question has limited access to a specific library within a SharePoint site of a site collection through a delegated token. It's unclear whether this limited access is causing the issue of missing attributes. Before I respond to the client's request and ask for additional site permissions, I need to confirm whether the limited Sharepoint site access granted to the user is the reason behind the missing attributes.
Please let me know if you have any advice on how to proceed.
10-05-23 11:46 AM
Hi All,
It would be greatly appreciated if someone could provide an update on this. Thank you.
10-05-23 12:47 PM
Hi Jinil,
I would suggest using the Graph Explorer to find all the attributes you are looking for.
https://developer.microsoft.com/en-us/graph/graph-explorer ;
You can also look at the permissions required here for Get All Drives
11-05-23 06:01 AM
Hi Shashank,
Thank you for your response.
As mentioned above ,We have added in the necessary permissions for "Get All Drives" and the status code is 200 however it is receiving no output values in the collection.
Could you please help with this.
11-05-23 04:51 PM
Hi Jinil,
Have you tried "enumerate the enumerate the document libraries under the root site" in the Graph explorer to get the Drive ID?