Re: Linking account by PHP api

2016-06-23 Thread 'Michael Cloonan (AdWords API Team)' via AdWords API Forum
Hello,

If you are having a separate issue, please create a new forum thread and 
please provide more information about exactly what you are trying 
(preferably with SOAP).

Unfortunately, we have determined that to accept a link request from a 
client account via the API, you have to authorize as the client account 
itself. Maybe try using a refresh token generated directly from the client 
account you wish to link to. At that point, however, you are already logged 
into the child account manually, so it may be easier to just accept the 
link manually. We are working with the API team to determine a way to 
improve the ability to programmatically link accounts without requiring 
manual user intervention to get authorization.

Regards,
Mike, AdWords API Team

On Thursday, June 23, 2016 at 4:40:05 AM UTC-4, asma batool wrote:
>
> Hi,
>
> I am also having issue linking account 
> but errors is [ManagedCustomerServiceError.NOT_AUTHORIZED @ operations[0]]
>
>
>
> On Friday, May 23, 2014 at 6:15:49 PM UTC+5, sup...@grafxsoftware.com 
> wrote:
>>
>> Hi!
>>
>> I tried to link an account with this code in php AdWords api:
>>
>> private function linkingUser( & $data )
>> {
>> 
>> // Get the service, which loads the required classes.
>> $managedCustomerService =
>> $this->user->GetService('ManagedCustomerService', 
>> ADWORDS_VERSION);
>>
>>
>> $link = new ManagedCustomerLink();
>> $link->clientCustomerId = $data["googleClientId"];//CLIENT_CID;
>> $link->pendingDescriptiveName = "";
>> $link->linkStatus = 'PENDING';
>> $link->managerCustomerId = $data["googleClientId"];//MANAGER_CID;
>> 
>> // Create operation.
>> $operation2 = new LinkOperation();
>> 
>> $operation2->operand = $link;
>> $operation2->operator = 'ADD';
>>
>> $operations = array( $operation2);
>> 
>> 
>> 
>> try
>> {
>> // Make the mutate request.
>> $result = $managedCustomerService->mutate( $operations );
>> }
>> catch (Exception $e) {
>> $this->errors[] = $this->parseAdWordsError( $e->getMessage() 
>> );
>> return FALSE;
>> }
>> 
>> 
>> if( empty( $result->value[0] ) )
>> {
>> $error = "AdWordsUser not created (garfx)." ;
>> $this->errors[] = $error;
>> return FALSE;
>> }
>> 
>> return $result->value[0];
>> }
>> 
>> The response was: 
>>
>> [RequiredError.REQUIRED @ operations[0].operand.customerCurrencyCode, 
>> RequiredError.REQUIRED @ operations[0].operand.clientName, 
>> RequiredError.REQUIRED @ operations[0].operand.dateTimeZone]
>>
>> Please help me. What is wrong with my code?
>>
>> Thx.
>>
>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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/0392acb1-8161-4ec9-8541-0928a2965a7a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Linking account by PHP api

2016-06-23 Thread asma batool
Hi,

I am also having issue linking account 
but errors is [ManagedCustomerServiceError.NOT_AUTHORIZED @ operations[0]]



On Friday, May 23, 2014 at 6:15:49 PM UTC+5, sup...@grafxsoftware.com wrote:
>
> Hi!
>
> I tried to link an account with this code in php AdWords api:
>
> private function linkingUser( & $data )
> {
> 
> // Get the service, which loads the required classes.
> $managedCustomerService =
> $this->user->GetService('ManagedCustomerService', 
> ADWORDS_VERSION);
>
>
> $link = new ManagedCustomerLink();
> $link->clientCustomerId = $data["googleClientId"];//CLIENT_CID;
> $link->pendingDescriptiveName = "";
> $link->linkStatus = 'PENDING';
> $link->managerCustomerId = $data["googleClientId"];//MANAGER_CID;
> 
> // Create operation.
> $operation2 = new LinkOperation();
> 
> $operation2->operand = $link;
> $operation2->operator = 'ADD';
>
> $operations = array( $operation2);
> 
> 
> 
> try
> {
> // Make the mutate request.
> $result = $managedCustomerService->mutate( $operations );
> }
> catch (Exception $e) {
> $this->errors[] = $this->parseAdWordsError( $e->getMessage() );
> return FALSE;
> }
> 
> 
> if( empty( $result->value[0] ) )
> {
> $error = "AdWordsUser not created (garfx)." ;
> $this->errors[] = $error;
> return FALSE;
> }
> 
> return $result->value[0];
> }
> 
> The response was: 
>
> [RequiredError.REQUIRED @ operations[0].operand.customerCurrencyCode, 
> RequiredError.REQUIRED @ operations[0].operand.clientName, 
> RequiredError.REQUIRED @ operations[0].operand.dateTimeZone]
>
> Please help me. What is wrong with my code?
>
> Thx.
>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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/df642b3c-14a5-48eb-894e-c142332ae46d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Linking account by PHP api

