Hello Dave,

I'm trying to use  code to link Adwords accounts. I get 500 error from 
server. 

require __DIR__ . '/vendor/autoload.php';

use GetOpt\GetOpt;
use Google\Auth\CredentialsLoader;
use Google\Auth\OAuth2;
use Psr\Http\Message\ServerRequestInterface;
use React\EventLoop\Factory;
use React\Http\Response;
use React\Http\Server;
use UnexpectedValueException;

use Google\Ads\GoogleAds\Examples\Utils\ArgumentNames;
use Google\Ads\GoogleAds\Examples\Utils\ArgumentParser;
use Google\Ads\GoogleAds\Lib\V1\GoogleAdsClient;
use Google\Ads\GoogleAds\Lib\V1\GoogleAdsClientBuilder;
use Google\Ads\GoogleAds\Lib\V1\GoogleAdsException;
use Google\Ads\GoogleAds\Lib\OAuth2TokenBuilder;
use Google\Ads\GoogleAds\V1\Errors\GoogleAdsError;
use Google\Ads\GoogleAds\V1\Services\GoogleAdsRow;
use Google\ApiCore\ApiException;
use Google\Ads\GoogleAds\V1\Resources\Customer;
use Google\Ads\GoogleAds\V1\Resources\CustomerManagerLink;


 $oAuth2Credential = (new OAuth2TokenBuilder())->fromFile()->build();

        // Construct a Google Ads client configured from a properties file 
and the
       // OAuth2 credentials above.
       $googleAdsClient = (new GoogleAdsClientBuilder())
           ->fromFile()
           ->withOAuth2Credential($oAuth2Credential)
           ->build();

$customerId = "1234112123";  /* Example */

$customerClientLinkServiceClient = $googleAdsClient->
getCustomerClientLinkServiceClient();

$customerClientLink = new CustomerClientLink([
                                         "client_customer" => new 
StringValue(['value' => $customerId]),
                                         "status"                  => 
ManagerLinkStatus::PENDING
                                        ]);


If I remove a piece of code, then there is no error 500

$customerClientLink = new CustomerClientLink([
                                         "client_customer" => new 
StringValue(['value' => $customerId]),
                                         "status"                  => 
ManagerLinkStatus::PENDING
                                        ]);

I think the problem is with new CustomerClientLink. 

[LOGGING]
; Optional logging settings.
logFilePath = "/xxx/xxx/xxxxx/xxxxxx.xx/xxxxx/google-ads/file.log"
logLevel = "INFO"

file.log is empty. 



среда, 10 апреля 2019 г., 7:55:11 UTC+2 пользователь 
googleadsapi-forumadvisor написал:
>
> Hi,
>
> To further investigate this, could you confirm if you will still encounter 
> the error when you try to run other Google Ads API service? If yes, could 
> you provide the complete JSON request and response logs when you 
> encountered the error? If you haven't enabled logging yet, you could enable 
> it by following this guide 
> <https://developers.google.com/google-ads/api/docs/client-libs/php/logging>
> .
>
> Moving forward, I may not provide you a sample code in PHP. I can only 
> point you to the documentation that you might be able to use regarding your 
> concern.
>
> Regards,
> Dave Paurillo
> Google Ads API Team
>
>
> =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
> Also find us on our blog and discussion group:
>     https://ads-developers.googleblog.com/search/label/google_ads_api
>     https://developers.google.com/adwords/api/community/
> =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
>
> Was your question answered? Please rate your experience with us by taking 
> a short survey.
> If not -- reply to this email and tell us what else we can do to help.
>
> Take Survey 
> <https://support.google.com/google-ads/contact/survey_transactional?caseid=0-7203000025673&hl=en&ctx=1>
>
> Also find us on our blog and discussion group:
> http://googleadsdeveloper.blogspot.com/search/label/adwords_api
> https://developers.google.com/adwords/api/community/
> On 04/09/19 16:16:35 [email protected] <javascript:> wrote:
>
> Hello,
> thank you for answer. Very little information. Could you point to a sample 
> code?
>
> среда, 27 марта 2019 г., 8:57:36 UTC+1 пользователь 
> googleadsapi-forumadvisor написал:
>
> Hi,
>
> Thank you for reaching out. To be able to manage relationship between 
> accounts, you could check CustomerManagerLinkService 
> <https://developers.google.com/google-ads/api/reference/rpc/google.ads.googleads.v1.services#google.ads.googleads.v1.services.CustomerManagerLinkService>
>  and 
> use MutateCustomerManagerLink method in managing the relationship between 
> manager and customer.
>
> Let me know if this answers your concern. Should you have further 
> clarifications, feel free to write back.
>
>
> Regards,
> Dave Paurillo
> Google Ads API Team
>
>
> =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
> Also find us on our blog and discussion group:
>     http://googleadsdeveloper.blogspot.com/search/label/adwords_api
>     https://developers.google.com/adwords/api/community/
> =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
>
> Was your question answered? Please rate your experience with us by taking 
> a short survey.
> If not -- reply to this email and tell us what else we can do to help.
>
> Take Survey 
> <https://support.google.com/google-ads/contact/survey_transactional?caseid=0-7203000025673&hl=en&ctx=1>
>
> Also find us on our blog and discussion group:
> http://googleadsdeveloper.blogspot.com/search/label/adwords_api
> https://developers.google.com/adwords/api/community/
> On 03/26/19 21:39:20 [email protected] wrote:
>
> Hi,
> How to do it in the new version of google ads api v1 (Client library php) 
> ? No information in the documentation or I looked bad. It is necessary to 
> allow the Google account manager account to make changes to the account of 
> another user. 
> So, I need to manage the relationship between accounts. Please help with 
> this question.  Thank
>
> -- 
> -- 
> =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
> 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 [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> 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 [email protected].
> 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/a3a00fa9-42c1-497e-add7-1d12f9cb33da%40googlegroups.com 
> <https://groups.google.com/d/msgid/adwords-api/a3a00fa9-42c1-497e-add7-1d12f9cb33da%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>
> -- 
> -- 
> =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
> 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 [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> 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 [email protected].
> 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/208e5d54-c710-45ab-859e-cb9612e2068c%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/adwords-api/208e5d54-c710-45ab-859e-cb9612e2068c%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>
>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 [email protected]
To unsubscribe from this group, send email to
[email protected]
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 [email protected].
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/0723c44a-a8e3-4799-8f1a-c43db5894348%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
  • Manage ... Непомнющий Александр
    • RE... googleadsapi-forumadvisor via AdWords API and Google Ads API Forum
      • ... Непомнющий Александр
        • ... googleadsapi-forumadvisor via AdWords API and Google Ads API Forum
          • ... Непомнющий Александр
            • ... googleadsapi-forumadvisor via AdWords API and Google Ads API Forum
              • ... javoeria
                • ... googleadsapi-forumadvisor via AdWords API and Google Ads API Forum
                • ... Непомнющий Александр
                • ... googleadsapi-forumadvisor via AdWords API and Google Ads API Forum
                • ... Непомнющий Александр
                • ... googleadsapi-forumadvisor via AdWords API and Google Ads API Forum

Reply via email to