Hi Dennison, I'm trying to link accounts with API PHP v201809.
namespace Google\AdsApi\Examples\AdWords\v201809\AccountManagement;
require __DIR__ . '/vendor/autoload.php';
use Google\AdsApi\AdWords\AdWordsServices;
use Google\AdsApi\AdWords\AdWordsSession;
use Google\AdsApi\AdWords\AdWordsSessionBuilder;
use Google\AdsApi\AdWords\v201809\cm\Selector;
use Google\AdsApi\AdWords\v201809\cm\Predicate;
use Google\AdsApi\AdWords\v201809\cm\Operator;
use Google\AdsApi\AdWords\v201809\mcm\CustomerService;
use Google\AdsApi\AdWords\v201809\mcm\ServiceLink;
use Google\AdsApi\AdWords\v201809\mcm\ServiceLinkLinkStatus;
use Google\AdsApi\AdWords\v201809\mcm\ServiceLinkOperation;
use Google\AdsApi\AdWords\v201809\mcm\ServiceType;
use Google\AdsApi\Common\OAuth2TokenBuilder;
// Generate a refreshable OAuth2 credential for authentication.
$oAuth2Credential = (new OAuth2TokenBuilder())->fromFile()->build();
// Construct an API session configured from a properties file and
the
// OAuth2 credentials above.
$session = (new
AdWordsSessionBuilder())->fromFile()->withOAuth2Credential($oAuth2Credential)->build();
$adWordsServices = new AdWordsServices();
$customerService = $adWordsServices->get($session, CustomerService::class);
$serviceLinkId = "xxx-xxx-xxxx";
// Create service link.
$serviceLink = new ServiceLink();
$serviceLink->setServiceLinkId($serviceLinkId);
$serviceLink->setServiceType(ServiceType::UNKNOWN);
$serviceLink->setLinkStatus(ServiceLinkLinkStatus::ACTIVE);
// Create a service link operation and add it to the list.
$operations = [];
$operation = new ServiceLinkOperation();
$operation->setOperator(Operator::SET);
$operation->setOperand($serviceLink);
$operations[] = $operation;
// Accept service links on the server and print out some information about
// accepted service links.
$serviceLinks = $customerService->mutateServiceLinks($operations); // Gibt
Fehler 500
I get 500 error and this is what's in the soap.log file
[2019-04-12 07:11:26] AW_SOAP.WARNING: clientCustomerId=yyy-yyy-yyyy
operations=1 service=CustomerService method=mutateServiceLinks
responseTime=257 requestId=0005865002d05c1c0a8585d6c1014cfd
server=adwords.google.com isFault=1
faultMessage=[InternalApiError.UNEXPECTED_INTERNAL_API_ERROR @
com.google.ads.api.services.common.error.InternalApiError.<init>(InternalApiErro]
[2019-04-12 07:11:26] AW_SOAP.NOTICE: POST
/api/adwords/mcm/v201809/CustomerService?wsdl HTTP/1.1
Host: adwords.google.com
Connection: close
User-Agent: PHP-SOAP/7.2.15-0ubuntu0.18.04.2
Content-Type: text/xml; charset=utf-8
SOAPAction: ""
Content-Length: 949
Authorization: REDACTED
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:ns1="https://adwords.google.com/api/adwords/cm/v201809"
xmlns:ns2="https://adwords.google.com/api/adwords/mcm/v201809"><SOAP-ENV:Header><ns2:RequestHeader><ns1:clientCustomerId>948-211-5893</ns1:clientCustomerId><ns1:developerToken>REDACTED</ns1:developerToken><ns1:userAgent>AdConnector
(AwApi-PHP, googleads-php-lib/39.0.0,
PHP/7.2.15-0ubuntu0.18.04.2)</ns1:userAgent><ns1:validateOnly>false</ns1:validateOnly><ns1:partialFailure>false</ns1:partialFailure></ns2:RequestHeader></SOAP-ENV:Header><SOAP-ENV:Body><ns2:mutateServiceLinks><ns2:operations><ns1:operator>SET</ns1:operator><ns2:operand><ns2:serviceType>UNKNOWN</ns2:serviceType><ns2:serviceLinkId>550</ns2:serviceLinkId><ns2:linkStatus>ACTIVE</ns2:linkStatus></ns2:operand></ns2:operations></ns2:mutateServiceLinks></SOAP-ENV:Body></SOAP-ENV:Envelope>
HTTP/1.1 500 Internal Server Error
Content-Type: text/xml; charset=UTF-8
Date: Fri, 12 Apr 2019 07:11:26 GMT
Expires: Fri, 12 Apr 2019 07:11:26 GMT
Cache-Control: private, max-age=0
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 1; mode=block
Server: GSE
Alt-Svc: quic=":443"; ma=2592000; v="46,44,43,39"
Accept-Ranges: none
Vary: Accept-Encoding
Connection: close
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Header><ResponseHeader
xmlns:ns2="https://adwords.google.com/api/adwords/cm/v201809"
xmlns="https://adwords.google.com/api/adwords/mcm/v201809">
<ns2:requestId>0005865002d05c1c0a8585d6c1014cfd</ns2:requestId>
<ns2:serviceName>CustomerService</ns2:serviceName>
<ns2:methodName>mutateServiceLinks</ns2:methodName>
<ns2:operations>1</ns2:operations>
<ns2:responseTime>257</ns2:responseTime></ResponseHeader></soap:Header>
<soap:Body><soap:Fault><faultcode>soap:Server</faultcode>
<faultstring>[InternalApiError.UNEXPECTED_INTERNAL_API_ERROR @
com.google.ads.api.services.common.error.InternalApiError.<init>(InternalApiErro]</faultstring>
<detail><ApiExceptionFault
xmlns="https://adwords.google.com/api/adwords/mcm/v201809"
xmlns:ns2="https://adwords.google.com/api/adwords/cm/v201809"><ns2:message>[InternalApiError.UNEXPECTED_INTERNAL_API_ERROR
@
com.google.ads.api.services.common.error.InternalApiError.<init>(InternalApiErro]</ns2:message><ns2:ApplicationException.Type>ApiException</ns2:ApplicationException.Type><ns2:errors
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:type="ns2:InternalApiError"><ns2:fieldPath></ns2:fieldPath>
<ns2:trigger></ns2:trigger>
<ns2:errorString>InternalApiError.UNEXPECTED_INTERNAL_API_ERROR</ns2:errorString>
<ns2:ApiError.Type>InternalApiError</ns2:ApiError.Type>
<ns2:reason>UNEXPECTED_INTERNAL_API_ERROR</ns2:reason></ns2:errors></ApiExceptionFault></detail></soap:Fault></soap:Body></soap:Envelope>
пятница, 12 апреля 2019 г., 8:40:39 UTC+2 пользователь
googleadsapi-forumadvisor написал:
>
> Hi,
>
> I am a colleague of Dave, allow me to provide assistance for your
> concerns. Could you confirm if you are also encountering the 500 error
> issue? If yes, I would suggest to open your concern in the Ruby Github
> Issue tracker <https://github.com/googleads/google-ads-ruby/issues> as
> the client library owners are better equipped in answering your concerns.
> At the same time, I will file a feature request on your behalf to add
> sample codes of different languages in the Google Ads API documentation.
>
> If you are encountering a different issue, could you provide the JSON
> request and response logs via *reply privately to author* so I could
> further investigate this?
>
> Regards,
> Dannison
> 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/11/19 21:41:01 [email protected] <javascript:> wrote:
>
> Hi, i use the ruby library and i also can not link accounts with the new
> API, looks like the ManagerCustomerLink service has problems.
> I agree that an example in all client libraries can be useful.
> Thanks.
>
> El jueves, 11 de abril de 2019, 8:26:54 (UTC+2), googleadsapi-forumadvisor
> escribió:
>
> Hi,
>
> Upon checking, the error that you are encountering seems to be related
> more to the client library. You can reach out to the php client library
> owners through this link
> <https://github.com/googleads/google-ads-php/issues> in Github as they
> are better equipped to assist you for this matter.
>
> 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/10/19 19:02:40 [email protected] wrote:
>
> 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->getCustomerC
> lientLinkServiceClient();
>
> $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
>
>
>
--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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/8bd44960-5fe1-4a40-82b6-2a433cbcca5e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.