2014-06-03 Thread Michael Cloonan (AdWords API Team)
Hello,

Can you please provide the full SOAP request/response you're getting when 
executing this by replying to me *privately* using the drop down arrow and 
"reply to author"? This will help me determine what the probable cause of 
this error is.

Regards,
Mike, AdWords API Team

On Monday, June 2, 2014 9:33:12 AM UTC-4, sup...@grafxsoftware.com wrote:
>
> Hi
>
> I'm trying to link an user with this code:
>
> /**
>  * 
>  * @param type $data
>  */
> private function linkingUser( & $data )
> {
> // Get the service, which loads the required classes.
> $managedCustomerService =
> $this->user->GetService('ManagedCustomerService', 
> ADWORDS_VERSION);
>   
> $link = new ManagedCustomerLink();
> $link->clientCustomerId = $data["googleClientId"]; //CLIENT_CID;
> $link->pendingDescriptiveName = "PENDING " . 
> $data["googleClientId"];
> $link->linkStatus = 'PENDING';
> $link->managerCustomerId = $this->user->GetClientCustomerId(); 
> //MANAGER_CID;
> 
> // Create operation.
> $operation2 = new LinkOperation();
> 
> $operation2->operand = $link;
> $operation2->operator = 'ADD';
>
> $operations = array( $operation2);
>
> try
> {
> // Make the mutate request.
> $result = $managedCustomerService->mutate( $operations );
> }
> catch (Exception $e) {
> $message = $e->getMessage();
> $this->errors[] = $message;
> return FALSE;
> }
> 
> if( empty( $result->value[0] ) )
> {
> $error = "AdWordsUser not created (garfx)." ;
> $this->errors[] = $error;
> return FALSE;
> }
> 
> return $result->value[0];
> }
>
> The result from "catch" section is: {"error" : "unauthorized_client"}
> Is possible that my clientID doesn't have right to link another user 
> account?
> Which case can I get this error message?
>
> Thnaks for response.
>
> Grafx.
>
>
>
>
>
> On Tuesday, May 27, 2014 10:10:43 PM UTC+3, Michael Cloonan (AdWords API 
> Team) wrote:
>>
>> Hello,
>>
>> This sounds like it may be a bug with our PHP library, or with a 
>> configuration on your server that conflicts with our PHP library.
>>
>> Could you open a bug for this issue at our library page on GitHub 
>> ? They will be able to 
>> better assist you there with the client-library specific concern.
>>
>> Regards,
>> Mike, AdWords API Team
>>
>> On Monday, May 26, 2014 11:05:11 AM UTC-4, sup...@grafxsoftware.com 
>> wrote:
>>>
>>> Hi! 
>>>
>>> Thanks for the answer!
>>> I tried to link an account with php AdWords api (v201309):
>>> Now the clientCustomerId is the id of the client, and the 
>>> managerCustomerId = $this->user->GetClientCustomerId();
>>> $this->user is the user of my MCC account. ( Like in the examples $user )
>>>
>>> The code is:
>>> // $data is prevalidated data from post.
>>> private function linkingUser( & $data )
>>> {
>>> // Get the service, which loads the required classes.
>>> $managedCustomerService =
>>> $this->user->GetService('ManagedCustomerService', 
>>> ADWORDS_VERSION);
>>>
>>> $link = new ManagedCustomerLink();
>>> $link->clientCustomerId = $data["clientId"]; //CLIENT_CID;
>>> $link->pendingDescriptiveName = "PENDING: " . $data["clientId"];
>>> $link->linkStatus = 'PENDING';
>>> $link->managerCustomerId = $this->user->GetClientCustomerId(); 
>>> //MANAGER_CID;
>>> 
>>> // Create operation.
>>> $operation = new LinkOperation();
>>> 
>>> $operation->operand = $link;
>>> $operation->operator = 'ADD';
>>>
>>> $operations = array(  $operation );
>>>
>>> try
>>> {
>>> // Make the mutate request.
>>> $result = $managedCustomerService->mutate( $operations );
>>> }
>>> catch (Exception $e) {
>>> $message = $e->getMessage();
>>> $this->errors[] = $message;
>>> return FALSE;
>>> }
>>> 
>>> if( empty( $result->value[0] ) )
>>> {
>>> $error = "Linking failed (garfx)." ;
>>> $this->errors[] = $error;
>>> return FALSE;
>>> }
>>> 
>>> return $result->value[0];
>>> }
>>> Probleme 1.)
>>> The result from "catch" section is: {"error" : "unauthorized_client"}
>>>
>>> Probleme 2.)
>>> curl probleme in API: 
>>> Warning: curl_setopt(): CURLOPT_FOLLOWLOCATION cannot be activated when 
>>> an open_basedir is set in /var/www/vhosts/
>>> grafxsoftware.com/httpdocs/gapi/src/Google/Api/Ads/Common/Util/CurlUtils.php
>>>  
>>> on line 107
>>>
>>> Thanks for helping.
>>>
>>> Grafx.
>>>
>>>
>>>
>>>
>>> 

