Re: How to authenticate anyone ADWORDS API OAuth2 PHP

2013-12-10 Thread Paul Matthews (AdWords API Team)
The clientCustomerId is the identifier for the account you wish to access. 
You need to specify this in the AdWordsUser to access that account.

The OAuth2 layer is purely to permit access, the clientCustomerId 
specifieswhich
 sub account you're accessing.

For more information on this please read the 
README
.

Regards,

- Paul, AdWords API Team.

On Tuesday, 10 December 2013 12:58:26 UTC-8, Christian Gibbs wrote:
>
> By the way, your video helped. Because I didnt know there was a new 
> Auth.ini file.
>
> Now Im getting this error.
>
> The client customer ID must be specified for report downloads.'
>
>
> When I run the campaign service, I can do that and view all the campaigns but 
> I cannot download the reports because I dont have the clientCustomerId.
>
>
>
> How is this suppose to work when using OAuth2?
>
>
> I have a refresh token. Everything is working ok, when just viewing the 
> campaigns but not for downloading reports. The Id is required.
>
>
> Any idea?
>
>
> Thanks
>
>
>
>
>
> On Tuesday, December 10, 2013 2:50:53 PM UTC-5, Christian Gibbs wrote:
>>
>> I GOT IT!
>>
>>
>>
>> After getting the ?code=   from the URL
>>
>>
>> $url = "https://accounts.google.com/o/oauth2/token";;
>> $params = array(
>> "code" => $authCode,
>> "client_id" => $clientId,
>> "client_secret" => $clientSecret,
>> "redirect_uri" => $callbackUrl,
>> "grant_type" => "authorization_code"
>> );
>>  
>> $curl = curl_init();
>> curl_setopt($curl, CURLOPT_URL, $url);
>> curl_setopt($curl, CURLOPT_HEADER, false);
>> curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
>> curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
>> curl_setopt($curl, CURLOPT_POST, true);
>> curl_setopt($curl, CURLOPT_POSTFIELDS, $params);
>> curl_setopt($curl, CURLOPT_ENCODING, "");
>> $curlData = curl_exec($curl);
>> curl_close($curl);
>>  $result = json_decode ($curlData);
>> print_r( $result );
>>  
>>  $access_token = $result->access_token;
>>
>>
>>
>> $user = new AdWordsUser();
>>  $user->SetOAuth2Info(array(
>> "client_id" => $clientId,
>> "client_secret" => $clientSecret,
>> "access_token" => $access_token,
>> "refresh_token" => ""
>> ));
>>
>> I save the Auth Info and I was able to pull the other account data!
>>
>>
>>
>>
>>
>>
>> On Tuesday, December 10, 2013 11:33:29 AM UTC-5, Christian Gibbs wrote:
>>>
>>> The OAuth login works fine, when I login myself. I can pull the data. 
>>> But when I use another google account of mine I get the authorization error.
>>>
>>> I need to achieve this. Please dont say this is the result because the 
>>> account is unlinked. Please give me some direction on how to achieve this.
>>>
>>> One of your colleague is saying it is possible. 
>>>
>>>
>>> On Tuesday, December 10, 2013 11:30:26 AM UTC-5, Christian Gibbs wrote:

 I updated everything over like you said with the OAuthHandler class.

 One of your staff said this. 


 Takeshi Hagikura (AdWords API Team)[image: Google Employee] 
 Nov 12
 Hi Bikram,

 If the accounts are not linked to your MCC, you need to get a separate 
 access token (and a refresh token) for each client account. 
 In that case, I think an installed application mechanism is not 
 practical because it requires manual process for each account. 

 You can use the web application 
 flow by 
 preparing a web server that doesn't require manual process in your side 
 when a client grants your application access to their data. 



 Please give some insight in regards to accessing unlinked accounts. 
 This is what I am interested in. Please understand my goal.

 I need this to be able to authorize Adwords account users, that have 
 nothing to do with my MCC account.



 https://groups.google.com/forum/#!msg/adwords-api/8vhiFuU-4is/Y-UprxyBXQgJ



 On Tuesday, December 10, 2013 10:44:13 AM UTC-5, Paul Matthews (AdWords 
 API Team) wrote:
>
> Hi Christian,
>
> When you say you've done many changes, what kind of changes? Are you 
> able to get authentication working as per the 
> screencast? 
> Using the video is the easiest way to get the authentication working.
>
> The USER_PERMISSION_DENIED is served when you're attempting to access an 
> unlinked account 
> .
>
>
> Regards,
>
> - Paul, AdWords API Team.
>
>
> On Thursday, 14 November 2013 08:38:30 UTC-8, Christian Gibbs wrote:
>>
>> I keep getting, Authorization

Re: Consistent ERROR_GETTING_RESPONSE_FROM_BACKEND error when getting Ad Performance Report

2013-12-10 Thread Takeshi Hagikura (AdWords API Team)
Hi Bin,

To see if it works, can you please try the different format? (such as CSV, 
XML)

Best,
- Takeshi, AdWords API Team

