Error 400: Redirect_URI_Mismatch from Embed Code Object in Google Sites to Google Sheets API - google-sheets-api

I am trying to connect to Google Sheets API from Google Sites using the Embed Code object. It returns the following error when I try to log in:
Error 400: redirect_uri_mismatch
The JavaScript origin in the request, https://xxxxxxxx-atari-embeds.googleusercontent.com, does not match the ones authorized for the OAuth client.
OAuth 2.0 Client IDs on Google Cloud Platform do not accept https://googleusercontent.com as the Authorized JavaScript origins, and I'm not sure if there's a way to allow the embed object in Google Sites to access the Google Sheets API.
Please advise.

Related

redirect_uri_mismatch error on google cloud api

Request details: redirect_uri=http://localhost:8080/
I tried changing the uri in the client_secret file and on the google cloud console so they would match but it still doesn't work.

How to authenticate Google Sheets API using OAuth 2.0 from Postman/PowerAutomate(MS Flow)?

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.
Your formatting the request wrong. The first call is a http get you just place it in a browser window
https://accounts.google.com/o/oauth2/auth?client_id={clientid}&redirect_uri=urn:ietf:wg:oauth:2.0:oob&scope={scopes comma separated}&response_type=code
It will display the consent screen to the user. All parameters form a query string. They are not sent as headers there is nothing in the docs that says it should be sent as headers.
Useful links:
Google 3 Legged OAuth2 Flow
Understanding Google OAuth 2.0 with curl
The Discovery document

Getting "PARTNER_AUTHENTICATION_FAILED" error

While configuring API in Unqork(No-Code platform) getting error "PARTNER_AUTHENTICATION_FAILED" while try to fetch Signed Document.
I have used this API Endpoint - {{baseUrl}}/v2.1/accounts/{{accountId}}/envelopes/{{envelopeId}}/documents/0
And also getting file in UTF-8 format. But when trying to convert it into PDF than getting blank document.
Unqork
From google searching, it looks like this page may be of help: https://academy.unqork.com/advanced-api-authentication
In general, you need to get unqork to use OAuth with a DocuSign oauth service provider (account-d.docusign.com) to obtain an access token. Then use that access token in unqork's API calls to DocuSign.
Contact unqork's customer service group for more help.
General information on the problem
PARTNER_AUTHENTICATION_FAILED more information error message
Are you using legacy authentication or OAuth authentication? Only OAuth is supported for new integrations.
You must obtain an access token to make API calls. You can obtain an access token via OAuth.
See the docs. Or a video.
If you want more help, ask a new question and provide more information on exactly what you have tried and what is or is not working.

Google Analytics API: "Error 403 - User does not have sufficient permissions for this web property."

I've been trying to link a google ads and google analytics account through google analytics API. However, I always get the following error:
HttpError: <HttpError 403 when requesting https://www.googleapis.com/analytics/v3/management/accounts/xxxxxxxxx/webproperties/UA-xxxxxxxxx-1/entityAdWordsLinks?alt=json returned "User does not have sufficient permissions for this web property.">
I properly gave permissions to my service account email (at account level). Moreover, for all other methods, authentification has been successful and without any problem. For example, I was able to get all the data about links and even remove some of them which were manually added.
You can see the methods here on the link:
https://developers.google.com/analytics/devguides/config/mgmt/v3/mgmtReference/management/webPropertyAdWordsLinks
Before running the following lines of code, I implemented the code which you can find on the following link (python - quickstart for service accounts):
https://developers.google.com/analytics/devguides/config/mgmt/v3/quickstart/service-py
analytics = get_service(
api_name='analytics',
api_version='v3',
scopes=['https://www.googleapis.com/auth/analytics.edit'],
key_file_location='my_service_account_things.json')
analytics.management().webPropertyAdWordsLinks().insert(
accountId='XXXXXXXXXXXX',
webPropertyId='UA-XXXXXXXXXXXX-1',
body={"adWordsAccounts": [{"customerId": "xxx-yyy-zzzz"}],"name": "Name of the link"}).execute()
It is important to point out that when I use "Try this API", the option provided at the documentation webpage (see the screenshot), with exactly the same data I am able to link my google ads and analytics accounts.
Screenshot of try this API option
Any ideas?

API google analytics v3.0 : avec OAuth 2.0,

I'm trying to install but I get the following error:
400. That’s an error.
Error: redirect_uri_mismatch
Application: Google analitycs
You can email the developer of this application at: sextoysunivers#gmail.com
The redirect URI in the request: http://sextoysunivers.com/modules/gapi/oauth2callback.php did not match a registered redirect URI
I have tried for all shops tab, individually, with the number after the p in my google analytics browser, and with the UA code getting the same error.
You have to register the redirect_uri in the Google Developer Console. After you log in click on APIs & auth, then Credentials and enter your redirect_uri into the redirect_URIs text-area