Re: Cant get API to do anything

2017-09-28 Thread TheAinz
Hi Swetha,

I've been through that again and recreated credentials. Running 
GetCampaigns.php now allows login but creates the following errors:

"# php GetCampaigns.php
PHP Fatal error:  SOAP-ERROR: Parsing WSDL: Couldn't load from 
'https://adwords.google.com/api/adwords/cm/v201708/CampaignService?wsdl' : 
failed to load external entity 
"https://adwords.google.com/api/adwords/cm/v201708/CampaignService?wsdl;
 in 
C:\xampp\htdocs\performance-leads\adwords-examples-30.0.0\vendor\googleads\googleads-php-lib\src\Google\AdsApi\Common\AdsSoapClient.php
 
on line 68
PHP Fatal error:  Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing 
WSDL: Couldn't load from 
'https://adwords.google.com/api/adwords/cm/v201708/CampaignService?wsdl' : 
failed to load external entity 
"https://adwords.google.com/api/adwords/cm/v201708/CampaignService?wsdl;
 in 
C:\xampp\htdocs\performance-leads\adwords-examples-30.0.0\vendor\googleads\googleads-php-lib\src\Google\AdsApi\Common\AdsSoapClient.php:68
Stack trace:
#0 
C:\xampp\htdocs\performance-leads\adwords-examples-30.0.0\vendor\googleads\googleads-php-lib\src\Google\AdsApi\Common\AdsSoapClient.php(68):
 
SoapClient->SoapClient('https://adwords...', Array)
#1 
C:\xampp\htdocs\performance-leads\adwords-examples-30.0.0\vendor\googleads\googleads-php-lib\src\Google\AdsApi\AdWords\v201708\cm\CampaignService.php(146):
 
Google\AdsApi\Common\AdsSoapClient->__construct('https://adwords...', Array)
#2 [internal function]: 
Google\AdsApi\AdWords\v201708\cm\CampaignService->__construct(Array)
#3 
C:\xampp\htdocs\performance-leads\adwords-examples-30.0.0\vendor\googleads\goog 
in 
C:\xampp\htdocs\performance-leads\adwords-examples-30.0.0\vendor\googleads\googleads-php-lib\src\Google\AdsApi\Common\AdsSoapClient.php
 
on line 68

Fatal error: Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing WSDL: 
Couldn't load from 
'https://adwords.google.com/api/adwords/cm/v201708/CampaignService?wsdl' : 
failed to load external entity 
"https://adwords.google.com/api/adwords/cm/v201708/CampaignService?wsdl;
 in 
C:\xampp\htdocs\performance-leads\adwords-examples-30.0.0\vendor\googleads\googleads-php-lib\src\Google\AdsApi\Common\AdsSoapClient.php:68
Stack trace:
#0 
C:\xampp\htdocs\performance-leads\adwords-examples-30.0.0\vendor\googleads\googleads-php-lib\src\Google\AdsApi\Common\AdsSoapClient.php(68):
 
SoapClient->SoapClient('https://adwords...', Array)
#1 
C:\xampp\htdocs\performance-leads\adwords-examples-30.0.0\vendor\googleads\googleads-php-lib\src\Google\AdsApi\AdWords\v201708\cm\CampaignService.php(146):
 
Google\AdsApi\Common\AdsSoapClient->__construct('https://adwords...', Array)
#2 [internal function]: 
Google\AdsApi\AdWords\v201708\cm\CampaignService->__construct(Array)
#3 
C:\xampp\htdocs\performance-leads\adwords-examples-30.0.0\vendor\googleads\goog 
in 
C:\xampp\htdocs\performance-leads\adwords-examples-30.0.0\vendor\googleads\googleads-php-lib\src\Google\AdsApi\Common\AdsSoapClient.php
 
on line 68

ainzclan@DESKTOP-4D4ICSK 
c:\xampp\htdocs\performance-leads\adwords-examples-30.0.0\examples\AdWords\v201708\BasicOperations"

Having read some similar posts I have tried to access 
https://adwords.google.com/api/adwords/cm/v201708/CampaignService?wsdl 
using Curl and it works fine.

Does this mean there is a SOAP set up issue on my machine? Any ideas how to 
identify and progress? 

Current PHP version: 7.1.9

Thanks Neil