On Tuesday, December 10, 2013 5:26:00 PM UTC-8, Takeshi Hagikura (AdWords 
API Team) wrote:
>
> Hi Bin,
>
> Sorry for the inconvenience.
> We're still working on it.
>
> Best,
> - Takeshi, 
>
> On Tuesday, December 10, 2013 10:28:23 AM UTC-8, bg...@walmartlabs.comwrote:
>>
>> Hi Takeshi,
>>
>> Just wonder if there's any update on this. We're still seeing the same 
>> error every day.
>>
>> Thanks,
>> Bin
>>
>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
http://googleadsdeveloper.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: Consistent ERROR_GETTING_RESPONSE_FROM_BACKEND error when getting Ad Performance Report

2013-12-10 Thread Takeshi Hagikura (AdWords API Team)
Hi Bin,

Sorry for the inconvenience.
We're still working on it.

Best,
- Takeshi, 

On Tuesday, December 10, 2013 10:28:23 AM UTC-8, bg...@walmartlabs.com 
wrote:
>
> Hi Takeshi,
>
> Just wonder if there's any update on this. We're still seeing the same 
> error every day.
>
> Thanks,
> Bin
>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
http://googleadsdeveloper.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: CustomerSyncService Bug? Service not returning added or deleted adExtensions

2013-12-10 Thread jake
Hi Takeshi, Akil,

I'm having the same issue. Could we please have an update on this issue?

Cheers,
Jake

On Sunday, January 27, 2013 7:29:19 PM UTC-8, Takeshi Hagikura (AdWords API 
Team) wrote:
>
> Unfortunately, it's not possible to track the status externally.
>
> Best,
> - Takeshi
>
> On Friday, January 25, 2013 7:24:50 PM UTC+9, Akil Burgess wrote:
>>
>> Thanks Takeshi. Is there a way for me to track the status of the bug?
>>
>> --
>> Akil
>>
>> On Friday, January 25, 2013 9:07:34 AM UTC, Takeshi Hagikura (AdWords API 
>> Team) wrote:
>>>
>>> Thanks for the logs.
>>>
>>> Yes, it should be returned.
>>> I've escalated it as a bug.
>>>
>>> Best,
>>> - Takeshi, AdWords API Team
>>>
>>> On Thursday, January 24, 2013 9:48:19 PM UTC+9, Akil Burgess wrote:

 Hi Takeshi,

 Thank you for your response. I have attached the logs for a 
 campaignAdExtension mutate operation and then a subsequent 
 CustomerSyncService get operation to this reply. Please let me know if I 
 can provide anything else that may help.

 Thanks,
 Akil

 On Thursday, January 24, 2013 8:59:35 AM UTC, Takeshi Hagikura (AdWords 
 API Team) wrote:
>
> Hello Akil,
>
> Thanks for writing in.
> Do you also have the request/response logs for CampaignAdExtension 
> mutate?
>
> I'd like to confirm if that should be included in the 
> CustomerSyncService response.
>
> Best,
> - Takeshi, AdWords API Team
>
> On Tuesday, January 22, 2013 1:56:32 AM UTC+9, Akil Burgess wrote:
>>
>> Hi All,
>>
>> The CustomerSyncService doesn't seem to be including 
>> addedAdExtensions or deletedAdExtensions data. I've performed several 
>> CampaignAdExtension updates (via the API and the AdWords web interface) 
>> in 
>> our test account and the CustomerSyncService does not show any of these 
>> changes. When I perform CampaignAdExtensionService get operations I can 
>> see 
>> the updated data so it seems like this data should have been processed 
>> and 
>> reflected in the CustomerChangeData.
>>
>> *All* - Is anyone else seeing this behaviour?
>>
>> *API Team* - Is this a bug? Can someone take a look?
>>
>> I have pasted my request and response logs at the end of this 
>> message. As we can see other changes (adgroups) are showing in 
>> CustomerChangeData but no adExtensions.
>>
>> Thanks in advance for any help!
>>
>> Akil
>>
>>
>> *Request:*
>>
>> http://schemas.xmlsoap.org/soap/envelope/"; xmlns:xsi="
>> http://www.w3.org/2001/XMLSchema-instance"; xmlns:xsd="
>> http://www.w3.org/2001/XMLSchema";>https://adwords.google.com/api/adwords/ch/v201209";>https://adwords.google.com/api/adwords/cm/v201209";>**>  
>> xmlns="https://adwords.google.com/api/adwords/cm/v201209";>**>  
>> xmlns="https://adwords.google.com/api/adwords/cm/v201209";>2226963136>  
>> xmlns="https://adwords.google.com/api/adwords/cm/v201209";>** 
>> (AwApi-DotNet/15.0.0, Common-Dotnet/1.4.0, .NET CLR/4.0.30319.18010, 
>> gzip)https://adwords.google.com/api/adwords/ch/v201209";>>  
>> xmlns="https://adwords.google.com/api/adwords/cm/v201209";>20130118 
>> 00 UTChttps://adwords.google.com/api/adwords/cm/v201209";>20130121 164714 
>> UTC110290473
>>
>>
>> *Response:*
>>
>> http://schemas.xmlsoap.org/soap/envelope/
>> ">https://adwords.google.com/api/adwords/ch/v201209"; xmlns="
>> https://adwords.google.com/api/adwords/cm/v201209";>0004d3cf3789ea980ab1540155c5CustomerSyncServiceget014860>  
>> xmlns="https://adwords.google.com/api/adwords/cm/v201209"; xmlns:ns2="
>> https://adwords.google.com/api/adwords/ch/v201209";>110290473FIELDS_UNCHANGED6213230793FIELDS_CHANGEDfalse20130121
>>  
>> 163552 
>> UTC
>>
>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
http://googleadsdeveloper.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.


