Hi Luis,

my bad. The oauth token was created with access_type = online. So the token 
was expired.
Now everything is working as expected.

One more questione:
is there a way to turn off the email alert to the client account to be 
managed?

Thanks in advance

Il giorno mercoledì 16 maggio 2018 23:29:01 UTC+2, zemen ha scritto:
>
> 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/ae3b2a92-c789-40eb-996c-2769dec6c95b%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