首页 > 解决方案 > Python XML eBay API 调用

问题描述

我似乎在 eBay API 上运行调用时遇到问题。无论我扔什么,我都会得到相同的输出。

import requests

xml ="""<?xml version="1.0" encoding="utf-8"?>
<GetBestOffersRequest xmlns="urn:ebay:apis:eBLBaseComponents">
 <<RequesterCredentials>
   <eBayAuthToken>'inserted actual token here'</eBayAuthToken>
 </RequesterCredentials>
</GetBestOffersRequest>
"""

output = requests.post("https://api.ebay.com/ws/api.dll", data = xml)

print(output.text)

我总是得到的输出是:

<?xml version="1.0" encoding="UTF-8" ?>
<GeteBayOfficialTimeResponse xmlns="urn:ebay:apis:eBLBaseComponents">
<Timestamp>2020-12-23 05:20:07</Timestamp>
<Ack>Failure</Ack>
<Errors>
<ShortMessage>Unsupported API call.</ShortMessage>
<LongMessage>The API call "GeteBayOfficialTime" is invalid or not supported in this release.</LongMessage>
<ErrorCode>2</ErrorCode>
<SeverityCode>Error</SeverityCode>
<ErrorClassification>RequestError</ErrorClassification>
</Errors>
<Build>19110890</Build>
</GeteBayOfficialTimeResponse>

我究竟做错了什么?

标签: pythonxmlebay-api

解决方案


推荐阅读