min daily budget setup

2013-12-10 Thread ssAdword
Hi Adwords API team, 

Is there a min daily budget policy I need to follow when using AdWords API 
to create and manage campaign.  for example, if I set the daily budget of a 
campaign to be $0.10, Can I set my bid to be $0.2? If not, what would be 
your advice to work around this?  

My use case is that I have thousands of mobile campaign to run, each will 
have different targeting (location) and grouping them would be diminishing 
the benefits of using API. 

Thank you!

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
http://googleadsdeveloper.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.


Problem connecting with Adwords Api using Python

2013-12-10 Thread Mario Murias
Hello,
I'm trying to run the sample application to connect using python to Adwords 
Api.
I installed Python 2.7 and once you have everything set up to connect to a 
test Adwords Account, and run the sample application as described in the 
manual, can I access the URL http://localhost:8000 which is the admin 
Server, but to access http://localhost:8080, I get the following error 
message:

10/12/2013 14:46:56,565 ERROR cgi.py: 121] Traceback (most recent call 
last):
   File "C: \ Program Files (x86) \ Google \ google_appengine \ 
adwordsapi_demo \ api_clien
t.py ", line 39, in 
 raise Exception (e)
Exception: No module named adspygoogle.adwords.AdWordsClient

How could I solve this problem?

regards
Mario

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
http://googleadsdeveloper.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: Edit ad device preference (management functionality) M.18

2013-12-10 Thread Danial Klimkin
Hi Tom,


Please check with the policy team on all RMF questions via:

  https://services.google.com/fb/forms/apicontact/


-Danial, AdWords API Team.


On Monday, December 9, 2013 3:10:42 PM UTC+4, tomfl...@gmail.com wrote:
>
> Hi,
>  
> I am working on the management functionality, though M.18, though 'edit ad 
> device preference', how is this possible if the ad itself is immutable?. I 
> have tried to 'SET ' the change through the 'adgroupadservice' though this 
> hasn't worked and have read it can only change if another ad is created 
> from scratch or is there another way I can just 'SET' the change?.
>  
> Also, for our records, we have the codes for each device preference, 3 
> for desktop etc. Though is there a code for all devices?.It doesn't seem to 
> be defined in the api docs.
>  
> Many Thanks in advance,
>  
> Tom.
>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
http://googleadsdeveloper.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.


AuthenticationError.USER_ID_INVALID

2013-12-10 Thread Mohammed Nasri
Hi, 

I am using php Adwords API (v201309) and I want to download the Adwords 
Reports, here is my php code:

/* CODE : BEGIN */

$httpHeaders = array(
"Authorization:OAUTH2_ACCESS_TOKEN=*MY_OAUTH2_CODE*",
"developerToken:*MY_TOKEN*",
"clientCustomerId:*MY_CUSTOMER_ID*"
);

$reportDefinition = "https://adwords.google.com/api/adwords/cm/v201309\";>";
$reportDefinition .= "";
$reportDefinition .= "CampaignId";
$reportDefinition .= "Date";
$reportDefinition .= "Impressions";
$reportDefinition .= "Clicks";
$reportDefinition .= "Cost";
$reportDefinition .= "Conversions";
$reportDefinition .= "AveragePosition";
$reportDefinition .= "";
$reportDefinition .= "20130712";
$reportDefinition .= "20131010";
$reportDefinition .= "";
$reportDefinition .= "";
$reportDefinition .= "Ad Performance Report";
$reportDefinition .= "AD_PERFORMANCE_REPORT";
$reportDefinition .= "CUSTOM_DATE";
$reportDefinition .= "XML";
$reportDefinition .= "";

$params = array("__rdxml" => $reportDefinition);

