Issues running GetRefreshToken.php

2013-08-20 Thread Alan Coleman
Hello everyone,

I'm trying to get hold of a refresh_token for my auth.ini file

I understand from the 
guidethat I need 
to run GetRefreshToken.php, however there doesn't seem to be 
much advice on actually *how* to run this file.

At the moment I'm running the file through the command line locally like 
this: . \examples\adwords\Auth>php GetRefreshToken.php

I'm receiving a PHP Catchable Fatal Error.

Am I running this GetRefreshToken in the right place? Do I need to carry 
arguments across?

Any help would be appreciated.

Many thanks 

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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

--- 
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.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Issues running GetRefreshToken.php

2013-08-20 Thread Ewan Heming
Hi Alan,

What's the error you're getting?

Regards,

Ewan

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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

--- 
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.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Issues running GetRefreshToken.php

2013-08-21 Thread Alan Coleman
Hi Ewan,

Thanks for replying, I've actually been reading the entries on your blog, 
great stuff.

I should have noted the full error last night, it's a project I'm working 
on at home, duh! I'll place the full error later on.

Some background. I have a development version of my web app running locally 
and a released version online.

I've been using Client Login for authentication but need to move over to 
OAuth2 so that I can migrate to v201306.

I've registered my app with the console and have added the client_id and 
client_secret pair to my auth.ini file.

I'm having trouble running my GetRefreshToken.php file (through command 
line), there's a possibility that I'm running it from the wrong part of the 
file structure meaning required resources are not being picked up.

Any ideas would be appreciated.

Many thanks

On Tuesday, August 20, 2013 10:38:02 PM UTC+1, Ewan Heming wrote:
>
> Hi Alan,
>
> What's the error you're getting?
>
> Regards,
>
> Ewan
>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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

--- 
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.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Issues running GetRefreshToken.php

2013-08-21 Thread Alan Coleman
Hi Ewan,

Here is the error I'm receiving when I run GetRefreshToken.php

 Catchable fatal error: Argument 1 passed to 
OAuth2Handler::GetAuthorizationUrl() must be of the type array, null given, 
called in 
C:\wamp\www\adwords.fbt\adwords_api_php_4.2.5\examples\AdWords\Auth\GetRefreshToken.php
 
on line 48 and defined in 
C:\wamp\www\adwords.fbt\adwords_api_php_4.2.5\src\Google\Api\Ads\Common\Util\OAuth2Handler.php
 
on line *67*
*
*
Thoughts?

Many thanks.

On Wednesday, August 21, 2013 10:59:02 AM UTC+1, Alan Coleman wrote:
>
> Hi Ewan,
>
> Thanks for replying, I've actually been reading the entries on your blog, 
> great stuff.
>
> I should have noted the full error last night, it's a project I'm working 
> on at home, duh! I'll place the full error later on.
>
> Some background. I have a development version of my web app running 
> locally and a released version online.
>
> I've been using Client Login for authentication but need to move over to 
> OAuth2 so that I can migrate to v201306.
>
> I've registered my app with the console and have added the client_id and 
> client_secret pair to my auth.ini file.
>
> I'm having trouble running my GetRefreshToken.php file (through command 
> line), there's a possibility that I'm running it from the wrong part of the 
> file structure meaning required resources are not being picked up.
>
> Any ideas would be appreciated.
>
> Many thanks
>
> On Tuesday, August 20, 2013 10:38:02 PM UTC+1, Ewan Heming wrote:
>>
>> Hi Alan,
>>
>> What's the error you're getting?
>>
>> Regards,
>>
>> Ewan
>>
>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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

--- 
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.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Issues running GetRefreshToken.php

2013-08-21 Thread Evgeniy Bogdanov
I think that for some reason this library unable to read auth.ini and build
needed data structure to get OAuth2 token.



2013/8/21 Alan Coleman 

> Hi Ewan,
>
> Here is the error I'm receiving when I run GetRefreshToken.php
>
>  Catchable fatal error: Argument 1 passed to
> OAuth2Handler::GetAuthorizationUrl() must be of the type array, null given,
> called in
> C:\wamp\www\adwords.fbt\adwords_api_php_4.2.5\examples\AdWords\Auth\GetRefreshToken.php
> on line 48 and defined in
> C:\wamp\www\adwords.fbt\adwords_api_php_4.2.5\src\Google\Api\Ads\Common\Util\OAuth2Handler.php
> on line *67*
> *
> *
> Thoughts?
>
> Many thanks.
>
> On Wednesday, August 21, 2013 10:59:02 AM UTC+1, Alan Coleman wrote:
>>
>> Hi Ewan,
>>
>> Thanks for replying, I've actually been reading the entries on your blog,
>> great stuff.
>>
>> I should have noted the full error last night, it's a project I'm working
>> on at home, duh! I'll place the full error later on.
>>
>> Some background. I have a development version of my web app running
>> locally and a released version online.
>>
>> I've been using Client Login for authentication but need to move over to
>> OAuth2 so that I can migrate to v201306.
>>
>> I've registered my app with the console and have added the client_id and
>> client_secret pair to my auth.ini file.
>>
>> I'm having trouble running my GetRefreshToken.php file (through command
>> line), there's a possibility that I'm running it from the wrong part of the
>> file structure meaning required resources are not being picked up.
>>
>> Any ideas would be appreciated.
>>
>> Many thanks
>>
>> On Tuesday, August 20, 2013 10:38:02 PM UTC+1, Ewan Heming wrote:
>>>
>>> Hi Alan,
>>>
>>> What's the error you're getting?
>>>
>>> Regards,
>>>
>>> Ewan
>>>
>>  --
> --
> =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
> 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
>
> ---
> 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.
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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

