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

Community site session details

Session Id :
Power Automate - Using Connectors
Unanswered

Unable to Run SharePoint API Call Using Service Principal in Power Automate

(1) ShareShare
ReportReport
Posted on by

I am currently unable to execute a SharePoint API call using a Service Principal within Power Automate.
The same script works successfully when using SharePoint’s built-in HTTP connector, which relies on user credentials.
Below is a summary of the request and the error encountered:

Request Details:

{
    "uri": "https://abc.sharepoint.com/teams/Test/_api/web/lists/GetByTitle('Documents')/fields",
    "method": "POST",
    "headers": {
        "Accept": "application/json;odata=verbose",
        "Content-Type": "application/json;odata=verbose"
    },
    "authentication": {
        "authority": "https://login.microsoftonline.com/*sanitized*",
        "tenant": "*sanitized*",
        "audience": "https://abc.sharepoint.com",
        "clientId": "*sanitized*",        
        "secret": "*sanitized*",
        "type": "ActiveDirectoryOAuth"
    },
    "body": {
        "__metadata": {
            "type": "SP.FieldChoice"
        },
        "FieldTypeKind": 6,
        "Title": "Reference",
        "Choices": {
            "results": [
                "None",
                "Keep"
            ]
        },
        "Required": true,
        "DefaultValue": "None",
        "Hidden": false
    }
}

 

Error Received:

BadGateway Http request failed as there is an error getting AD OAuth token: 'Failed to extract error details from response content '''.

Categories:
I have the same question (0)
  • Michael E. Gernaey Profile Picture
    47,125 Super User 2025 Season 2 on at
    Unable to Run SharePoint API Call Using Service Principal in Power Automate
     
    Did you resolve this issue? If so can you share what you did?
  • Michael E. Gernaey Profile Picture
    47,125 Super User 2025 Season 2 on at
    Unable to Run SharePoint API Call Using Service Principal in Power Automate
     
    Here are some articles to take a look at.
     
    I am not sure what registration etc etc etc all you did so instead of asking the long list of questions, I just posted those that cover them.
     
    If you still have issues please let me know.
     
    If this works for you please Mark as such
    Thanks!

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Telen Wang – Community Spotlight

We are honored to recognize Telen Wang as our August 2025 Community…

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Tomac Profile Picture

Tomac 986 Moderator

#2
stampcoin Profile Picture

stampcoin 699 Super User 2025 Season 2

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 577 Super User 2025 Season 2

Featured topics