$url = "https://adwords.google.com/api/adwords/reportdownload/v201309";;
 
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_HEADER, false);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, $params);
curl_setopt($curl, CURLOPT_HTTPHEADER, $httpHeaders);
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 120);
curl_setopt($curl, CURLOPT_TIMEOUT, 120);
curl_setopt ($curl, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt ($curl, CURLOPT_SSL_VERIFYPEER, 0);

$reportData = curl_exec($curl);
$err = curl_errno($curl);
$errmsg  = curl_error($curl) ;
$header  = curl_getinfo($curl); 

curl_close($curl);

echo $reportData . "";

/* CODE : END */

The result of my code is as follows : 

*AuthenticationError.USER_ID_INVALID*

I added the option userId to the httpHeaders params, but this gives me the 
following error message : 

*Not Found*
Have you any idea that can helps me.

Thank you.

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
http://googleadsdeveloper.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: How to authenticate anyone ADWORDS API OAuth2 PHP

2013-12-10 Thread Christian Gibbs
By the way, your video helped. Because I didnt know there was a new 
Auth.ini file.

Now Im getting this error.

The client customer ID must be specified for report downloads.'


When I run the campaign service, I can do that and view all the campaigns but I 
cannot download the reports because I dont have the clientCustomerId.



How is this suppose to work when using OAuth2?


I have a refresh token. Everything is working ok, when just viewing the 
campaigns but not for downloading reports. The Id is required.


Any idea?


Thanks





On Tuesday, December 10, 2013 2:50:53 PM UTC-5, Christian Gibbs wrote:
>
> I GOT IT!
>
>
>
> After getting the ?code=   from the URL
>
>
> $url = "https://accounts.google.com/o/oauth2/token";;
> $params = array(
> "code" => $authCode,
> "client_id" => $clientId,
> "client_secret" => $clientSecret,
> "redirect_uri" => $callbackUrl,
> "grant_type" => "authorization_code"
> );
>  
> $curl = curl_init();
> curl_setopt($curl, CURLOPT_URL, $url);
> curl_setopt($curl, CURLOPT_HEADER, false);
> curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
> curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
> curl_setopt($curl, CURLOPT_POST, true);
> curl_setopt($curl, CURLOPT_POSTFIELDS, $params);
> curl_setopt($curl, CURLOPT_ENCODING, "");
> $curlData = curl_exec($curl);
> curl_close($curl);
>  $result = json_decode ($curlData);
> print_r( $result );
>  
>  $access_token = $result->access_token;
>
>
>
> $user = new AdWordsUser();
>  $user->SetOAuth2Info(array(
> "client_id" => $clientId,
> "client_secret" => $clientSecret,
> "access_token" => $access_token,
> "refresh_token" => ""
> ));
>
> I save the Auth Info and I was able to pull the other account data!
>
>
>
>
>
>
> On Tuesday, December 10, 2013 11:33:29 AM UTC-5, Christian Gibbs wrote:
>>
>> The OAuth login works fine, when I login myself. I can pull the data. But 
>> when I use another google account of mine I get the authorization error.
>>
>> I need to achieve this. Please dont say this is the result because the 
>> account is unlinked. Please give me some direction on how to achieve this.
>>
>> One of your colleague is saying it is possible. 
>>
>>
>> On Tuesday, December 10, 2013 11:30:26 AM UTC-5, Christian Gibbs wrote:
>>>
>>> I updated everything over like you said with the OAuthHandler class.
>>>
>>> One of your staff said this. 
>>>
>>>
>>> Takeshi Hagikura (AdWords API Team)[image: Google Employee] 
>>> Nov 12
>>> Hi Bikram,
>>>
>>> If the accounts are not linked to your MCC, you need to get a separate 
>>> access token (and a refresh token) for each client account. 
>>> In that case, I think an installed application mechanism is not 
>>> practical because it requires manual process for each account. 
>>>
>>> You can use the web application 
>>> flow by 
>>> preparing a web server that doesn't require manual process in your side 
>>> when a client grants your application access to their data. 
>>>
>>>
>>>
>>> Please give some insight in regards to accessing unlinked accounts. This 
>>> is what I am interested in. Please understand my goal.
>>>
>>> I need this to be able to authorize Adwords account users, that have 
>>> nothing to do with my MCC account.
>>>
>>>
>>>
>>> https://groups.google.com/forum/#!msg/adwords-api/8vhiFuU-4is/Y-UprxyBXQgJ
>>>
>>>
>>>
>>> On Tuesday, December 10, 2013 10:44:13 AM UTC-5, Paul Matthews (AdWords 
>>> API Team) wrote:

 Hi Christian,

 When you say you've done many changes, what kind of changes? Are you 
 able to get authentication working as per the 
 screencast? 
 Using the video is the easiest way to get the authentication working.

 The USER_PERMISSION_DENIED is served when you're attempting to access an 
 unlinked account 
 .


 Regards,

 - Paul, AdWords API Team.


 On Thursday, 14 November 2013 08:38:30 UTC-8, Christian Gibbs wrote:
>
> I keep getting, AuthorizationError.USER_PERMISSION_DENIED
>
> What is the point of them logging in, if you need to get their 
> permission again.
>
> I want anyone to be able to access their adwords account, via our 
> platform. Like so many other apps and websites do.
>
> I have refresh tokens and I can access my own account just fine, but 
> with other account logins, I get this error 
> AuthorizationError.USER_PERMISSION_DENIED
>
> It make the app pointless, if I have to manually add ever client in 
> and then allow them to login.
>
> So many apps allow this kind of access. How is it possible?
>
> I made a google app, that has a google login authorization prompt 
> screen, then once the user consents, the login is 

Re: Missing campaign of type "Shopping - Product Listing Ads"

2013-12-10 Thread kevin
We would also like to hear about this

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
http://googleadsdeveloper.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: How to authenticate anyone ADWORDS API OAuth2 PHP

2013-12-10 Thread Christian Gibbs
I GOT IT!



After getting the ?code=   from the URL


$url = "https://accounts.google.com/o/oauth2/token";;
$params = array(
"code" => $authCode,
"client_id" => $clientId,
"client_secret" => $clientSecret,
"redirect_uri" => $callbackUrl,
"grant_type" => "authorization_code"
);
 
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_HEADER, false);
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, $params);
curl_setopt($curl, CURLOPT_ENCODING, "");
$curlData = curl_exec($curl);
curl_close($curl);
 $result = json_decode ($curlData);
print_r( $result );
 
 $access_token = $result->access_token;



$user = new AdWordsUser();
 $user->SetOAuth2Info(array(
"client_id" => $clientId,
"client_secret" => $clientSecret,
"access_token" => $access_token,
"refresh_token" => ""
));

I save the Auth Info and I was able to pull the other account data!