On Thursday, 28 September 2017 18:13:33 UTC+1, Shwetha Vastrad (AdWords API 
Team) wrote:
>
> Hi,
>
> The unauthorized_client error usually occurs when you are using incorrect 
> OAuth2 credentials. Could you check if you have provided the correct 
> clientId, clientSecret and refreshToken? Could you try generating a new 
> refresh token by following the instructions provided here 
> 
> ? Could you also try the CURL request provided below and see if you are 
> able to generate the access tokens? That will help you confirm if your 
> OAuth2 credentials are valid or not.
>
> curl https://www.googleapis.com/oauth2/v4/token  \
> -d refresh_token=MCC_refresh_token  \
> -d client_id=your-client-id  \
> -d client_secret=your-client-secret  \
> -d grant_type=refresh_token
>
> Regards,
> Shwetha, AdWords API Team.
>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and Google+:
https://googleadsdeveloper.blogspot.com/
https://plus.google.com/+GoogleAdsDevelopers/posts
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords 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 

Re: Cant get API to do anything

2017-09-28 Thread TheAinz
Hi again,

Knack has helped me get the library working on my local machine. I now get 
error messages. I now have this error, despite seemingly following the 
OAuth instructions and get the refresh token etc.

"# php GetCampaigns.php
PHP Fatal error:  Uncaught GuzzleHttp\Exception\ClientException: Client 
error: `POST https://www.googleapis.com/oauth2/v4/token` resulted in a `401 
Unauthorized` response:
{
 "error": "unauthorized_client",
 "error_description": "Unauthorized"
}

 in 
C:\xampp\htdocs\performance-leads\adwords-examples-30.0.0\vendor\guzzlehttp\guzzle\src\Exception\RequestException.php:113
Stack trace:
#0 
C:\xampp\htdocs\performance-leads\adwords-examples-30.0.0\vendor\guzzlehttp\guzzle\src\Middleware.php(65):
 
GuzzleHttp\Exception\RequestException::create(Object(GuzzleHttp\Psr7\Request), 
Object(GuzzleHttp\Psr7\Response))
#1 
C:\xampp\htdocs\performance-leads\adwords-examples-30.0.0\vendor\guzzlehttp\promises\src\Promise.php(203):
 
GuzzleHttp\Middleware::GuzzleHttp\{closure}(Object(GuzzleHttp\Psr7\Response))
#2 
C:\xampp\htdocs\performance-leads\adwords-examples-30.0.0\vendor\guzzlehttp\promises\src\Promise.php(156):
 
GuzzleHttp\Promise\Promise::callHandler(1, 
Object(GuzzleHttp\Psr7\Response), Array)
#3 C:\xampp\htdocs\performance-leads\adwords-exampl in 
C:\xampp\htdocs\performance-leads\adwords-examples-30.0.0\vendor\guzzlehttp\guzzle\src\Exception\RequestException.php
 
on line 113

Fatal error: Uncaught GuzzleHttp\Exception\ClientException: Client error: 
`POST https://www.googleapis.com/oauth2/v4/token` resulted in a `401 
Unauthorized` response:
{
 "error": "unauthorized_client",
 "error_description": "Unauthorized"
}

 in 
C:\xampp\htdocs\performance-leads\adwords-examples-30.0.0\vendor\guzzlehttp\guzzle\src\Exception\RequestException.php:113
Stack trace:
#0 
C:\xampp\htdocs\performance-leads\adwords-examples-30.0.0\vendor\guzzlehttp\guzzle\src\Middleware.php(65):
 
GuzzleHttp\Exception\RequestException::create(Object(GuzzleHttp\Psr7\Request), 
Object(GuzzleHttp\Psr7\Response))
#1 
C:\xampp\htdocs\performance-leads\adwords-examples-30.0.0\vendor\guzzlehttp\promises\src\Promise.php(203):
 
GuzzleHttp\Middleware::GuzzleHttp\{closure}(Object(GuzzleHttp\Psr7\Response))
#2 
C:\xampp\htdocs\performance-leads\adwords-examples-30.0.0\vendor\guzzlehttp\promises\src\Promise.php(156):
 
GuzzleHttp\Promise\Promise::callHandler(1, 
Object(GuzzleHttp\Psr7\Response), Array)
#3 C:\xampp\htdocs\performance-leads\adwords-exampl in 
C:\xampp\htdocs\performance-leads\adwords-examples-30.0.0\vendor\guzzlehttp\guzzle\src\Exception\RequestException.php
 
on line 113

ainzclan@DESKTOP-4D4ICSK 
c:\xampp\htdocs\performance-leads\adwords-examples-30.0.0\examples\AdWords\v201708\BasicOperations"

Any ideas what I am doing wrong? Thanks, Neil

