Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Using Flows
Unanswered

how to use flow to connect API using OAuth 2.0

(0) ShareShare
ReportReport
Posted on by 40

Hi All, 

My goal establish the connection with the customer website using API with OAUTH 2.0 ( using client Secret and API Key) to download the images from the customer. i got an error message while trying to connect with customer API. 

My question : 

- are we be able to use HTTP call to connect ? i could not find the authorization "Oauth 2.0" on the list ? they only show 'Active Directory Oauth' - which asking to to enter Tenant and Audience as a required ; but i have no information.

- what is the possible solution for this ? i am so new to flow so not sure what should i do to establish the connection. Please advice

 

 

 

  • vnguyen1 Profile Picture
    40 on at
    Re: how to use flow to connect API using OAuth 2.0

    Thanks for your response, @v-lin-msft 

    below is my input for HTTP call :

    method :  POST

    URL:https://api.gettyimages.com/oauth2/token

    Header :

    Content-Type: application/x-www-form-urlencoded

    Body:

    client_id=exampleApiKey&client_secret=exampleSecret&username=someUsername&password=WithSomePassword

    ==>

    i got below error message while trying to generate the access token :

    BadRequest. The provided input content is not valid: 'The provided content-type header value
    'application/x-www-form-urlencoded ' is not well formed.'.
     
    not sure what should i do at this point ? 
    Please advice
  • v-lin-msft Profile Picture
    728 on at
    Re: how to use flow to connect API using OAuth 2.0

    Hi @vnguyen1,

     

    The HTTP action can be able to call the web API and it generated authorization headers. 

     

    The Audience and Client ID are the same value.  You can check this in your Azure Portal Application registration, this is the Application ID in the properties.

    The Tenant field value is the domain, for example for us its: YourTenant.onmicrosoft.com.

     

    You can also refer to this blog:

    https://powerusers.microsoft.com/t5/Microsoft-Flow-Community-Blog/Generate-an-Azure-OAuth2-0-Token-from-a-quot-service-quot-Flow/ba-p/61979 

    Please have a try, I hope it can help you.

     

    Best Regards,

    Community Support Team _ Lin Tu

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,645 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,997 Most Valuable Professional

Leaderboard

Featured topics

Restore a deleted flow