On Tuesday, December 10, 2013 11:33:29 AM UTC-5, Christian Gibbs wrote:
>
> The OAuth login works fine, when I login myself. I can pull the data. But 
> when I use another google account of mine I get the authorization error.
>
> I need to achieve this. Please dont say this is the result because the 
> account is unlinked. Please give me some direction on how to achieve this.
>
> One of your colleague is saying it is possible. 
>
>
> On Tuesday, December 10, 2013 11:30:26 AM UTC-5, Christian Gibbs wrote:
>>
>> I updated everything over like you said with the OAuthHandler class.
>>
>> One of your staff said this. 
>>
>>
>> Takeshi Hagikura (AdWords API Team)[image: Google Employee] 
>> Nov 12
>> Hi Bikram,
>>
>> If the accounts are not linked to your MCC, you need to get a separate 
>> access token (and a refresh token) for each client account. 
>> In that case, I think an installed application mechanism is not practical 
>> because it requires manual process for each account. 
>>
>> You can use the web application 
>> flow by 
>> preparing a web server that doesn't require manual process in your side 
>> when a client grants your application access to their data. 
>>
>>
>>
>> Please give some insight in regards to accessing unlinked accounts. This 
>> is what I am interested in. Please understand my goal.
>>
>> I need this to be able to authorize Adwords account users, that have 
>> nothing to do with my MCC account.
>>
>>
>> https://groups.google.com/forum/#!msg/adwords-api/8vhiFuU-4is/Y-UprxyBXQgJ
>>
>>
>>
>> On Tuesday, December 10, 2013 10:44:13 AM UTC-5, Paul Matthews (AdWords 
>> API Team) wrote:
>>>
>>> Hi Christian,
>>>
>>> When you say you've done many changes, what kind of changes? Are you 
>>> able to get authentication working as per the 
>>> screencast? 
>>> Using the video is the easiest way to get the authentication working.
>>>
>>> The USER_PERMISSION_DENIED is served when you're attempting to access an 
>>> unlinked account 
>>> .
>>>
>>>
>>> Regards,
>>>
>>> - Paul, AdWords API Team.
>>>
>>>
>>> On Thursday, 14 November 2013 08:38:30 UTC-8, Christian Gibbs wrote:

 I keep getting, AuthorizationError.USER_PERMISSION_DENIED

 What is the point of them logging in, if you need to get their 
 permission again.

 I want anyone to be able to access their adwords account, via our 
 platform. Like so many other apps and websites do.

 I have refresh tokens and I can access my own account just fine, but 
 with other account logins, I get this error 
 AuthorizationError.USER_PERMISSION_DENIED

 It make the app pointless, if I have to manually add ever client in and 
 then allow them to login.

 So many apps allow this kind of access. How is it possible?

 I made a google app, that has a google login authorization prompt 
 screen, then once the user consents, the login is successful but I can not 
 access their data.

 Im stuck in a circle and its driving me crazy. Please HELP!




-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
http://googleadsdeveloper.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 Grou

Re: AuthorizationError.USER_PERMISSION_DENIED While accessing campaigns

2013-12-10 Thread Christian Gibbs
I GOT IT!



After getting the ?code=   from the URL


$url = "https://accounts.google.com/o/oauth2/token";;
$params = array(
"code" => $authCode,
"client_id" => $clientId,
"client_secret" => $clientSecret,
"redirect_uri" => $callbackUrl,
"grant_type" => "authorization_code"
);
 
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_HEADER, false);
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, $params);
curl_setopt($curl, CURLOPT_ENCODING, "");
$curlData = curl_exec($curl);
curl_close($curl);
 $result = json_decode ($curlData);
print_r( $result );
 
 $access_token = $result->access_token;



$user = new AdWordsUser();
 $user->SetOAuth2Info(array(
"client_id" => $clientId,
"client_secret" => $clientSecret,
"access_token" => $access_token,
"refresh_token" => ""
));

I save the Auth Info and I was able to pull the other account data!


