Does Pipedream Support Google OpenAuth2.0 for Google Merchant Center?

This topic was automatically generated from Slack. You can find the original thread here.

does pipedream support google openauth2.0 for Google Merchant Center?

Pipedream supports OAuth 2.0 for Google services, but I don’t see specific support for Google Merchant Center in my sources. You can still use the OAuth access token for Google services to make API requests to Google Merchant Center if it uses the same authentication method. Here’s an example of how to use the access token in a Pipedream component: import { axios } from "@pipedream/platform"; export default defineComponent({ props: { google: { type: "app", app: "google", }, }, async run({ steps, $ }) { // Replace the URL with the Google Merchant Center API endpoint you want to call const url = "https://example.com/google-merchant-center-api-endpoint"; return await axios($, { url: url, headers: { Authorization: `Bearer ${this.google.$auth.oauth_access_token}`, }, }); }, }); Replace the url variable with the Google Merchant Center API endpoint you want to call. If you need a specific integration, you can submit a request at New Pipedream Integration Request.

I wanted to post the following

https://shoppingcontent.googleapis.com/content/v2.1/{{merchantCenterID}}/products/{{productID}}/localinventory
{
“storeCode”: “LR”,
“quantity”: 23
}

To make a POST request to the Google Merchant Center API with the provided data, you can use the following Pipedream component code: import { axios } from "@pipedream/platform"; export default defineComponent({ props: { google: { type: "app", app: "google", }, merchantCenterID: { type: "string", label: "Merchant Center ID", }, productID: { type: "string", label: "Product ID", }, storeCode: { type: "string", label: "Store Code", }, quantity: { type: "integer", label: "Quantity", }, }, async run({ $ }) { const url = `https://shoppingcontent.googleapis.com/content/v2.1/${this.merchantCenterID}/products/${this.productID}/localinventory`; const data = { storeCode: this.storeCode, quantity: this.quantity, }; return await axios($, { method: "POST", url: url, headers: { Authorization: `Bearer ${this.google.$auth.oauth_access_token}`, "Content-Type": "application/json", }, data: data, }); }, }); Replace the merchantCenterID, productID, storeCode, and quantity props with the appropriate values. This component will make a POST request to the specified Google Merchant Center API endpoint with the provided data.

I got this

{“error”:{“code”:403,“message”:“Request had insufficient authentication scopes.”,“errors”:[{“message”:“Insufficient Permission”,“domain”:“global”,“reason”:“insufficientPermissions”}],“status”:“PERMISSION_DENIED”,“details”:[{“@type”:“type.googleapis.com/google.rpc.ErrorInfo”,“reason”:“ACCESS_TOKEN_SCOPE_INSUFFICIENT”,“domain”:“googleapis.com”,“metadata”:{“service”:“shoppingcontent.googleapis.com”,“method”:"ads.shopping.contentapi.proto.frontend.v2p1.ContentLocalinventrt

It looks like the OAuth scopes provided by Pipedream for Google services do not include the required scope for accessing the Google Merchant Center API. To resolve this issue, you’ll need to request additional OAuth scopes when setting up the Google app in Pipedream. Unfortunately, I don’t have the exact scope required for the Google Merchant Center API in my sources. You should refer to the Google Merchant Center API documentation to find the necessary scope and include it when setting up the Google app in Pipedream. Once you have the required scope, you can follow the instructions in this guide to request additional OAuth scopes: https://pipedream.com/docs/apps/guide/requesting-additional-oauth-scopes/ After you’ve added the required scope and re-authenticated your Google app in Pipedream, you should be able to access the Google Merchant Center API without the “insufficient authentication scopes” error.

Thank link was broken?

Apologies for the broken link. It seems I provided an incorrect link earlier. Unfortunately, I don’t have a specific guide on requesting additional OAuth scopes for Pipedream. However, you can still submit a request for a new integration or an update to the existing Google integration with the required OAuth scope at New Pipedream Integration Request. Pipedream team will review the request and may update the integration accordingly.