Re: Linking account by PHP api

2014-06-02 Thread support
Hi

I'm trying to link an user with this code:

/**
 * 
 * @param type $data
 */
private function linkingUser( & $data )
{
// Get the service, which loads the required classes.
$managedCustomerService =
$this->user->GetService('ManagedCustomerService', 
ADWORDS_VERSION);
  
$link = new ManagedCustomerLink();
$link->clientCustomerId = $data["googleClientId"]; //CLIENT_CID;
$link->pendingDescriptiveName = "PENDING " . 
$data["googleClientId"];
$link->linkStatus = 'PENDING';
$link->managerCustomerId = $this->user->GetClientCustomerId(); 
//MANAGER_CID;

// Create operation.
$operation2 = new LinkOperation();

$operation2->operand = $link;
$operation2->operator = 'ADD';

$operations = array( $operation2);

try
{
// Make the mutate request.
$result = $managedCustomerService->mutate( $operations );
}
catch (Exception $e) {
$message = $e->getMessage();
$this->errors[] = $message;
return FALSE;
}

if( empty( $result->value[0] ) )
{
$error = "AdWordsUser not created (garfx)." ;
$this->errors[] = $error;
return FALSE;
}

return $result->value[0];
}

The result from "catch" section is: {"error" : "unauthorized_client"}
Is possible that my clientID doesn't have right to link another user 
account?
Which case can I get this error message?

Thnaks for response.

Grafx.





