Media bundle (HTML5) upload using AssetService

28 views
Skip to first unread message

integrations bidalgo

unread,
Aug 21, 2019, 10:28:42 AM8/21/19
to AdWords API and Google Ads API Forum
Hi,

I’m trying again to upload HTML5 as a media bundle asset (using the example for image asset upload: https://developers.google.com/adwords/api/docs/samples/php/miscellaneous#upload-an-image-asset)

My code is like this:

public function uploadHtml5Asset($url)
{
/** @var AssetService $assetService */
$assetService = $this->googleApiClient->get($this->session,AssetService::class);
$asset = new MediaBundleAsset();
$asset->setMediaBundleData(file_get_contents($url));
$operation = new AssetOperation();
$operation->setOperand($asset);
$operation->setOperator(Operator::ADD);

return $assetService->mutate([$operation]);
}

I’m using 'https://goo.gl/9Y7qI2 as url (and this url works well when Im uploading the same media bundle using MediaService).
But when for my example Im getting error: [InternalApiError.ERROR_GENERATING_RESPONSE @ com.google.ads.api.services.common.error.InternalApiError.
SOAP log:

HTTP/1.1 500 Internal Server Error
Content-Type: text/xml; charset=UTF-8
Date: Wed, 21 Aug 2019 13:09:39 GMT
Expires: Wed, 21 Aug 2019 13:09:39 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,43,39"
Accept-Ranges: none
Vary: Accept-Encoding
Connection: close

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Header><ResponseHeader xmlns="https://adwords.google.com/api/adwords/cm/v201809"><requestId>000590a0491c22970ae9e9127408961b</requestId><serviceName>AssetService</serviceName><methodName>mutate</methodName><operations>0</operations><responseTime>440</responseTime></ResponseHeader></soap:Header><soap:Body><soap:Fault><faultcode>soap:Server</faultcode><faultstring>[InternalApiError.ERROR_GENERATING_RESPONSE @ com.google.ads.api.services.common.error.InternalApiError.&lt;init&gt;(InternalApiErro]</faultstring><detail><ApiExceptionFault xmlns="https://adwords.google.com/api/adwords/cm/v201809"><message>[InternalApiError.ERROR_GENERATING_RESPONSE @ com.google.ads.api.services.common.error.InternalApiError.&lt;init&gt;(InternalApiErro]</message><ApplicationException.Type>ApiException</ApplicationException.Type><errors xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="InternalApiError"><fieldPath></fieldPath><trigger></trigger><errorString>InternalApiError.ERROR_GENERATING_RESPONSE</errorString><ApiError.Type>InternalApiError</ApiError.Type><reason>ERROR_GENERATING_RESPONSE</reason></errors></ApiExceptionFault></detail></soap:Fault></soap:Body></soap:Envelope>

Please advise.

Reply all
Reply to author
Forward
0 new messages