【问题标题】:Post Item Walmart Partner API PythonPost Item 沃尔玛合作伙伴 API Python
【发布时间】:2016-03-15 08:26:58
【问题描述】:

我正在使用带有 python 脚本的walmart partner api。我想要做的是使用 httplib 上传项目文件。这是我的代码:

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 是文档中的示例文件。

回复在这里:

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>

希望熟悉walmart partner api的人。否则建议出现多部分边界错误,我该如何解决这个问题请帮助大家...

【问题讨论】:

  • 从哪里获得示例 xml 文件?您是否有示例 xml 文件来上传具有变体的产品?

标签: python walmart-api


【解决方案1】:

根据我的个人经验,您可能想问沃尔玛,“您收到我的文件了吗?”我之前用他们的其他 API 从他们那里得到了 500 和 400,即使 API 响应代码不是 200,它也已经完成了第一次运行。

【讨论】:

  • 我同意,他们的 API 还很年轻,而且我遇到了很多随机错误,与支持人员交谈通常有助于解决一些问题
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2021-10-21
  • 2021-02-03
  • 1970-01-01
  • 2021-07-12
  • 2021-10-29
相关资源
最近更新 更多