On Tuesday, May 27, 2014 10:10:43 PM UTC+3, Michael Cloonan (AdWords API 
Team) wrote:
>
> Hello,
>
> This sounds like it may be a bug with our PHP library, or with a 
> configuration on your server that conflicts with our PHP library.
>
> Could you open a bug for this issue at our library page on GitHub 
> ? They will be able to 
> better assist you there with the client-library specific concern.
>
> Regards,
> Mike, AdWords API Team
>
> On Monday, May 26, 2014 11:05:11 AM UTC-4, sup...@grafxsoftware.com wrote:
>>
>> Hi! 
>>
>> Thanks for the answer!
>> I tried to link an account with php AdWords api (v201309):
>> Now the clientCustomerId is the id of the client, and the 
>> managerCustomerId = $this->user->GetClientCustomerId();
>> $this->user is the user of my MCC account. ( Like in the examples $user )
>>
>> The code is:
>> // $data is prevalidated data from post.
>> private function linkingUser( & $data )
>> {
>> // Get the service, which loads the required classes.
>> $managedCustomerService =
>> $this->user->GetService('ManagedCustomerService', 
>> ADWORDS_VERSION);
>>
>> $link = new ManagedCustomerLink();
>> $link->clientCustomerId = $data["clientId"]; //CLIENT_CID;
>> $link->pendingDescriptiveName = "PENDING: " . $data["clientId"];
>> $link->linkStatus = 'PENDING';
>> $link->managerCustomerId = $this->user->GetClientCustomerId(); 
>> //MANAGER_CID;
>> 
>> // Create operation.
>> $operation = new LinkOperation();
>> 
>> $operation->operand = $link;
>> $operation->operator = 'ADD';
>>
>> $operations = array(  $operation );
>>
>> try
>> {
>> // Make the mutate request.
>> $result = $managedCustomerService->mutate( $operations );
>> }
>> catch (Exception $e) {
>> $message = $e->getMessage();
>> $this->errors[] = $message;
>> return FALSE;
>> }
>> 
>> if( empty( $result->value[0] ) )
>> {
>> $error = "Linking failed (garfx)." ;
>> $this->errors[] = $error;
>> return FALSE;
>> }
>> 
>> return $result->value[0];
>> }
>> Probleme 1.)
>> The result from "catch" section is: {"error" : "unauthorized_client"}
>>
>> Probleme 2.)
>> curl probleme in API: 
>> Warning: curl_setopt(): CURLOPT_FOLLOWLOCATION cannot be activated when 
>> an open_basedir is set in /var/www/vhosts/
>> grafxsoftware.com/httpdocs/gapi/src/Google/Api/Ads/Common/Util/CurlUtils.php 
>> on line 107
>>
>> Thanks for helping.
>>
>> Grafx.
>>
>>
>>
>>
>> -
>> On Friday, May 23, 2014 4:15:49 PM UTC+3, sup...@grafxsoftware.com wrote:
>>>
>>> Hi!
>>>
>>> I tried to link an account with this code in php AdWords api:
>>>
>>> private function linkingUser( & $data )
>>> {
>>> 
>>> // Get the service, which loads the required classes.
>>> $managedCustomerService =
>>> $this->user->GetService('ManagedCustomerService', 
>>> ADWORDS_VERSION);
>>>
>>>
>>> $link = new ManagedCustomerLink();
>>> $link->clientCustomerId = $data["go

Re: Linking account by PHP api

2014-05-27 Thread Michael Cloonan (AdWords API Team)
Hello,

This sounds like it may be a bug with our PHP library, or with a 
configuration on your server that conflicts with our PHP library.

Could you open a bug for this issue at our library page on 
GitHub? 
They will be able to better assist you there with the client-library 
specific concern.

Regards,
Mike, AdWords API Team

On Monday, May 26, 2014 11:05:11 AM UTC-4, sup...@grafxsoftware.com wrote:
>
> Hi! 
>
> Thanks for the answer!
> I tried to link an account with php AdWords api (v201309):
> Now the clientCustomerId is the id of the client, and the 
> managerCustomerId = $this->user->GetClientCustomerId();
> $this->user is the user of my MCC account. ( Like in the examples $user )
>
> The code is:
> // $data is prevalidated data from post.
> private function linkingUser( & $data )
> {
> // Get the service, which loads the required classes.
> $managedCustomerService =
> $this->user->GetService('ManagedCustomerService', 
> ADWORDS_VERSION);
>
> $link = new ManagedCustomerLink();
> $link->clientCustomerId = $data["clientId"]; //CLIENT_CID;
> $link->pendingDescriptiveName = "PENDING: " . $data["clientId"];
> $link->linkStatus = 'PENDING';
> $link->managerCustomerId = $this->user->GetClientCustomerId(); 
> //MANAGER_CID;
> 
> // Create operation.
> $operation = new LinkOperation();
> 
> $operation->operand = $link;
> $operation->operator = 'ADD';
>
> $operations = array(  $operation );
>
> try
> {
> // Make the mutate request.
> $result = $managedCustomerService->mutate( $operations );
> }
> catch (Exception $e) {
> $message = $e->getMessage();
> $this->errors[] = $message;
> return FALSE;
> }
> 
> if( empty( $result->value[0] ) )
> {
> $error = "Linking failed (garfx)." ;
> $this->errors[] = $error;
> return FALSE;
> }
> 
> return $result->value[0];
> }
> Probleme 1.)
> The result from "catch" section is: {"error" : "unauthorized_client"}
>
> Probleme 2.)
> curl probleme in API: 
> Warning: curl_setopt(): CURLOPT_FOLLOWLOCATION cannot be activated when an 
> open_basedir is set in /var/www/vhosts/
> grafxsoftware.com/httpdocs/gapi/src/Google/Api/Ads/Common/Util/CurlUtils.phpon
>  line 107
>
> Thanks for helping.
>
> Grafx.
>
>
>
>
> -
> On Friday, May 23, 2014 4:15:49 PM UTC+3, sup...@grafxsoftware.com wrote:
>>
>> Hi!
>>
>> I tried to link an account with this code in php AdWords api:
>>
>> private function linkingUser( & $data )
>> {
>> 
>> // Get the service, which loads the required classes.
>> $managedCustomerService =
>> $this->user->GetService('ManagedCustomerService', 
>> ADWORDS_VERSION);
>>
>>
>> $link = new ManagedCustomerLink();
>> $link->clientCustomerId = $data["googleClientId"];//CLIENT_CID;
>> $link->pendingDescriptiveName = "";
>> $link->linkStatus = 'PENDING';
>> $link->managerCustomerId = $data["googleClientId"];//MANAGER_CID;
>> 
>> // Create operation.
>> $operation2 = new LinkOperation();
>> 
>> $operation2->operand = $link;
>> $operation2->operator = 'ADD';
>>
>> $operations = array( $operation2);
>> 
>> 
>> 
>> try
>> {
>> // Make the mutate request.
>> $result = $managedCustomerService->mutate( $operations );
>> }
>> catch (Exception $e) {
>> $this->errors[] = $this->parseAdWordsError( $e->getMessage() 
>> );
>> return FALSE;
>> }
>> 
>> 
>> if( empty( $result->value[0] ) )
>> {
>> $error = "AdWordsUser not created (garfx)." ;
>> $this->errors[] = $error;
>> return FALSE;
>> }
>> 
>> return $result->value[0];
>> }
>> 
>> The response was: 
>>
>> [RequiredError.REQUIRED @ operations[0].operand.customerCurrencyCode, 
>> RequiredError.REQUIRED @ operations[0].operand.clientName, 
>> RequiredError.REQUIRED @ operations[0].operand.dateTimeZone]
>>
>> Please help me. What is wrong with my code?
>>
>> Thx.
>>
>

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

