Cannot set Name to Image

23 views
Skip to first unread message

高橋秀平

unread,
Jan 19, 2018, 5:37:21 AM1/19/18
to AdWords API Forum
Hello

I want to set name to Images when I upload them with MediaService#upload.
But name field in response is empty.
How to set name to Images?

request

<?xml version="1.0" encoding="UTF-8"?>
  <soapenv:Header>
    <ns1:RequestHeader soapenv:mustUnderstand="0" xmlns:ns1="https://adwords.google.com/api/adwords/cm/v201710">
      <ns1:clientCustomerId>xxx-xxx-xxxx</ns1:clientCustomerId>
      <ns1:developerToken>xxxxxxx</ns1:developerToken>
      <ns1:userAgent>xxxx</ns1:userAgent>
      <ns1:validateOnly>false</ns1:validateOnly>
      <ns1:partialFailure>true</ns1:partialFailure>
    </ns1:RequestHeader>
  </soapenv:Header>
  <soapenv:Body>
      <media xsi:type="ns2:Image" xmlns:ns2="https://adwords.google.com/api/adwords/cm/v201710">
        <ns2:type>IMAGE</ns2:type>
        <ns2:name>myimage</ns2:name>
        <ns2:data>/9j/4AA...</ns2:data>
      </media>
    </upload>
  </soapenv:Body>
</soapenv:Envelope>


response

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Header>
      <requestId>xxxxxx</requestId>
      <serviceName>MediaService</serviceName>
      <methodName>upload</methodName>
      <operations>1</operations>
      <responseTime>225</responseTime>
    </ResponseHeader>
  </soap:Header>
  <soap:Body>
      <rval xsi:type="Image" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
        <mediaId>xxxxxx</mediaId>
        <type>IMAGE</type>
        <referenceId>-xxxxxx</referenceId>
        <dimensions>
          <key>FULL</key>
          <value>
            <width>640</width>
            <height>100</height>
          </value>
        </dimensions>
        <urls>
          <key>FULL</key>
        </urls>
        <mimeType>IMAGE_JPEG</mimeType>
        <sourceUrl/>
        <name/>
        <fileSize>9442</fileSize>
        <Media.Type>Image</Media.Type>
      </rval>
    </uploadResponse>
  </soap:Body>
</soap:Envelope>


高橋秀平

unread,
Jan 19, 2018, 5:37:32 AM1/19/18
to AdWords API Forum

Bharani Cherukuri (AdWords API Team)

unread,
Jan 19, 2018, 1:51:16 PM1/19/18
to AdWords API Forum
Hello, 

I was able to test uploading the an image with name on my end and attached the SOAP logs for the same. Please refer to this code sample as a reference. If you continue to have an issue with this, could you share us details about the client library version used along with the complete logs which have the request Id? This information will help us with our investigation. Please use Reply privately to author option to share the details.

Regards,
Bharani, AdWords API Team
SampleImageLogs.rtf
Reply all
Reply to author
Forward
0 new messages