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 / How to authenticate Go...
Power Automate
Unanswered

How to authenticate Google Sheets API using OAuth 2.0 from Power Automate?

(1) ShareShare
ReportReport
Posted on by 499

I am new to Google Suit. As part of a requirement, we are trying to access Google Sheets from Microsoft Flows (Power Automate) using HTTP call. I have the details to access Google Sheets API such as client_id, client_secret and redirect_uri. It would be if any thoughts on the approach to achieve the authentication with the above details.

Scenario: We have some Google Sheets which holds data to be READ and WRITE Back.

I have tried calling Google Token API with below details, but getting an error

Error 400: invalid_request Required parameter is missing: response_type

Our main goal is to bypass user consent and authenticate Google APIs using client id and secret and perform the required actions on the data.

Steps performed to authenticate the Google API

Method: Get
URL: https://accounts.google.com/o/oauth2/auth 
Headers:
{
"client_id": "xxxxxxxxxxx-xxxxx0r0e4oe1dllujkiejtm7ii42jqk.apps.googleusercontent.com",

"redirect_uri": "https://console.cloud.google.com",

"response_type": "code",

"scope": "https://www.googleapis.com/auth/spreadsheets",

"access_type": "offline",

"prompt": "none"

}

I am following https://developers.google.com/identity/protocols/oauth2/web-server#httprest as a reference.

Categories:
  • Jronash Profile Picture
    827 on at

    Is that URL correct?  Looks like it should be https://accounts.google.com/o/oauth2/v2/auth.

     

    If the URL isn't the issue, I'd go through your Headers JSON with a fine-toothed comb.  It's strange that the error message is saying that your response_type header is missing when it looks like it's right there.  Make sure all your quotes and commas are where they should be, and that everything is spelled correctly.

  • Jronash Profile Picture
    827 on at

    Oh wait, I read too fast.  You're passing these as headers, but they're supposed to be query parameters.  See this example:

    https://accounts.google.com/o/oauth2/v2/auth?
     scope=https%3A//www.googleapis.com/auth/drive.metadata.readonly&
     access_type=offline&
     include_granted_scopes=true&
     response_type=code&
     state=state_parameter_passthrough_value&
     redirect_uri=https%3A//oauth2.example.com/code&
     client_id=client_id

    So it sounds like you can add all the parameters to the URL.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Did you manage to find a solution?

    Love to hear this.

    Mario

  • abm abm Profile Picture
    33,004 Most Valuable Professional on at

    Hi @krishnags , @Anonymous , @Jronash 

     

    I have separated this into three tutorial videos.

     

    Video Part 1 - How to obtain authorisation code?
    https://youtu.be/LtH_VOax9DU

     

    Video Part 2 - How to obtain access and refresh tokens?
    https://youtu.be/MZN74noAB2w

     

    Video Part 3 - How to obtain bearer token using refresh token and access Google Drive API using PowerAutomate?
    https://youtu.be/TLZ2WpDE7U0

     


    Please have a look and comment.

  • Capek Profile Picture
    2 on at

    Hi @abm ,

     

    I'm having trouble on Part 2 of the video when trying to retrieve the refresh token. Please see below image. Error is :BAD REQUEST.

    HTTP Bad 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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
Mohsin Ali Profile Picture

Mohsin Ali 414

#2
11manish Profile Picture

11manish 335 Super User 2026 Season 2

#3
M Bilal Khan Profile Picture

M Bilal Khan 274

Last 30 days Overall leaderboard