Re: Linking account by PHP api

2014-05-26 Thread support
Hi! 

Thanks for the answer!
I tried to link an account with php AdWords api (v201309):
Now the clientCustomerId is the id of the client, and the managerCustomerId 
= $this->user->GetClientCustomerId();
$this->user is the user of my MCC account. ( Like in the examples $user )

The code is:
// $data is prevalidated data from post.
private function linkingUser( & $data )
{
// Get the service, which loads the required classes.
$managedCustomerService =
$this->user->GetService('ManagedCustomerService', 
ADWORDS_VERSION);

$link = new ManagedCustomerLink();
$link->clientCustomerId = $data["clientId"]; //CLIENT_CID;
$link->pendingDescriptiveName = "PENDING: " . $data["clientId"];
$link->linkStatus = 'PENDING';
$link->managerCustomerId = $this->user->GetClientCustomerId(); 
//MANAGER_CID;

// Create operation.
$operation = new LinkOperation();

$operation->operand = $link;
$operation->operator = 'ADD';

$operations = array(  $operation );

try
{
// Make the mutate request.
$result = $managedCustomerService->mutate( $operations );
}
catch (Exception $e) {
$message = $e->getMessage();
$this->errors[] = $message;
return FALSE;
}

if( empty( $result->value[0] ) )
{
$error = "Linking failed (garfx)." ;
$this->errors[] = $error;
return FALSE;
}

return $result->value[0];
}
Probleme 1.)
The result from "catch" section is: {"error" : "unauthorized_client"}

Probleme 2.)
curl probleme in API: 
Warning: curl_setopt(): CURLOPT_FOLLOWLOCATION cannot be activated when an 
open_basedir is set in 
/var/www/vhosts/grafxsoftware.com/httpdocs/gapi/src/Google/Api/Ads/Common/Util/CurlUtils.php
 
on line 107

Thanks for helping.

Grafx.



-
On Friday, May 23, 2014 4:15:49 PM UTC+3, sup...@grafxsoftware.com wrote:
>
> Hi!
>
> I tried to link an account with this code in php AdWords api:
>
> private function linkingUser( & $data )
> {
> 
> // Get the service, which loads the required classes.
> $managedCustomerService =
> $this->user->GetService('ManagedCustomerService', 
> ADWORDS_VERSION);
>
>
> $link = new ManagedCustomerLink();
> $link->clientCustomerId = $data["googleClientId"];//CLIENT_CID;
> $link->pendingDescriptiveName = "";
> $link->linkStatus = 'PENDING';
> $link->managerCustomerId = $data["googleClientId"];//MANAGER_CID;
> 
> // Create operation.
> $operation2 = new LinkOperation();
> 
> $operation2->operand = $link;
> $operation2->operator = 'ADD';
>
> $operations = array( $operation2);
> 
> 
> 
> try
> {
> // Make the mutate request.
> $result = $managedCustomerService->mutate( $operations );
> }
> catch (Exception $e) {
> $this->errors[] = $this->parseAdWordsError( $e->getMessage() );
> return FALSE;
> }
> 
> 
> if( empty( $result->value[0] ) )
> {
> $error = "AdWordsUser not created (garfx)." ;
> $this->errors[] = $error;
> return FALSE;
> }
> 
> return $result->value[0];
> }
> 
> The response was: 
>
> [RequiredError.REQUIRED @ operations[0].operand.customerCurrencyCode, 
> RequiredError.REQUIRED @ operations[0].operand.clientName, 
> RequiredError.REQUIRED @ operations[0].operand.dateTimeZone]
>
> Please help me. What is wrong with my code?
>
> Thx.
>

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


