cancel
Showing results for 
Search instead for 
Did you mean: 

Graph API - How to use this authentication method.

VIJAY__KUNWAR
Level 3

Hi All,

Can someone show us example how exactly we can find the drive id, Site Id and File Id for executing the Graph API skillset for SharePoint. May be by using Delegating Site access.

Though we are already using API skillset for SharePoint but we need to use modern authentication which I don't understand what exactly is it. According to me its Graph API only. So if someone can explain me and provide examples how we can use this would be really great.

I need example please. Thanks.

Regards,
Vijay



------------------------------
VIJAY KUNWAR
SYSTEMS ENGINEER
TCS
Asia/Kathmandu
------------------------------
19 REPLIES 19

@ewilson,

Hi I am using the Sharepoint ACS Authentication and it skillset which was available in the Digital Exchange portal earlier but its not available now on the portal.

Same connectors I am referring now for the Graph API -

https://digitalexchange.blueprism.com/dx/entry/3439/solution/microsoft-graph-api---sharepoint
https://digitalexchange.blueprism.com/dx/entry/3439/solution/microsoft-graph-api---sharepoint-upload-sessions
https://digitalexchange.blueprism.com/dx/entry/9648/solution/microsoft-graph-api---download-files

1- As an example, if I get my auth token and then I call the action Get Root Site it will return a Collection of data(Which VBO action is having these options as I haven't seen any of these) Can you help on this please?

Regards,
Vijay


------------------------------
VIJAY KUNWAR
SYSTEMS ENGINEER
TCS
Asia/Kathmandu
------------------------------

@VIJAY KUNWAR,

Ok, you're using the older SharePoint connector that was archived some time ago due to support issues and the primary developer/maintainer leaving. That connector/skill did not support Delegated Access authentication. It only supported Application Access authentication.

If you look at the asset card for each of the assets I linked above you'll see a PDF user guide. Each guide lists the actions exposed by the specific connector.​

7902.png
Cheers,

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

@ewilson,

Thanks for the all help. The access and app registration has been done in the Azure directory. But the action using delegated access token unable to generate. Throws this error - The remote server returned an error: (400) Bad Request.

But able to generate using Application access token. Does this mean we still don't have delegate access?

One more query is do we really able to download the file locally to any of the folders?

If yes then how?

Also can you explain this error if we try the things with the​ Microsoft Graph - Download Files VBO.

Internal : Could not execute code stage because exception thrown by code stage: Access to the path 'C:\******' is denied.

We tried the above approach using Application access token and HTTP Request File.


Regards,
Vijay



------------------------------
VIJAY KUNWAR
SYSTEMS ENGINEER
TCS
Asia/Kathmandu
------------------------------

Hi @VIJAY KUNWAR,

When you created your app registration in Azure AD, what type of account did you select?
7916.png
Application Access tokens and Delegated Access tokens are not the same thing. There are some endpoints within the Graph API that specifically require a Delegated Access token​ (ex. Sending a message in a Chat within Microsoft Teams via Graph).

My recommendation is to review the specific endpoints you're interested in. If they support Application Access tokens, that is what I would use. I only go with Delegated Access is the endpoint specifically requires it.

Regarding download, which action are you trying to use? Does the runtime resource have permissions on the folder where you're trying to save the file to? 

Cheers,

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

Hi @ewilson,

We have selected the first option that is Singe Tenant.

Regarding download I just did. We need to give the filename as well after the directory location of Save to.

But I wanted to check with you how can we do for multiple files together I can only see Download File which allows only a single file at a time to download from this action marked with Blue border. Is there any other action or its not yet provided by Blue Prism. Thanks

7928.png

Regards,
Vijay​

------------------------------
VIJAY KUNWAR
SYSTEMS ENGINEER
TCS
Asia/Kathmandu
------------------------------

@VIJAY KUNWAR,

Ah, I see what you're trying to do. Unfortunately, the connector only supports single file downloads at the moment. I believe their is an endpoint available that supports basically building a download bundle for multiple files, but we haven't added it to the connector yet.

Cheers,


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

Thanks @ewilson,

Do you have reference for that end point please?

Regards,
Vijay​

------------------------------
VIJAY KUNWAR
SYSTEMS ENGINEER
TCS
Asia/Kathmandu
------------------------------

@VIJAY KUNWAR,

After looking at this further, there is no specific endpoint for batch downloads. However, there is a thread that discusses the issue here. According to that thread you could create a specially crafted JSON payload​ to download up to 20 files at a time.

Alternatively, if you get the metadata for all the files you are interested in, each one should include a pre-authenticated download URL for each file (see image below). You could collect all of those URLs and then use a Code stage to kick off several asynchronous download sessions at one time. That would basically download all of those files in parallel.

7972.png
Cheers,

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

Hello Eric
You say "From there, you can call Get Drive Items to get a collection of all the contents in that specific folder. Then you would iterate over that collection and drill into any other child folders you may be interested in.". I can't get anywhere here. The problem is that with "Drive Items" I get the information for both folders and files. If I want to drill-into any child folder, I have to know what folders and what files are. How do I know what folders and what files are or how do I get the IDs only from the folders? Basically it also works with files (I just can’t drill-into then), but for performance reasons this is very unsatisfactory.

Regards,

Patrick



------------------------------
Patrick Brunner
RPA Engineer
Die Mobiliar
Europe/Zurich
------------------------------

EasyBluePrism
Level 4

I have another question: It is quite normal that within a folder there are ten subfolders. This means I have to create ten nested loops to get to the last subfolder. This is incredibly time-consuming and not very user-friendly. Is there another way?

Why can’t I just use the file or folder name to find a file or folder and why I have to work with these IDs? At Powerautomate for example, this is an absolute no-brainer.