Re: Problem to getting the GetCampaign.php

2020-12-07 Thread Nouman ali
Now i am facing the problem that is how i solve this problem how can i 
create text account for develper token.

[2020-12-07T18:53:47.912815+01:00] google-ads.WARNING: Request made: Host: 
"googleads.googleapis.com", Method: "/google.ad
s.googleads.v6.services.GoogleAdsService/SearchStream", CustomerId: 
4223007272, RequestId: "tV8e7h2QeMOHlJO2wz2xYg", IsFau
lt: 1, FaultMessage: "["The developer token is not approved. Non-approved 
developer tokens can only be used with test acco
unts."]"
[2020-12-07T18:53:47.931769+01:00] google-ads.NOTICE: Request
---
Method Name: /google.ads.googleads.v6.services.GoogleAdsService/SearchStream
Host: googleads.googleapis.com
Headers: {
"x-goog-api-client": "gl-php\/7.2.32 gapic\/ gax\/1.6.0 grpc\/1.34.0",
"x-goog-request-params": "customer_id=4223007272",
"developer-token": "REDACTED"
}
Request:
{"customerId":"4223007272","query":"SELECT campaign.id, campaign.name FROM 
campaign ORDER BY campaign.id"}

Response
---
Headers: {
"request-id": "tV8e7h2QeMOHlJO2wz2xYg",
"date": "Mon, 07 Dec 2020 17:54:07 GMT",
"alt-svc": "h3-29=\":443\"; ma=2592000,h3-T051=\":443\"; 
ma=2592000,h3-Q050=\":443\"; ma=2592000,h3-Q046=\":443\"; ma=
2592000,h3-Q043=\":443\"; ma=2592000,quic=\":443\"; ma=2592000; v=\"46,43\""
}

Fault
---
Status code: 7
Details: The caller does not have permission
Failure: 
{"errors":[{"errorCode":{"authorizationError":"DEVELOPER_TOKEN_NOT_APPROVED"},"message":"The
 
developer token is n
ot approved. Non-approved developer tokens can only be used with test 
accounts."}]}
Request with ID 'tV8e7h2QeMOHlJO2wz2xYg' has failed.
Google Ads failure details:
authorization_error: The developer token is not approved. 
Non-approved developer tokens can only be used with test
 accounts.

On Monday, December 7, 2020 at 5:12:11 PM UTC+5 Nouman ali wrote:

> Thanks for the helping. Now i and getting this error
> PHP Fatal error:  Uncaught GuzzleHttp\Exception\ClientException: Client 
> error: `POST https://oauth2.googleapis.com/token` 
> 
> resulted in a `401 Unauthorized` response:
> {
>   "error": "unauthorized_client",
>   "error_description": "Unauthorized"
> }
>  in 
> D:\xampp\htdocs\google-ads-php\vendor\guzzlehttp\guzzle\src\Exception\RequestException.php:113
> Stack trace:
> #0 
> D:\xampp\htdocs\google-ads-php\vendor\guzzlehttp\guzzle\src\Middleware.php(65):
>  
> GuzzleHttp\Exception\RequestException::
> create(Object(GuzzleHttp\Psr7\Request), Object(GuzzleHttp\Psr7\Response))
> #1 
> D:\xampp\htdocs\google-ads-php\vendor\guzzlehttp\promises\src\Promise.php(204):
>  
> GuzzleHttp\Middleware::GuzzleHttp\{clos
> ure}(Object(GuzzleHttp\Psr7\Response))
> #2 
> D:\xampp\htdocs\google-ads-php\vendor\guzzlehttp\promises\src\Promise.php(153):
>  
> GuzzleHttp\Promise\Promise::callHandler
> (1, Object(GuzzleHttp\Psr7\Response), NULL)
> #3 
> D:\xampp\htdocs\google-ads-php\vendor\guzzlehttp\promises\src\TaskQueue.php(48):
>  
> GuzzleHttp\Promise\Promise::GuzzleHttp
> \Promise\{closure}()
> #4 D:\xampp\htdocs\goog in 
> D:\xampp\htdocs\google-ads-php\vendor\guzzlehttp\guzzle\src\Exception\RequestException.php
>  
> on l
> ine 113
>
> Fatal error: Uncaught GuzzleHttp\Exception\ClientException: Client error: 
> `POST https://oauth2.googleapis.com/token` 
>  resul
> ted in a `401 Unauthorized` response:
> {
>   "error": "unauthorized_client",
>   "error_description": "Unauthorized"
> }
>  in 
> D:\xampp\htdocs\google-ads-php\vendor\guzzlehttp\guzzle\src\Exception\RequestException.php:113
> Stack trace:
> #0 
> D:\xampp\htdocs\google-ads-php\vendor\guzzlehttp\guzzle\src\Middleware.php(65):
>  
> GuzzleHttp\Exception\RequestException::
> create(Object(GuzzleHttp\Psr7\Request), Object(GuzzleHttp\Psr7\Response))
> #1 
> D:\xampp\htdocs\google-ads-php\vendor\guzzlehttp\promises\src\Promise.php(204):
>  
> GuzzleHttp\Middleware::GuzzleHttp\{clos
> ure}(Object(GuzzleHttp\Psr7\Response))
> #2 
> D:\xampp\htdocs\google-ads-php\vendor\guzzlehttp\promises\src\Promise.php(153):
>  
> GuzzleHttp\Promise\Promise::callHandler
> (1, Object(GuzzleHttp\Psr7\Response), NULL)
> #3 
> D:\xampp\htdocs\google-ads-php\vendor\guzzlehttp\promises\src\TaskQueue.php(48):
>  
> GuzzleHttp\Promise\Promise::GuzzleHttp
> \Promise\{closure}()
> #4 D:\xampp\htdocs\goog in 
> D:\xampp\htdocs\google-ads-php\vendor\guzzlehttp\guzzle\src\Exception\RequestException.php
>  
> on l
> ine 113
>
> On Monday, December 7, 2020 at 1:53:18 PM UTC+5 adsapiforumadvisor wrote:
>
>> Hi Nouman,
>>
>> Thanks for posting your concern.
>>
>> It appears that the service account and installed / web application are 
>> both configured in your PHP client library. This is the possible reason why 
>> the issue occurred as there is a validation in PHP client library (provided 
>> below) that when service account and installed / web application are both 
>> configured, it will throw the said error.
>>
>> if (($this->json

Re: Problem to getting the GetCampaign.php

2020-12-07 Thread Nouman ali
Thanks for the helping. Now i and getting this error
PHP Fatal error:  Uncaught GuzzleHttp\Exception\ClientException: Client 
error: `POST https://oauth2.googleapis.com/token`
resulted in a `401 Unauthorized` response:
{
  "error": "unauthorized_client",
  "error_description": "Unauthorized"
}
 in 
D:\xampp\htdocs\google-ads-php\vendor\guzzlehttp\guzzle\src\Exception\RequestException.php:113
Stack trace:
#0 
D:\xampp\htdocs\google-ads-php\vendor\guzzlehttp\guzzle\src\Middleware.php(65): 
GuzzleHttp\Exception\RequestException::
create(Object(GuzzleHttp\Psr7\Request), Object(GuzzleHttp\Psr7\Response))
#1 
D:\xampp\htdocs\google-ads-php\vendor\guzzlehttp\promises\src\Promise.php(204): 
GuzzleHttp\Middleware::GuzzleHttp\{clos
ure}(Object(GuzzleHttp\Psr7\Response))
#2 
D:\xampp\htdocs\google-ads-php\vendor\guzzlehttp\promises\src\Promise.php(153): 
GuzzleHttp\Promise\Promise::callHandler
(1, Object(GuzzleHttp\Psr7\Response), NULL)
#3 
D:\xampp\htdocs\google-ads-php\vendor\guzzlehttp\promises\src\TaskQueue.php(48):
 
GuzzleHttp\Promise\Promise::GuzzleHttp
\Promise\{closure}()
#4 D:\xampp\htdocs\goog in 
D:\xampp\htdocs\google-ads-php\vendor\guzzlehttp\guzzle\src\Exception\RequestException.php
 
on l
ine 113

Fatal error: Uncaught GuzzleHttp\Exception\ClientException: Client error: 
`POST https://oauth2.googleapis.com/token` resul
ted in a `401 Unauthorized` response:
{
  "error": "unauthorized_client",
  "error_description": "Unauthorized"
}
 in 
D:\xampp\htdocs\google-ads-php\vendor\guzzlehttp\guzzle\src\Exception\RequestException.php:113
Stack trace:
#0 
D:\xampp\htdocs\google-ads-php\vendor\guzzlehttp\guzzle\src\Middleware.php(65): 
GuzzleHttp\Exception\RequestException::
create(Object(GuzzleHttp\Psr7\Request), Object(GuzzleHttp\Psr7\Response))
#1 
D:\xampp\htdocs\google-ads-php\vendor\guzzlehttp\promises\src\Promise.php(204): 
GuzzleHttp\Middleware::GuzzleHttp\{clos
ure}(Object(GuzzleHttp\Psr7\Response))
#2 
D:\xampp\htdocs\google-ads-php\vendor\guzzlehttp\promises\src\Promise.php(153): 
GuzzleHttp\Promise\Promise::callHandler
(1, Object(GuzzleHttp\Psr7\Response), NULL)
#3 
D:\xampp\htdocs\google-ads-php\vendor\guzzlehttp\promises\src\TaskQueue.php(48):
 
GuzzleHttp\Promise\Promise::GuzzleHttp
\Promise\{closure}()
#4 D:\xampp\htdocs\goog in 
D:\xampp\htdocs\google-ads-php\vendor\guzzlehttp\guzzle\src\Exception\RequestException.php
 
on l
ine 113

On Monday, December 7, 2020 at 1:53:18 PM UTC+5 adsapiforumadvisor wrote:

> Hi Nouman,
>
> Thanks for posting your concern.
>
> It appears that the service account and installed / web application are 
> both configured in your PHP client library. This is the possible reason why 
> the issue occurred as there is a validation in PHP client library (provided 
> below) that when service account and installed / web application are both 
> configured, it will throw the said error.
>
> if (($this->jsonKeyFilePath !== null || $this->scopes !== null)
> && ($this->clientId !== null || $this->clientSecret !== null
> || $this->refreshToken !== null)) {
> throw new InvalidArgumentException(
> 'Cannot have both service account '
> . 'flow and installed/web application flow credential 
> values set.'
> );
> }
>
> With this, since you want to configure the installed application 
> ,
>  
> then you may undo the configuration of service account 
> 
> .
>
> Let me know how it goes after trying the provided suggestion.
>
> Regards,
> [image: Google Logo] 
> Ernie John Blanca Tacata 
> Google Ads API Team 
>   
>
> ref:_00D1U1174p._5004Q28mwoV:ref
>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog:
https://googleadsdeveloper.blogspot.com/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API and Google Ads API Forum" group.
To post to this group, send email to adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"AdWords API and Google Ads API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/038c38d9-770b-4f33-a90d-bd024fdec79fn%40googlegroups.com.


RE: Problem to getting the GetCampaign.php

2020-12-07 Thread Google Ads API Forum Advisor Prod
Hi Nouman,

Thanks for posting your concern.

It appears that the service account and installed / web application are both 
configured in your PHP client library. This is the possible reason why the 
issue occurred as there is a validation in PHP client library (provided below) 
that when service account and installed / web application are both configured, 
it will throw the said error.

if (($this->jsonKeyFilePath !== null || $this->scopes !== null)
&& ($this->clientId !== null || $this->clientSecret !== null
|| $this->refreshToken !== null)) {
throw new InvalidArgumentException(
'Cannot have both service account '
. 'flow and installed/web application flow credential values set.'
);
}

With this, since you want to configure the installed application, then you may 
undo the configuration of service account.

Let me know how it goes after trying the provided suggestion.

Regards,

Ernie John Blanca Tacata
Google Ads API Team
ref:_00D1U1174p._5004Q28mwoV:ref

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog:
https://googleadsdeveloper.blogspot.com/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API and Google Ads API Forum" group.
To post to this group, send email to adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"AdWords API and Google Ads API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/7BKXA0QKYOO700lsQ8ms6HQYCYpOqfotO23Q%40sfdc.net.


Problem to getting the GetCampaign.php

2020-12-03 Thread Nouman ali
PHP Fatal error:  Uncaught InvalidArgumentException: Cannot have both 
service account flow and installed/web application f
low credential values set.


we are facing this error what is the solution if this error please give us 
some sort of help that we will fix this issue
I have already create google token and client secret, client id and 
customer id and also generate the refresh token. But when we run the 
GetCampaigns.php on terminal we get this error. Please helm for this 
solution

PHP Fatal error:  Uncaught InvalidArgumentException: Cannot have both 
service account flow and installed/web application f
low credential values set. in 
D:\xampp\htdocs\adword\vendor\googleads\googleads-php-lib\src\Google\AdsApi\Common\OAuth2Tok
enBuilder.php:209
Stack trace:
#0 
D:\xampp\htdocs\adword\vendor\googleads\googleads-php-lib\src\Google\AdsApi\Common\OAuth2TokenBuilder.php(173):
 
Google\
AdsApi\Common\OAuth2TokenBuilder->validate()
#1 
D:\xampp\htdocs\adword\examples\AdWords\v201809\BasicOperations\GetCampaigns.php(82):
 
Google\AdsApi\Common\OAuth2TokenB
uilder->build()
#2 
D:\xampp\htdocs\adword\examples\AdWords\v201809\BasicOperations\GetCampaigns.php(91):
 
Google\AdsApi\Examples\AdWords\v2
01809\BasicOperations\GetCampaigns::main()
#3 {main}
  thrown in 
D:\xampp\htdocs\adword\vendor\googleads\googleads-php-lib\src\Google\AdsApi\Common\OAuth2TokenBuilder.php
 
on l
ine 209

Fatal error: Uncaught InvalidArgumentException: Cannot have both service 
account flow and installed/web application flow c
redential values set. in 
D:\xampp\htdocs\adword\vendor\googleads\googleads-php-lib\src\Google\AdsApi\Common\OAuth2TokenBui
lder.php:209
Stack trace:
#0 
D:\xampp\htdocs\adword\vendor\googleads\googleads-php-lib\src\Google\AdsApi\Common\OAuth2TokenBuilder.php(173):
 
Google\
AdsApi\Common\OAuth2TokenBuilder->validate()
#1 
D:\xampp\htdocs\adword\examples\AdWords\v201809\BasicOperations\GetCampaigns.php(82):
 
Google\AdsApi\Common\OAuth2TokenB
uilder->build()
#2 
D:\xampp\htdocs\adword\examples\AdWords\v201809\BasicOperations\GetCampaigns.php(91):
 
Google\AdsApi\Examples\AdWords\v2
01809\BasicOperations\GetCampaigns::main()

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog:
https://googleadsdeveloper.blogspot.com/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API and Google Ads API Forum" group.
To post to this group, send email to adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"AdWords API and Google Ads API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/22116b0f-12a2-43d1-9d30-a30fc8fcf04cn%40googlegroups.com.