Re: Linking account by PHP api

2014-05-23 Thread Michael Cloonan (AdWords API Team)
Hello,

It looks like you're using the same CID for both clientCustomerId and 
managerCustomerId, which is not correct. The ManagedCustomerLink is useful 
for linking two pre-existing accounts together. If you only have one ID 
available, then you should most likely be creating a new ManagedCustomer 
instead.

You can see an example of how to do that in PHP 
here
.

Alternatively, if you really do have an MCC account and a client account 
you would like to link, be sure to use the correct IDs in those two fields 
to set up the link properly. I think the error you're seeing is likely 
because you put an MCC id in the clientCustomerId field, and then the 
required fields weren't found on the existing account.

Regards,
Mike, AdWords API Team


On Friday, May 23, 2014 9:15:49 AM UTC-4, sup...@grafxsoftware.com wrote:
>
> Hi!
>
> I tried to link an account with this code in php AdWords api:
>
> private function linkingUser( & $data )
> {
> 
> // Get the service, which loads the required classes.
> $managedCustomerService =
> $this->user->GetService('ManagedCustomerService', 
> ADWORDS_VERSION);
>
>
> $link = new ManagedCustomerLink();
> $link->clientCustomerId = $data["googleClientId"];//CLIENT_CID;
> $link->pendingDescriptiveName = "";
> $link->linkStatus = 'PENDING';
> $link->managerCustomerId = $data["googleClientId"];//MANAGER_CID;
> 
> // Create operation.
> $operation2 = new LinkOperation();
> 
> $operation2->operand = $link;
> $operation2->operator = 'ADD';
>
> $operations = array( $operation2);
> 
> 
> 
> try
> {
> // Make the mutate request.
> $result = $managedCustomerService->mutate( $operations );
> }
> catch (Exception $e) {
> $this->errors[] = $this->parseAdWordsError( $e->getMessage() );
> return FALSE;
> }
> 
> 
> if( empty( $result->value[0] ) )
> {
> $error = "AdWordsUser not created (garfx)." ;
> $this->errors[] = $error;
> return FALSE;
> }
> 
> return $result->value[0];
> }
> 
> The response was: 
>
> [RequiredError.REQUIRED @ operations[0].operand.customerCurrencyCode, 
> RequiredError.REQUIRED @ operations[0].operand.clientName, 
> RequiredError.REQUIRED @ operations[0].operand.dateTimeZone]
>
> Please help me. What is wrong with my code?
>
> Thx.
>

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


Linking account by PHP api

2014-05-23 Thread support
Hi!

I tried to link an account with this code in php AdWords api:

private function linkingUser( & $data )
{

// Get the service, which loads the required classes.
$managedCustomerService =
$this->user->GetService('ManagedCustomerService', 
ADWORDS_VERSION);


$link = new ManagedCustomerLink();
$link->clientCustomerId = $data["googleClientId"];//CLIENT_CID;
$link->pendingDescriptiveName = "";
$link->linkStatus = 'PENDING';
$link->managerCustomerId = $data["googleClientId"];//MANAGER_CID;

// Create operation.
$operation2 = new LinkOperation();

$operation2->operand = $link;
$operation2->operator = 'ADD';

$operations = array( $operation2);



try
{
// Make the mutate request.
$result = $managedCustomerService->mutate( $operations );
}
catch (Exception $e) {
$this->errors[] = $this->parseAdWordsError( $e->getMessage() );
return FALSE;
}


if( empty( $result->value[0] ) )
{
$error = "AdWordsUser not created (garfx)." ;
$this->errors[] = $error;
return FALSE;
}

return $result->value[0];
}

The response was: 

[RequiredError.REQUIRED @ operations[0].operand.customerCurrencyCode, 
RequiredError.REQUIRED @ operations[0].operand.clientName, 
RequiredError.REQUIRED @ operations[0].operand.dateTimeZone]

Please help me. What is wrong with my code?

Thx.

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