--- 
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.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Issues running GetRefreshToken.php

2013-08-21 Thread Ewan Heming
Hi Alan,

As Evgeniy mentioned, there's probably something wrong with your PHP 
configuration, but you could try adding the parameters to the example file 
instead of auth.ini. At line 85 of GetRefreshToken.php you should find the 
following code:

$user = new AdWordsUser();
$user->LogAll();

The AdWordsUser object has a SetOAuth2Info method that takes an associative 
array of parameters, and you can set the client_id and client_secret as 
follows:

$user->SetOAuth2Info(array(
"client_id" => "INSERT_OAUTH2_CLIENT_ID_HERE",
"client_secret" => "INSERT_OAUTH2_CLIENT_SECRET_HERE"
));

Regards,

Ewan

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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

--- 
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.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Issues running GetRefreshToken.php

2013-08-28 Thread Alan Coleman
Hi Ewan and Evgeniy,

This doesn't seem to be the simple process the Google guys are making out. 
I'm following this process: 
https://code.google.com/p/google-api-adwords-php/wiki/OAuth2

I've added the client_id and client_secret to the SetOAuth2Info method 
array as you suggested above. 

However I'm getting the following error: { "error" : "invalid_request" }

The client_id and client_secret are both from our MCC Account, which I 
gather is where they are supposed to come from. However our developerToken 
we used with our email password authentication is from a linked account.

So I'm thinking that the developerToken will also need to be from our MCC 
account, which means we'll need to reapply for another token. Great.

Back to GetRefreshToken.php, the developerToken doesn't seem to be declared 
anywhere, which I find confusing.

Any thoughts would be greatly appreciated, as usual.

Many thanks

On Thursday, August 22, 2013 12:25:37 AM UTC+1, Ewan Heming wrote:
>
> Hi Alan,
>
> As Evgeniy mentioned, there's probably something wrong with your PHP 
> configuration, but you could try adding the parameters to the example file 
> instead of auth.ini. At line 85 of GetRefreshToken.php you should find the 
> following code:
>
> $user = new AdWordsUser();
> $user->LogAll();
>
> The AdWordsUser object has a SetOAuth2Info method that takes an 
> associative array of parameters, and you can set the client_id and 
> client_secret as follows:
>
> $user->SetOAuth2Info(array(
> "client_id" => "INSERT_OAUTH2_CLIENT_ID_HERE",
> "client_secret" => "INSERT_OAUTH2_CLIENT_SECRET_HERE"
> ));
>
> Regards,
>
> Ewan
>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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

--- 
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.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Issues running GetRefreshToken.php

2013-09-03 Thread Alan Coleman
Hi Ewan and Evgeniy,

Okay, GetRefreshToken.php needs to be run through the command line. My 
fault for not reading the documentation properly! This gave me a URL and a 
token to use to access the final refresh token.

Thanks again for taking the time to reply to my issue.


On Wednesday, August 28, 2013 9:33:02 PM UTC+1, Alan Coleman wrote:
>
> Hi Ewan and Evgeniy,
>
> This doesn't seem to be the simple process the Google guys are making out. 
> I'm following this process: 
> https://code.google.com/p/google-api-adwords-php/wiki/OAuth2
>
> I've added the client_id and client_secret to the SetOAuth2Info method 
> array as you suggested above. 
>
> However I'm getting the following error: { "error" : "invalid_request" }
>
> The client_id and client_secret are both from our MCC Account, which I 
> gather is where they are supposed to come from. However our developerToken 
> we used with our email password authentication is from a linked account.
>
> So I'm thinking that the developerToken will also need to be from our MCC 
> account, which means we'll need to reapply for another token. Great.
>
> Back to GetRefreshToken.php, the developerToken doesn't seem to be 
> declared anywhere, which I find confusing.
>
> Any thoughts would be greatly appreciated, as usual.
>
> Many thanks
>
> On Thursday, August 22, 2013 12:25:37 AM UTC+1, Ewan Heming wrote:
>>
>> Hi Alan,
>>
>> As Evgeniy mentioned, there's probably something wrong with your PHP 
>> configuration, but you could try adding the parameters to the example file 
>> instead of auth.ini. At line 85 of GetRefreshToken.php you should find the 
>> following code:
>>
>> $user = new AdWordsUser();
>> $user->LogAll();
>>
>> The AdWordsUser object has a SetOAuth2Info method that takes an 
>> associative array of parameters, and you can set the client_id and 
>> client_secret as follows:
>>
>> $user->SetOAuth2Info(array(
>> "client_id" => "INSERT_OAUTH2_CLIENT_ID_HERE",
>> "client_secret" => "INSERT_OAUTH2_CLIENT_SECRET_HERE"
>> ));
>>
>> Regards,
>>
>> Ewan
>>
>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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

--- 
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.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Issues running GetRefreshToken.php

2013-09-04 Thread solanki pravin


On Wednesday, August 21, 2013 3:02:12 AM UTC+5:30, Alan Coleman wrote:
>
> Hello everyone,
>
> I'm trying to get hold of a refresh_token for my auth.ini file
>
> I understand from the 
> guidethat I 
> need to run GetRefreshToken.php, however there doesn't seem to be 
> much advice on actually *how* to run this file.
>
> At the moment I'm running the file through the command line locally like 
> this: . \examples\adwords\Auth>php GetRefreshToken.php
>
> I'm receiving a PHP Catchable Fatal Error.
>
> Am I running this GetRefreshToken in the right place? Do I need to carry 
> arguments across?
>
> Any help would be appreciated.
>
> Many thanks 
>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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

--- 
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.
For more options, visit https://groups.google.com/groups/opt_out.