Skip to main content

Notifications

Community site session details

Community site session details

Session Id : HQel61t9wBajktqlittSJA
Power Automate - Building Flows
Answered

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

Like (0) ShareShare
ReportReport
Posted on 3 Feb 2021 09:47:38 by

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?

 
  • Akash2505 Profile Picture
    2 on 22 Mar 2021 at 22:38:01
    Re: Permission problem with HTTP POST request to Excel, using MS Graph API

    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

  • Verified answer
    mobashee Profile Picture
    on 03 Feb 2021 at 13:58:51
    Re: Permission problem with HTTP POST request to Excel, using MS Graph API

    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-present-in-the-token

     

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

     

    Regards,

    Mohamed Sanuj Basheer

     

  • Community Power Platform Member Profile Picture
    on 03 Feb 2021 at 09:53:47
    Re: Permission problem with HTTP POST request to Excel, using MS Graph API

    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

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,776 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,093 Most Valuable Professional

Leaderboard
Loading started