cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
chris_wilkinson
Frequent Visitor

Permission problem with HTTP POST request to Excel, using MS Graph API

Hi,

 

I have a flow that should get list of all files in a Sharepoint directory and put the the list in a pre-existing table in an Excel file. Often there can be hundreds, even thousands, of files in the folder and I found that using the Excel connector took about 2 seconds to add each row, which is way too slow to be practical. After researching I found that it can be done using the MS Graph API and an HTTP POST request. However, when I try it the flow works until it gets to the HTTP request then stops with the error - "Either scp or roles claim need to be present in the token.". 

The MS Graph permissions I have added to my app are Files.Read, Files.ReadWrite, Files.ReadWrite.All and Files.ReadWriteAppFolder. I think I read somewhere that I need to use Application Permissions not just Delegated permissions, but I do not know what that means and also the application permissions require Admin Consent. I work in a large corporation and do not even know who that would be and whether they would give me the required permissions. I do not understand why I should need administrative consent to add rows to a table in an Excel file that I created and own. Also, I need to know which permissions I need for the MS Graph API.

 

Here is the HTTP Post Request in full - what is wrong with it?

 
1 ACCEPTED SOLUTION

Accepted Solutions
mobashee
Community Support
Community Support

Dear Partner,

You need to provide required permission, please refer to the link below

https://techcommunity.microsoft.com/t5/microsoft-graph-security-api/authentication-issues/m-p/193734

https://stackoverflow.com/questions/55790865/accessdenied-either-scp-or-roles-claim-need-to-be-prese...

 

Did I answer your question? Please consider to mark my post as a solution to help others.

 

Regards,

Mohamed Sanuj Basheer

 

View solution in original post

3 REPLIES 3
chris_wilkinson
Frequent Visitor

I am it was sorry for the abrupt end. I tried to add an picture of the HTTP Request from Power Automate but it was removed along with the end which read:

 

Thank you very much,

Chris

 

As I cannot seem to add the image:

HTTP POST Request.jpg

mobashee
Community Support
Community Support

Dear Partner,

You need to provide required permission, please refer to the link below

https://techcommunity.microsoft.com/t5/microsoft-graph-security-api/authentication-issues/m-p/193734

https://stackoverflow.com/questions/55790865/accessdenied-either-scp-or-roles-claim-need-to-be-prese...

 

Did I answer your question? Please consider to mark my post as a solution to help others.

 

Regards,

Mohamed Sanuj Basheer

 

View solution in original post

Akash2505
New Member

I have done a similar call using App-Only authentication. I have shown here how to confirm what permissions are required for respective graph api, how to add those permission in app in AAD and in the end how to use the app to call the respective api. Hope this will help you

 

https://www.youtube.com/watch?v=tHmYp7Qh9Dg&list=PLR5fMDkX5kHz5Hsu2n8x6kt0t2nIVRviu

Helpful resources

Announcements
MPA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Users online (1,909)