googleads / google-ads-php

Google Ads API Client Library for PHP
https://developers.google.com/google-ads/api/docs/client-libs/php
Apache License 2.0
294 stars 262 forks source link

Google Ads failure details: authorization_error: The developer token is only approved for use with test accounts. To access non-test accounts, apply for Basic or Standard access. #896

Closed sandeepscet closed 1 year ago

sandeepscet commented 1 year ago

Your client library and Google Ads API versions:

Client library version: main Google Ads API version: V13 Your environment:

PHP Version 7.4.29 System Windows NT SANDIP 10.0 build 19045 (Windows 10) AMD64 protobuf : No grpc : Yes ( 1.43.0) The type of transport being used : grpc

Description of the bug:

Not able to get campaign details with the test account.

[2023-04-18T08:31:24.602255+02:00] google-ads.WARNING: Request made: Host: "[googleads.googleapis.com](http://googleads.googleapis.com/)", Method: "/google.ads.googleads.v13.services.GoogleAdsService/SearchStream", CustomerId: 1012152333, RequestId: "SlpcHJj4FGbR6fDnb_4QTA", IsFault: 1, FaultMessage: "["The developer token is only approved for use with test accounts. To access non-test accounts, apply for Basic or Standard access."]"  
[2023-04-18T08:31:24.603980+02:00] google-ads.NOTICE: Request
-------
Method Name: /google.ads.googleads.v13.services.GoogleAdsService/SearchStream
Host: [googleads.googleapis.com](http://googleads.googleapis.com/)
Headers: {
    "x-goog-api-client": "gl-php\/7.4.29 gccl\/19.0.0 gapic\/19.0.0 gax\/1.19.1 grpc\/1.43.0 rest\/1.19.1 pb\/+n",
    "x-goog-request-params": "customer_id=1012152333",
    "developer-token": "REDACTED"
}
Request: 
{"customerId":"1012152333","query":"SELECT [campaign.id](http://campaign.id/), [campaign.name](http://campaign.name/) FROM campaign ORDER BY [campaign.id](http://campaign.id/)"}

Response
-------
Headers: {
    "request-id": "SlpcHJj4FGbR6fDnb_4QTA",
    "date": "Tue, 18 Apr 2023 06:31:24 GMT",
    "alt-svc": "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000"
}

Fault
-------
Status code: 7
Details: The caller does not have permission
Failure: {"errors":[{"errorCode":{"authorizationError":"DEVELOPER_TOKEN_NOT_APPROVED"},"message":"The developer token is only approved for use with test accounts. To access non-test accounts, apply for Basic or Standard access."}],"requestId":"SlpcHJj4FGbR6fDnb_4QTA"}

Notes :

fiboknacky commented 1 year ago

Could you share the link to the forum issue you created? This is not related to the PHP library, so we need to follow up there. I'll help you facilitate that.

sandeepscet commented 1 year ago

https://groups.google.com/g/adwords-api/c/Wcm_m3bgCQ4

fiboknacky commented 1 year ago

Thanks. I'm sure they'll reply to you soon. They mentioned that you should communicate here in the case that the issue was related to the client library (e.g., if you cannot turn on logging), but for this case, it's related to the developer token.

fiboknacky commented 1 year ago

Seems the agent on the forum replied to you, so I'm closing this.