Search code examples
pythonebay-api

Ebay API: Failure, UUID required


I'm trying to get the active inventory for a client's Ebay store using the LMS Bulk Data Exchange API in Python.

import requests
token = "<user-token>"
headers = {"X-EBAY-SOA-OPERATION-NAME":"startDownloadJob", "X-EBAY-SOA-SECURITY-TOKEN":token}
r = requests.get('https://webservices.ebay.com/BulkDataExchangeService', headers = headers)
print r.text

The "user-token" is the long token provided under account settings, production keys.

However I get the following error:

<?xml version='1.0' encoding='UTF-8'?><startDownloadJobResponse xmlns="http://www.ebay.com/marketplace/services"><ack>Failure</ack><errorMessage><error><errorId>9</errorId><domain>Marketplace</domain><severity>Error</severity><category>Application</category><message>UUID is required</message><subdomain>BulkDataExchange</subdomain></error></errorMessage><version>1.5.0</version><timestamp>2016-01-28T08:52:52.987Z</timestamp></startDownloadJobResponse>

Solution

  • Copied from a C# example, the UUID is a unique one time use value. In the C# bulk data exchange example I am using, it is populated as follows:

    StartDownloadJobRequest req = new StartDownloadJobRequest();
    req.downloadJobType = ReportType;
    
    //Generate a UUID. UUID must be unique.  Once used, you can't use it again
    req.UUID = System.Guid.NewGuid().ToString();
    

    That is verbatim from code listed on eBay Developers network.

    The following may be useful in porting over to Python.

    GUID Creation in Python -- Stack Overflow Thread