Hi,

I'm trying to link a customer to my MCC account through my website services.
Here the PHP code:

// Generate a refreshable OAuth2 credential for authentication.
$oAuth2Credential = (new OAuth2TokenBuilder())
    ->withClientId(self::MANAGER_CLIENT_ID)
    ->withClientSecret(self::MANAGER_CLIENT_SECRET)
    ->withRefreshToken(self::MANAGER_REFRESH_TOKEN)
    ->build();

// Construct an API session configured from a properties file and the OAuth2
// credentials above.
$session = (new AdWordsSessionBuilder())
    ->withOAuth2Credential($oAuth2Credential)
    ->withDeveloperToken(self::MANAGER_DEV_TOKEN)
    ->withClientCustomerId(self::MANAGER_CLIENT_CUSTOMER_ID)
    ->build();

$adWordsServices = new AdWordsServices();

/**
 * @var ManagedCustomerService $managedCustomerService
 */
$managedCustomerService = $adWordsServices->get($session, 
ManagedCustomerService::class);

$linkOp = new LinkOperation();
$link = new ManagedCustomerLink();

$link->setClientCustomerId(self::CLIENT_CID);
$link->setLinkStatus(LinkStatus::PENDING);
$link->setManagerCustomerId(self::MANAGER_CLIENT_CUSTOMER_ID);
$linkOp->setOperand($link);
$linkOp->setOperator(Operator::ADD);
$mutateLinkResults = $managedCustomerService->mutateLink([$linkOp]);
return $mutateLinkResults;


please help :)

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

You received this message because you are subscribed to the Google
Groups "AdWords API and Google Ads API Forum" group.
To post to this group, send email to adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"AdWords API and Google Ads API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
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/16c0cf77-e286-420a-b802-d3f8007b2360%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
  • ... zemen
    • ... 'Luis Xander Talag (AdWords API Team)' via AdWords API and Google Ads API Forum
    • ... zemen
      • ... 'Luis Xander Talag (AdWords API Team)' via AdWords API and Google Ads API Forum
    • ... zemen
      • ... 'Dannison Yao (AdWords API Team)' via AdWords API and Google Ads API Forum

Reply via email to