web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Call SharePoint Api us...
Power Automate
Answered

Call SharePoint Api using Power Automate "Http" by passing App registration clientID/Secret

(1) ShareShare
ReportReport
Posted on by 1,871 Season of Giving Solutions 2025

I have created an Azure App registration, and granted it permissions to manage SharePoint sites. then i want to query the SharePoint sites' users, using SharePoint API, here the first request to get the access_token


then i get the access token and pass it inside the Authorization header, as follow:-


but the second action return Unauthorized:-

{
    "statusCode": 401,
    "headers": {
        "Cache-Control": "private",
        "Server": "Microsoft-IIS/10.0",
        "X-NetworkStatistics": "0,4194720,0,0,39,24479,24479,15301",
        "IsOCDI": "0",
        "X-DataBoundary": "EU",
        "X-1DSCollectorUrl": "https://eu-mobile.events.data.microsoft.com/OneCollector/1.0/",
        "X-AriaCollectorURL": "https://eu-mobile.events.data.microsoft.com/Collector/3.0/",
        "SPRequestGuid": "c20dd9a1-7025-e000-6f5b-0d2e1e2d49d1",
        "request-id": "c20dd9a1-7025-e000-6f5b-0d2e1e2d49d1",
        "MS-CV": "odkNwiVwAOBvWw0uHi1J0Q.0",
        "SPLogId": "c20dd9a1-7025-e000-6f5b-0d2e1e2d49d1",
        "Alt-Svc": "h3=\":443\"",
        "Strict-Transport-Security": "max-age=31536000",
        "X-Frame-Options": "SAMEORIGIN",
        "Content-Security-Policy": "frame-ancestors 'self' teams.microsoft.com *.teams.microsoft.com *.skype.com *.teams.microsoft.us local.teams.office.com teams.cloud.microsoft *.office365.com goals.cloud.microsoft *.powerapps.com *.powerbi.com *.yammer.com engage.cloud.microsoft word.cloud.microsoft excel.cloud.microsoft powerpoint.cloud.microsoft *.officeapps.live.com *.office.com *.microsoft365.com m365.cloud.microsoft *.cloud.microsoft *.stream.azure-test.net *.dynamics.com *.microsoft.com onedrive.live.com *.onedrive.live.com securebroker.sharepointonline.com;",
        "SPRequestDuration": "23",
        "SPIisLatency": "1",
        "x-ms-suspended-features": "features=\"\"",
        "X-Powered-By": "ASP.NET",
        "MicrosoftSharePointTeamServices": "16.0.0.26629",
        "X-Content-Type-Options": "nosniff",
        "X-MS-InvokeApp": "1; RequireReadOnly",
        "P3P": "CP=\"ALL IND DSP COR ADM CONo CUR CUSo IVAo IVDo PSA PSD TAI TELo OUR SAMo CNT COM INT NAV ONL PHY PRE PUR UNI\"",
        "WWW-Authenticate": "Bearer realm=\"0bcccd25-af10-4583-95d7-53f14b7a506e\",client_id=\"00000003-0000-0ff1-ce00-000000000000\",trusted_issuers=\"00000001-0000-0000-c000-000000000000@*,D3776938-3DBA-481F-A652-4BEDFCAB7CD8@*,https://sts.windows.net/*/,https://login.microsoftonline.com/*/v2.0,00000003-0000-0ff1-ce00-000000000000@90140122-8516-11e1-8eff-49304924019b\",authorization_uri=\"https://login.microsoftonline.com/common/oauth2/authorize\"",
        "Date": "Thu, 13 Nov 2025 19:26:48 GMT",
        "Content-Length": "27"
    },
    "body": {
        "$content-type": "application/octet-stream",
        "$content": "VW5zdXBwb3J0ZWQgYXBwIG9ubHkgdG9rZW4u"
    }
}
 

any advice?

Categories:
I have the same question (0)
  • chiaraalina Profile Picture
    1,884 Super User 2026 Season 1 on at
    Hi
     
    What are the values of scope and weburl variable?
  • Verified answer
    MarkRahn Profile Picture
    1,351 Super User 2026 Season 1 on at
    Hi,
     
    Using Client ID and Client Secret has been deprecated and may be disabled for the site you are trying to access. It stopped working for new tenants as of November 1st, 2024; and it will stop working for existing tenants and will be fully retired as of April 2nd, 2026
     
    Check this blog post for info on how to re-enable it till April 2nd, 2026:
     
    The body content of the reply is:
        "body": {
            "$content-type": "application/octet-stream",
            "$content": "VW5zdXBwb3J0ZWQgYXBwIG9ubHkgdG9rZW4u"
        }
     
    That $content value is Base64‑encoded text. When decoded, it reads:
    Unsupported app only token.
     
    Did you get your answer over on Stack Overflow as I see a similar question posted there from 3 days ago?
     
     
    Is there a reason you are not using the SharePoint HTTP Action which handles the Authentication? This blog post seems to do the first part of what you want but used the SharePoint HTTP Action instead:
     
    You are going to have to switch to another type of Authentication similar to the Stack Overflow reply where they are using a certificate if you want to proceed with getting an Auth Token and using the HTTP call or change to using the SharePoint HTTP call.
     
    This community is supported by individuals freely devoting their time to answer questions and provide support. They do it to let you know you are not alone. This is a community.

    If someone has been able to answer your questions or solve your problem, please click Does this answer your question. This will help others who have the same question find a solution quickly via the forum search.

    If someone was able to provide you with more information that moved you closer to a solution, throw them a Like. It might make their day. 😊

    Thanks
    -Mark
     
     
  • trice602 Profile Picture
    16,164 Super User 2026 Season 1 on at
    Great answer @MarkRahn

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 873

#2
Valantis Profile Picture

Valantis 820

#3
Haque Profile Picture

Haque 505

Last 30 days Overall leaderboard