Developer
Developer

Reputation: 2895

merchantapi.googleapis Error in query: invalid table name 'ProductPerformanceView' in FROM clause

I send request to API

https://developers.google.com/merchant/api/guides/reports/quickstart?hl=pl

 curl -X POST \
  'https://merchantapi.googleapis.com/reports/v1beta/accounts/{merchantId}/reports:search' \
  -H 'Authorization: Bearer $token' \
  -H 'Content-Type: application/json' \
  -d '{
    "query" : "SELECT marketingMethod, offerId, impressions, clicks, clickThroughRate FROM ProductPerformanceView WHERE date BETWEEN '\''2024-09-01'\'' AND '\''2024-09-30'\''"
  }'

and get response :

 Warn: Response: {

        "error": {

          "code": 400,

          "message": "[query] Error in query: invalid table name 'ProductPerformanceView' in FROM clause",

          "status": "INVALID_ARGUMENT",

          "details": [

            {

              "@type": "type.googleapis.com/google.rpc.ErrorInfo",

              "reason": "invalid",

              "domain": "global"

            }

          ]

        }

      }

where is my error?

Upvotes: 1

Views: 33

Answers (2)

ddofborg
ddofborg

Reputation: 2183

At the moment the docs from content api are more accurate: https://developers.google.com/shopping-content/guides/reports/fields The beta documentation for reports is not valid.

Upvotes: 1

lisa p.
lisa p.

Reputation: 2158

Please try your query again with product_performance_view as the table name.

All field and table names should be in snake case. It seems like the guides will be updated soon.

Upvotes: 1

Related Questions