On Thursday, 21 September 2017 16:27:02 UTC+1, Shwetha Vastrad (AdWords API 
Team) wrote:
>
> Hi,
>
> Could you try out the suggestions in this post 
> 
>  to 
> run the examples in a browser? Could you also try out the examples without 
> any modification from the command line and let me know if logs are 
> generated? Since you have set the log level to INFO, for successful API 
> requests, only a one-line summary is logged. Could you change the logging 
> level to DEBUG and send over any log files generated when you run the 
> GetCampaigns.php example? I would also suggest that you create a post on 
> the library's issue tracker so the library owners can help you out. 
>
> Regards,
> Shwetha, AdWords API Team.
>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and Google+:
https://googleadsdeveloper.blogspot.com/
https://plus.google.com/+GoogleAdsDevelopers/posts
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords 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 Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
Visit this group at https://groups.google.com/group/adwords-api.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/c94303c2-e4d3-4cfc-87b3-5fb043b276fd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Cant get API to do anything

2017-09-21 Thread TheAinz
Hi Shwetha,

The browser post refers to what I used previously with the old library (pre 
25.0.0). The query is about whether same can be done with the new library? 
I can't locate in the code where the browser is prevented at the moment.

I've been running the GetCampaigns.php file from the command line 
previously without modifications and get nothing. I've now changed the 
logging level to DEBUG and tried again as you suggest. Same issue. Nothing 
happens, no feedback. Still stumped :-)

I'll post on the library issue tracker as you suggest. 

Thanks for your help.

Neil

On Thursday, 21 September 2017 16:27:02 UTC+1, Shwetha Vastrad (AdWords API 
Team) wrote:
>
> Hi,
>
> Could you try out the suggestions in this post 
> 
>  to 
> run the examples in a browser? Could you also try out the examples without 
> any modification from the command line and let me know if logs are 
> generated? Since you have set the log level to INFO, for successful API 
> requests, only a one-line summary is logged. Could you change the logging 
> level to DEBUG and send over any log files generated when you run the 
> GetCampaigns.php example? I would also suggest that you create a post on 
> the library's issue tracker so the library owners can help you out. 
>
> Regards,
> Shwetha, AdWords API Team.
>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and Google+:
https://googleadsdeveloper.blogspot.com/
https://plus.google.com/+GoogleAdsDevelopers/posts
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords 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 Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
Visit this group at https://groups.google.com/group/adwords-api.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/077de510-b39b-4588-bec2-55a458d454b0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Cant get API to do anything

2017-09-21 Thread TheAinz
Thanks Shwetha,

I know you have set them up for command line use. This is what I am doing 
now but still the result is nothing. So I have 2 queries: 

1) You used to be able to run in a browser by commenting out the following 
code - Is it still possible? Where do I find the code in the new files pls?

// Don’t run the example if the file is being included.
if (__FILE__ != realpath($_SERVER[‘PHP_SELF’])) {
return;
} 

2) The main problem is that when running from the command line nothing 
happens. I've had logging enabled:

[LOGGING]
; Optional logging settings.
 soapLogFilePath = "/home/performa/public_html/soap.log"
 soapLogLevel = "INFO"
 reportDownloaderLogFilePath = 
"/home/performa/public_html/report-downloader.log"
 reportDownloaderLogLevel = "INFO"
 batchJobsUtilLogFilePath = "/home/performa/public_html/bjutil.log"
 batchJobsUtilLogLevel = "INFO"
 
No logs created tho.

I'm using the client account ID not the MCC account. The campaigns are 
normal text ads - I've used the API before with no problems, but not since 
the re-write.

So the position is, I run the GetCampaigns.php file from the command line. 
Nothing happens, just back to the $ prompt. No other info. No soap.log 
content to refer to. No indication at all of why it won't work.

I am wondering  per my initial post if the location of the example files 
relative to the library and the new namespace definitions is causing it to 
fail. If I comment out the namespace line I can get the GetCampaigns.php 
file to echo "hello". If  I uncomment nothing happens. I can't help 
wondering why composer.phar doesn't download the example files in the right 
place so testing can be sure to work as part of the package.

Any ideas welcome - I'm stumped with no feedback on why it fails. Thanks.




On Wednesday, 20 September 2017 19:17:09 UTC+1, Shwetha Vastrad (AdWords 
API Team) wrote:
>
> Hi Neil, 
>
> All our examples are meant to be run via the command line and not as a 
> webpage. Could you check if the clientCustomerId in the configuration file 
> is that of an AdWords manager account? Since campaigns are associated with 
> AdWords accounts, not manager accounts, you'll not be able to get any 
> campaigns if you target the manager account. If your account has only Video 
> Campaigns, you'll not be able to use CampaignService to retrieve them 
> because Video Campaigns are not supported in AdWords API services at the 
> moment. They are only supported in AdWords API reports 
> . You 
> can enable logging by following the instructions provided here 
> . If you 
> encounter any error, let me know and I can help you out. 
>
> Regards,
> Shwetha, AdWords API Team.
>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and Google+:
https://googleadsdeveloper.blogspot.com/
https://plus.google.com/+GoogleAdsDevelopers/posts
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords 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 Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
Visit this group at https://groups.google.com/group/adwords-api.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/600895be-c4c0-4a13-ac19-72ac01fa873c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Cant get API to do anything

