cancel
Showing results for 
Search instead for 
Did you mean: 

Graph API - SharePoint - Get Drive Items in a Drive

Weng_LamCheong
Level 2
I am trying to retrieve the drive items in a document library on a SharePoint. I added a new action and I am unsure why it threw an error shown in the below screenshot and I also don't understand what this error means:
4059.png
Below is my settings for the new action:

Parameters:
4061.png
Request:
4062.pngResponse:
4064.png
I tried the same on POSTMAN and it worked. Any help on this would be greatly appreciated!

------------------------------
Weng Lam Cheong
------------------------------
3 REPLIES 3

ewilson
Staff
Staff
Hello @Weng_LamCheong,

Is this a WebAPI you've created yourself, or are you using something from the Digital Exchange?

Cheers,


------------------------------
Eric Wilson
Director, Integrations and Enablement
Blue Prism Digital Exchange
------------------------------

Hi @ewilson , This is the Web API Services Object called Microsoft Graph - SharePoint that I've downloaded from the Digital Exchange. The above settings that I've posted is a new action that I've created on it.​

------------------------------
Weng Lam Cheong
------------------------------

Hi @Weng_LamCheong

I believe the problem is in the URLPath you're providing. As I understand from your inputs, you are trying to get the children of the root. The way you wrote it wont work because the children is not a part of the drive items properties, but there's a relationship between them. To get the properties you need to use slashes as you wrote. However, to get the relationships you have to expand them. See below.

/sites/[SiteId]/drives/[DriveId]/root/?expand=children

An alternative to that would be sending multiple requests that gives you certain data that has direct properties with what you need. For example, There's an action in that sharepoint webservice called "Get Root Folder ID" that will be giving you the root folder ID. You can then utilize that ID to get the "Get Drive Items" which will have this URL Path "/sites/[SiteId]/drives/[DriveId]/items/[FolderId]/children" Notice that children is not being expanded because it is a property of that folder.

You can refer to Graph API Documentation​ 

I hope this helps.



------------------------------
Eslam Ghandour
RPA Developer
------------------------------