I’m trying to make a getmyebayselling request so I can track the prices and quantities of current listings.
Following the docs and sample here I generated a token and tried sending a request to the production XML to see my current listings.
Current attempt:
endpoint = "https://api.ebay.com/ws/api.dll"
xml = """<?xml version="1.0" encoding="utf-8"?>
<GetMyeBaySellingRequest xmlns="urn:ebay:apis:eBLBaseComponents">
<RequesterCredentials>
<eBayAuthToken>AgAAAA*...full auth token here...wIAYMEFWl</eBayAuthToken>
</RequesterCredentials>
<Version>967</Version>
<ActiveList>
<Sort>TimeLeft</Sort>
<Pagination>
<EntriesPerPage>3</EntriesPerPage>
<PageNumber>1</PageNumber>
</Pagination>
</ActiveList>
</GetMyeBaySellingRequest>"""
headers = {'Content-Type': 'application/xml'}
response = requests.post(endpoint, data=xml, headers=headers)
print response
print response.content
The response:
<?xml version="1.0" encoding="UTF-8" ?><GeteBayOfficialTimeResponse xmlns="urn:ebay:apis:eBLBaseComponents"><Timestamp>2017-04-17 13:01:25</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>18007282</Build></GeteBayOfficialTimeResponse>
The useful part of that response:
The API call "GeteBayOfficialTime" is invalid or not supported in this release.
I’m working from a sample of their own docs here. The only link to time I could really see was <Sort>TimeLeft</Sort>
which was a stretch but even without that I get the same response.
I was faffing around with different Python libs trying to get a getmyebayselling request working without much documentation. Now going by the docs from eBay themselves I’m feeling pretty dead in the water. If anyone can nudge me in the right direction I’d appreciate it. Not really sure what to try next.
2
Answers
The API response error is a little less than helpful, but judging by the code you shared you are making the request with missing required header fields. More details here
The following change should point you in the right direction –
Suddenly I started getting the error message:
But I was not calling GeteBayOfficialTime! I had a problem, but the error message was misleading.
To make sure you get the post headers and content right, the build test tool is absolutely helpful:
ebay developer build test tool
After hours of troubleshooting, I finally figured out my problem: I was passing the required headers in the query string, not as http request headers! For over a year, it worked OK, but then suddenly it stopped working.
Moral: the invalid “GeteBayOfficialTime” API call message indicates a problem with the http headers.