2017-09-20 Thread TheAinz
Hi,

I've been trying to set the API up on a new server with no success. I've 
watched the videos, read the help, readme etc. I've downloaded the php 
client library. I've downloaded the examples. I've got the client ID, 
secret etc. refresh token all sorted. 

I've set up and rung the API once before a few years ago, and had similar 
issues, but got it working eventually after a lot of reading around online.

This time, after 3 days, I'm asking for help. There are a lot of people who 
seem to report similar issues, but the threads are only progressed by 
sending logs in privately.

I've just had one last try using 
this: 
https://github.com/googleads/googleads-php-lib/blob/master/README.md#getting-started

When I get to the last stage and run this: php 
examples/AdWords/v201705/BasicOperations/GetCampaigns.php I get nothing. No 
errors, no logging of what happened. Just nothing. I'm stumped.

If I edit the GetCampaigns.php file and remove everything but just echo a 
statement "hello" the file runs and echos "hello".

If I go down the file line by line then un-commenting namespace 
Google\AdsApi\Examples\AdWords\v201708\BasicOperations;  immediately 
prevents anything from happening.

Is it related to where the examples are downloaded relative to the client 
library?

Any ideas on how I can progress this? I'm stumped as I say. Any help 
appreciated.

Also, I used to run these files in a browser by removing the section in 
each example file that prevented this. Is there a similar workaround in the 
latest release? 

Thanks,

Neil

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and Google+:
https://googleadsdeveloper.blogspot.com/
https://plus.google.com/+GoogleAdsDevelopers/posts
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords 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 Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
Visit this group at https://groups.google.com/group/adwords-api.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/a92b025a-2cbd-42ed-b5c6-bb2982f9b5cf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Where do I get a report id from?

2012-08-03 Thread TheAinz
Thanks Dorian,
That clears it up for me - I'm looking for the wrong thing. I took the 
instructions to mean that I had to create the report first (in the web 
interface) then just use the API to download it using the id.
I'll check the docs again and read up on the ad hoc service you mention.
Thanks again,
Neil 

On Friday, 3 August 2012 12:30:26 UTC+1, Dorian Kind wrote:

 Hi,

 it's only possible to download reports created (previously, as it's 
 read-only now) via the API; so even if you found the report definition ID 
 in the web interface, you wouldn't be able to download it. The solution is 
 really just to use the Ad Hoc reporting service, I can't think of any 
 functionality that is covered by the ReportDefinitionService but not 
 possible with Ad Hoc reports.

 Hope this helps, cheers
 Dorian

 On Thursday, August 2, 2012 3:02:47 PM UTC+2, TheAinz wrote:

 Apologies if this is covered anywhere, but I can't find anything on it 
 despite searching for ages.

 I'm trying to use DownloadDefinedReport.php from v201206. If I understand 
 right, you can only download reports now not define them. Line 40 and 41 
 of  DownloadDefinedReport.php requests the id of a defined report:

 // Enter parameters required by the code example.
 $reportDefinitionId = 'INSERT_REPORT_DEFINITION_ID_HERE';

 My question is where do you get the report definition id from? I can 
 locate campaign id's from the url fragment when in the adwords interface in 
 a browser, but there's nothing similar in the report interface that I can 
 spot. 

 I have tried to use GetDefinedReports.php to get a list of reports, but 
 get this error despite using the most recent version of the php library 
 (downloaded today):

 *Fatal error*: Class 'ReportDefinitionSelector' not found in 

 Have run out of ideas now. Thanks for any help.



-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
http://adwordsapi.blogspot.com
http://groups.google.com/group/adwords-api
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups AdWords 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


Where do I get a report id from?

2012-08-02 Thread TheAinz
Apologies if this is covered anywhere, but I can't find anything on it 
despite searching for ages.

I'm trying to use DownloadDefinedReport.php from v201206. If I understand 
right, you can only download reports now not define them. Line 40 and 41 
of  DownloadDefinedReport.php requests the id of a defined report:

// Enter parameters required by the code example.
$reportDefinitionId = 'INSERT_REPORT_DEFINITION_ID_HERE';

My question is where do you get the report definition id from? I can locate 
campaign id's from the url fragment when in the adwords interface in a 
browser, but there's nothing similar in the report interface that I can 
spot. 

I have tried to use GetDefinedReports.php to get a list of reports, but get 
this error despite using the most recent version of the php library 
(downloaded today):

*Fatal error*: Class 'ReportDefinitionSelector' not found in 

Have run out of ideas now. Thanks for any help.

-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
http://adwordsapi.blogspot.com
http://groups.google.com/group/adwords-api
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups AdWords 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