我正在使用谷歌-ads-api。我的目标是为特定的竞选获得印象和点击。这就是我所做的事。
account
当我运行代码时,它会给我带来错误。
Google\ApiCore\ApiException {“消息”:“调用方没有权限”,“代码”:7,“状态”:"PERMISSION_DENIED",“详细信息”:[{ "@type":PERMISSION_DENIED“错误”:{ "errorCode":{ "authorizationError":"USER_PERMISSION_DENIED“},"message":”用户没有访问客户的权限“。注意:如果您正在访问客户端客户,经理的客户id必须设置在‘登录-客户-id’标题中。见https://developers.google.com/google-ads/api/docs/concepts/call-structure#cid“},"requestId":"pKHgfIr99F5XApaPFBnrLQ”}}
我的adsapi.ini
[GOOGLE_ADS]
; Required Google Ads properties.
name = "Google Ads"
developerToken = "*****-*******_*"
; Optional. Set a friendly application name identifier.
userAgent = "Scraper"
; Optional additional AdWords API settings.
; endpoint = "https://adwords.google.com/"
; isPartialFailure = false
; Optional setting for utility usage tracking in the user agent in requests.
; Defaults to true.
; includeUtilitiesInUserAgent = true
[ADWORDS_REPORTING]
; Optional reporting settings.
; isSkipReportHeader = false
; isSkipColumnHeader = false
; isSkipReportSummary = false
; isUseRawEnumValues = false
[OAUTH2]
; Required OAuth2 credentials. Uncomment and fill in the values for the
; appropriate flow based on your use case. See the README for guidance:
; https://github.com/googleads/googleads-php-lib/blob/master/README.md#getting-started
; For installed application or web application flow.
clientId = "**********************"
clientSecret = "********************"
refreshToken = "***********************"
For service account flow.
; jsonKeyFilePath = "INSERT_ABSOLUTE_PATH_TO_OAUTH2_JSON_KEY_FILE_HERE"
; scopes = "https://www.googleapis.com/auth/adwords"
; impersonatedEmail = "INSERT_EMAIL_OF_ACCOUNT_TO_IMPERSONATE_HERE"
[SOAP]
; Optional SOAP settings. See SoapSettingsBuilder.php for more information.
; compressionLevel = <COMPRESSION_LEVEL>
; wsdlCache = <WSDL_CACHE>
[PROXY]
; Optional proxy settings to be used by SOAP requests.
; host = "<HOST>"
; port = <PORT>
; user = "<USER>"
; password = "<PASSWORD>"
[LOGGING]
; Optional logging settings.
; soapLogFilePath = "/soap.log"
; soapLogLevel = "INFO"
; reportDownloaderLogFilePath = "path/to/your/report-downloader.log"
; reportDownloaderLogLevel = "INFO"
; batchJobsUtilLogFilePath = "path/to/your/bjutil.log"
; batchJobsUtilLogLevel = "INFO"发布于 2022-07-13 14:54:23
如果您正在访问客户端客户,经理的客户id必须设置在“登录-客户-id”标题中。请参阅https://developers.google.com/google-ads/api/docs/concepts/call-structure#cid
https://stackoverflow.com/questions/70874269
复制相似问题