1

I am using walmart partner api with python script. What I am trying to do is uploading item file using httplib. Here is my code:

file = open('/opt/item.xml', 'rb')
headers = {
        "Accept":ws_accept,
        "WM_SVC.NAME": wm_svc_name,
        "WM_CONSUMER.ID":wm_consumer_id,
        "WM_SEC.TIMESTAMP": wm_sec_timestamp,
        "WM_SEC.AUTH_SIGNATURE":wm_sec_auth_signature,
        "WM_QOS.CORRELATION_ID": wm_qos_correlation_id,
        "Content-Type": 'multipart/form-data; boundary=xxx',
        "Host":'marketplace.walmartapis.com'
      }

conn = httplib.HTTPSConnection('marketplace.walmartapis.com')
conn.request("POST", '/v2/feeds?feedType=item',file, headers)

response = conn.getresponse()
print response.status, response.reason
print 'response',response.read()

item.xml is sample file available in documention.

Response is here:

500 Internal Server Error
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
 <ns2:errors xmlns:ns2="http://walmart.com/">
   <ns2:error>
     <ns2:code>SYSTEM_ERROR.GMP_GATEWAY_API</ns2:code>
     <ns2:description>Couldn't find MIME boundary: --xxx</ns2:description>
     <ns2:info>System encountered some internal error.</ns2:info>    
     <ns2:severity>ERROR</ns2:severity>
     <ns2:category>DATA</ns2:category>
     <ns2:causes/>
     <ns2:errorIdentifiers/>
    </ns2:error>
</ns2:errors>

Hope someone familiar with walmart partner api. Otherwise suggest with multipart-boundary error and how can I fix this please help guys...

Good Lux
  • 896
  • 9
  • 19

1 Answers1

1

From my personal experience, you may want to actually ask Walmart, "Have you received my file?" I have gotten 500s and 400s from them before with their other APIs and it has gone through the first run even though the API response code was not 200.

FangerZero
  • 91
  • 1
  • 8
  • I agree, their API is still young and I've encountered so many random errors, talking to support usually helps clear some things up – Iqbal Khan Mar 27 '17 at 19:07