On Tuesday, December 10, 2013 10:01:29 AM UTC-5, Christian Gibbs wrote:
>
> I am trying to access accounts that are not linked to our MCC by the 
> consent of the user.
>
> It first starts here,
>
> $user = new AdWordsUser();
>  $user->SetOAuth2Info(array(
> "response_type" => 'code',
> "client_id" => $clientId,
> "client_secret" => $clientSecret,
> "access_token" => $access, 
> "refresh_token" => $refresh,
> "scope" => 'offline'
> ));
>  $params = array(
> "response_type" => 'code',
> "client_id" => $clientId,
> "client_secret" => $clientSecret,
> "access_token" => $access, 
> "refresh_token" => $refresh,
> "scope" => 'offline'
> );
>  
>  /*
>   *  public function GetAuthorizationUrl(array $credentials,
>   $redirectUri = NULL, $offline = NULL, array $params = NULL) {
>   */
>  
> // Generate an authorization URL given the callback URL
> try{
>  $OAuth2Handler = $user->GetOAuth2Handler();
> $OAuth2Handler->scope = 'https://adwords.google.com/api/adwords/';
> print_r( $OAuth2Handler );
> $authUrl = $OAuth2Handler->GetAuthorizationUrl($params, $callbackUrl, 
> true, null);
> }catch( Exception $e ){
> print_r($e->getMessage());
> }
>  
> header("Location: $authUrl");
>
>
>
> Then it takes you to the consent page.
>
> After login is successful,
>
>
> Not sure if I need to set scope = 'offline' Paul Matthews said something 
> about that but wasnt clear. There is another scope but it is a URL so I 
> dont know what hes talking about. Maybe you can shed some light on that.
>
> Anyway, the callback url runs this code,
>
>
> $user = new AdWordsUser();
>  $user->SetOAuth2Info(array(
> "response_type" => 'code',
> "client_id" => $clientId,
> "client_secret" => $clientSecret,
> "access_token" => $access, 
> "refresh_token" => $refresh,
> "scope" => 'offline'
> ));
>  $authCode = $_REQUEST["code"];
>  //GetOAuth2Credential function copied below
>
>  $oauth2Info = $this->Google_model->GetOAuth2Credential($user, $authCode, 
> $callbackUrl);
>  $user->SetOAuth2Info($oauth2Info);
>   $user->SetAuthToken( $authCode );
>  
>
>
>
>
> function GetOAuth2Credential($user, $code, $redirectUri = NULL) {
>
>   $offline = TRUE;
>   // Get the authorization URL for the OAuth2 token.
>   // No redirect URL is being used since this is an installed application. 
> A web
>   // application would pass in a redirect URL back to the application,
>   // ensuring it's one that has been configured in the API console.
>   // Passing true for the second parameter ($offline) will provide us a 
> refresh
>   // token which can used be refresh the access token when it expires.
>   $OAuth2Handler = $user->GetOAuth2Handler();
>   $authorizationUrl = $OAuth2Handler->GetAuthorizationUrl(
>   $user->GetOAuth2Info(), $redirectUri, $offline);
>   // In a web application you would redirect the user to the 
> authorization URL
>   // and after approving the token they would be redirected back to the
>   // redirect URL, with the URL parameter "code" added. For desktop
>   // or server applications, spawn a browser to the URL and then have the 
> user
>   // enter the authorization code that is displayed.
>   printf("Log in to your AdWords account and open the following 
> URL:\n%s\n\n",
>   $authorizationUrl);
>   //print "After approving the token enter the authorization code here: ";
>   
>   // Get the access token using the authorization code. Ensure you use 
> the same
>   // redirect URL used when requesting authorization.
>   $user->SetOAuth2Info(
> $OAuth2Handler->GetAccessToken(
> $user->GetOAuth2Info(), $code, $redirectUri));
>// The access token expires but the refresh token obtained for offline 
> use
>   // doesn't, and should be stored for later use.
>   return $user->GetOAuth2Info();
> }
>
>
>
>
>
> I still get the alert, [AuthorizationError.USER_PERMISSION_DENIED @ ; 
> trigger:'

Re: Consistent ERROR_GETTING_RESPONSE_FROM_BACKEND error when getting Ad Performance Report

2013-12-10 Thread bgao
Hi Takeshi,

Just wonder if there's any update on this. We're still seeing the same 
error every day.

Thanks,
Bin

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
http://googleadsdeveloper.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: Location extension bug?

2013-12-10 Thread GDZ
Yes, I'm using code from example.


I removed 'old' location extensions, created new ones (with no modifications to 
the code) and they got "Approved" status almost immediately this time.


How do I close the ticket? Can't find any button/link to do so.

On Monday, December 9, 2013 6:14:57 PM UTC-5, Paul Matthews (AdWords API 
Team) wrote:
>
> Hi GDZ,
>
> Are you using the GeoLocationService to get the address first? As per this 
> example,
>  
> you can see that they find the GeoPoint first, then include it in the 
> LocationExtension.
>
> Also, is there any chance you could close the ticket in the Python 
> library, as this would be more of a API related query. Unless you don't 
> feel the python library is converting to the SOAP request correctly.
>
> Regards,
>
> - Paul, AdWords API Team. 
>
> On Thursday, 5 December 2013 10:32:27 UTC-8, GDZ wrote:
>>
>> When you create Location Extension (v201309) with only streetAddress 
>> field present (and no streetAddress2), then this extension never goes from 
>> "Eligible" status to "Approved".
>> But when you open this extension in UI and save it without any changes, 
>> it changes into "Approved" status just fine.
>>
>> I may be wrong, but looks like a problem with empty streetAddress2 field 
>> to me.
>>
>> I reported this in the python's bug tracking library
>>
>>
>> Thank you,
>> GDZ
>>
>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
http://googleadsdeveloper.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: Missing campaign of type "Shopping - Product Listing Ads"

2013-12-10 Thread Alex
we have the same problem

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
http://googleadsdeveloper.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: How to authenticate anyone ADWORDS API OAuth2 PHP

2013-12-10 Thread Christian Gibbs
The OAuth login works fine, when I login myself. I can pull the data. But 
when I use another google account of mine I get the authorization error.

I need to achieve this. Please dont say this is the result because the 
account is unlinked. Please give me some direction on how to achieve this.

One of your colleague is saying it is possible. 


On Tuesday, December 10, 2013 11:30:26 AM UTC-5, Christian Gibbs wrote:
>
> I updated everything over like you said with the OAuthHandler class.
>
> One of your staff said this. 
>
>
> Takeshi Hagikura (AdWords API Team)[image: Google Employee] 
> Nov 12
> Hi Bikram,
>
> If the accounts are not linked to your MCC, you need to get a separate 
> access token (and a refresh token) for each client account. 
> In that case, I think an installed application mechanism is not practical 
> because it requires manual process for each account. 
>
> You can use the web application 
> flow by 
> preparing a web server that doesn't require manual process in your side 
> when a client grants your application access to their data. 
>
>
>
> Please give some insight in regards to accessing unlinked accounts. This 
> is what I am interested in. Please understand my goal.
>
> I need this to be able to authorize Adwords account users, that have 
> nothing to do with my MCC account.
>
>
> https://groups.google.com/forum/#!msg/adwords-api/8vhiFuU-4is/Y-UprxyBXQgJ
>
>
>
> On Tuesday, December 10, 2013 10:44:13 AM UTC-5, Paul Matthews (AdWords 
> API Team) wrote:
>>
>> Hi Christian,
>>
>> When you say you've done many changes, what kind of changes? Are you able 
>> to get authentication working as per the 
>> screencast? 
>> Using the video is the easiest way to get the authentication working.
>>
>> The USER_PERMISSION_DENIED is served when you're attempting to access an 
>> unlinked account 
>> .
>>
>>
>> Regards,
>>
>> - Paul, AdWords API Team.
>>
>>
>> On Thursday, 14 November 2013 08:38:30 UTC-8, Christian Gibbs wrote:
>>>
>>> I keep getting, AuthorizationError.USER_PERMISSION_DENIED
>>>
>>> What is the point of them logging in, if you need to get their 
>>> permission again.
>>>
>>> I want anyone to be able to access their adwords account, via our 
>>> platform. Like so many other apps and websites do.
>>>
>>> I have refresh tokens and I can access my own account just fine, but 
>>> with other account logins, I get this error 
>>> AuthorizationError.USER_PERMISSION_DENIED
>>>
>>> It make the app pointless, if I have to manually add ever client in and 
>>> then allow them to login.
>>>
>>> So many apps allow this kind of access. How is it possible?
>>>
>>> I made a google app, that has a google login authorization prompt 
>>> screen, then once the user consents, the login is successful but I can not 
>>> access their data.
>>>
>>> Im stuck in a circle and its driving me crazy. Please HELP!
>>>
>>>
>>>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
http://googleadsdeveloper.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: How to authenticate anyone ADWORDS API OAuth2 PHP

2013-12-10 Thread Christian Gibbs
I updated everything over like you said with the OAuthHandler class.

One of your staff said this. 


Takeshi Hagikura (AdWords API Team)[image: Google Employee] 
Nov 12
Hi Bikram,

If the accounts are not linked to your MCC, you need to get a separate 
access token (and a refresh token) for each client account. 
In that case, I think an installed application mechanism is not practical 
because it requires manual process for each account. 

You can use the web application 
flow by 
preparing a web server that doesn't require manual process in your side 
when a client grants your application access to their data. 



Please give some insight in regards to accessing unlinked accounts. This is 
what I am interested in. Please understand my goal.

I need this to be able to authorize Adwords account users, that have 
nothing to do with my MCC account.


https://groups.google.com/forum/#!msg/adwords-api/8vhiFuU-4is/Y-UprxyBXQgJ



On Tuesday, December 10, 2013 10:44:13 AM UTC-5, Paul Matthews (AdWords API 
Team) wrote:
>
> Hi Christian,
>
> When you say you've done many changes, what kind of changes? Are you able 
> to get authentication working as per the 
> screencast? 
> Using the video is the easiest way to get the authentication working.
>
> The USER_PERMISSION_DENIED is served when you're attempting to access an 
> unlinked account 
> .
>
>
> Regards,
>
> - Paul, AdWords API Team.
>
>
> On Thursday, 14 November 2013 08:38:30 UTC-8, Christian Gibbs wrote:
>>
>> I keep getting, AuthorizationError.USER_PERMISSION_DENIED
>>
>> What is the point of them logging in, if you need to get their permission 
>> again.
>>
>> I want anyone to be able to access their adwords account, via our 
>> platform. Like so many other apps and websites do.
>>
>> I have refresh tokens and I can access my own account just fine, but with 
>> other account logins, I get this error 
>> AuthorizationError.USER_PERMISSION_DENIED
>>
>> It make the app pointless, if I have to manually add ever client in and 
>> then allow them to login.
>>
>> So many apps allow this kind of access. How is it possible?
>>
>> I made a google app, that has a google login authorization prompt screen, 
>> then once the user consents, the login is successful but I can not access 
>> their data.
>>
>> Im stuck in a circle and its driving me crazy. Please HELP!
>>
>>
>>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
http://googleadsdeveloper.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: How to authenticate anyone ADWORDS API OAuth2 PHP

2013-12-10 Thread Paul Matthews (AdWords API Team)
Hi Christian,

When you say you've done many changes, what kind of changes? Are you able 
to get authentication working as per the 
screencast? 
Using the video is the easiest way to get the authentication working.

The USER_PERMISSION_DENIED is served when you're attempting to access an 
unlinked account 
.


Regards,

- Paul, AdWords API Team.


On Thursday, 14 November 2013 08:38:30 UTC-8, Christian Gibbs wrote:
>
> I keep getting, AuthorizationError.USER_PERMISSION_DENIED
>
> What is the point of them logging in, if you need to get their permission 
> again.
>
> I want anyone to be able to access their adwords account, via our 
> platform. Like so many other apps and websites do.
>
> I have refresh tokens and I can access my own account just fine, but with 
> other account logins, I get this error 
> AuthorizationError.USER_PERMISSION_DENIED
>
> It make the app pointless, if I have to manually add ever client in and 
> then allow them to login.
>
> So many apps allow this kind of access. How is it possible?
>
> I made a google app, that has a google login authorization prompt screen, 
> then once the user consents, the login is successful but I can not access 
> their data.
>
> Im stuck in a circle and its driving me crazy. Please HELP!
>
>
>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
http://googleadsdeveloper.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: AuthorizationError.USER_PERMISSION_DENIED While accessing campaigns

2013-12-10 Thread Christian Gibbs
I am trying to access accounts that are not linked to our MCC by the 
consent of the user.

It first starts here,

$user = new AdWordsUser();
 $user->SetOAuth2Info(array(
"response_type" => 'code',
"client_id" => $clientId,
"client_secret" => $clientSecret,
"access_token" => $access, 
"refresh_token" => $refresh,
"scope" => 'offline'
));
 $params = array(
"response_type" => 'code',
"client_id" => $clientId,
"client_secret" => $clientSecret,
"access_token" => $access, 
"refresh_token" => $refresh,
"scope" => 'offline'
);
 
 /*
  *  public function GetAuthorizationUrl(array $credentials,
  $redirectUri = NULL, $offline = NULL, array $params = NULL) {
  */
 
// Generate an authorization URL given the callback URL
try{
 $OAuth2Handler = $user->GetOAuth2Handler();
$OAuth2Handler->scope = 'https://adwords.google.com/api/adwords/';
print_r( $OAuth2Handler );
$authUrl = $OAuth2Handler->GetAuthorizationUrl($params, $callbackUrl, true, 
null);
}catch( Exception $e ){
print_r($e->getMessage());
}
 
header("Location: $authUrl");



Then it takes you to the consent page.

After login is successful,


Not sure if I need to set scope = 'offline' Paul Matthews said something 
about that but wasnt clear. There is another scope but it is a URL so I 
dont know what hes talking about. Maybe you can shed some light on that.

Anyway, the callback url runs this code,


$user = new AdWordsUser();
 $user->SetOAuth2Info(array(
"response_type" => 'code',
"client_id" => $clientId,
"client_secret" => $clientSecret,
"access_token" => $access, 
"refresh_token" => $refresh,
"scope" => 'offline'
));
 $authCode = $_REQUEST["code"];
 //GetOAuth2Credential function copied below

 $oauth2Info = $this->Google_model->GetOAuth2Credential($user, $authCode, 
$callbackUrl);
 $user->SetOAuth2Info($oauth2Info);
  $user->SetAuthToken( $authCode );
 




function GetOAuth2Credential($user, $code, $redirectUri = NULL) {
   
  $offline = TRUE;
  // Get the authorization URL for the OAuth2 token.
  // No redirect URL is being used since this is an installed application. 
A web
  // application would pass in a redirect URL back to the application,
  // ensuring it's one that has been configured in the API console.
  // Passing true for the second parameter ($offline) will provide us a 
refresh
  // token which can used be refresh the access token when it expires.
  $OAuth2Handler = $user->GetOAuth2Handler();
  $authorizationUrl = $OAuth2Handler->GetAuthorizationUrl(
  $user->GetOAuth2Info(), $redirectUri, $offline);
  // In a web application you would redirect the user to the authorization 
URL
  // and after approving the token they would be redirected back to the
  // redirect URL, with the URL parameter "code" added. For desktop
  // or server applications, spawn a browser to the URL and then have the 
user
  // enter the authorization code that is displayed.
  printf("Log in to your AdWords account and open the following 
URL:\n%s\n\n",
  $authorizationUrl);
  //print "After approving the token enter the authorization code here: ";
  
  // Get the access token using the authorization code. Ensure you use the 
same
  // redirect URL used when requesting authorization.
  $user->SetOAuth2Info(
$OAuth2Handler->GetAccessToken(
$user->GetOAuth2Info(), $code, $redirectUri));
   // The access token expires but the refresh token obtained for offline 
use
  // doesn't, and should be stored for later use.
  return $user->GetOAuth2Info();
}





I still get the alert, [AuthorizationError.USER_PERMISSION_DENIED @ ; 
trigger:'']





On Tuesday, November 12, 2013 2:43:24 AM UTC-5, Takeshi Hagikura (AdWords 
API Team) wrote:
>
> Hi Bikram,
>
> If the accounts are not linked to your MCC, you need to get a separate 
> access token (and a refresh token) for each client account. 
> In that case, I think an installed application mechanism is not practical 
> because it requires manual process for each account. 
>
> You can use the web application 
> flow by 
> preparing a web server that doesn't require manual process in your side 
> when a client grants your application access to their data. 
>
> > Also please let me know what is the durability of our refresh token. 
> Will not ever change after we give access and generate it.
> A refresh token never expires unless you explicitly revoke the access. 
>
> Best,
> - Takeshi, AdWords API Team
>
> On Saturday, November 9, 2013 2:18:31 AM UTC+9, Bikram Bhuyan wrote:
>>
>> Hi Takeshi,
>>
>> Thanks for your detailed explanation. You are absolutely right. If both 
>> the accounts are under our MCC account then everything should work fine as 
>> you mentioned. I am trying to connect to our clients AdWords account which 
>> will definitely be not under our MCC account. So I am trying to figure out 
>> what will be the best mechanism to implement it.
>>
>> Also please let me know w