简体   繁体   English

ebay API / ebaysdk“ GetSellerList”

[英]Ebay API / ebaysdk “GetSellerList”

I'm trying to retrieve the active and completed items under a list of specified sellers. 我正在尝试检索指定卖方列表下的有效和已完成项目。 I've read a few things in a few different places, but haven't really been able to find something that I understand or anything I could work with. 我在几个不同的地方读过几本书,但实际上并没有找到我能理解的东西或可以使用的任何东西。 I think it might have something to do with my headers or maybe authentication or something, but I'm also uncertain if its just the way that I'm setting up my request. 我认为这可能与我的标头或身份验证有关,但我也不确定这是否只是我设置请求的方式。 I have only ever used the Finding API, and it looks like I need to use Trading instead, but I'm not sure what little details I might be missing when I tried to switch API's 我只使用过Finding API,看起来我需要使用Trading,但是我不确定在尝试切换API时可能会缺少哪些细节

from ebaysdk.trading import Connection as trading
api = trading(appid='API_KEY_HERE', config_file=None)

api_request = {
'keywords': 'new'}
'outputSelector': 'SellerInfo',
'itemFilter': [
    {'name': 'UserId',
    'value': 'SELLER_NAME_HERE'},
    {'name': 'StartTimeFrom',
    'value': QueryTime_Start},
    {'name': 'StartTimeTo',
    'value': QueryTime_Complete}]}

response = api.execute('GetSellerList', api_request).

and my complete error message: 和我完整的错误消息:

Traceback (most recent call last): File "C:\\Users\\dc500\\Downloads\\All 3.0\\All 3\\Python\\3Pies\\Project_Ordered Tools\\practice_getsellerlist.py", line 24, in response = api.execute('GetSellerList', api_request) File "C:\\Users\\dc500\\AppData\\Local\\Programs\\Python\\Python35\\lib\\site-packages\\ebaysdk\\connection.py", line 120, in execute self.execute_request() File "C:\\Users\\dc500\\AppData\\Local\\Programs\\Python\\Python35\\lib\\site-packages\\ebaysdk\\connection.py", line 184, in execute_request allow_redirects=True File "C:\\Users\\dc500\\AppData\\Local\\Programs\\Python\\Python35\\lib\\site-packages\\requests\\sessions.py", line 576, in send r = adapter.send(request, **kwargs) File "C:\\Users\\dc500\\AppData\\Local\\Programs\\Python\\Python35\\lib\\site-packages\\requests\\adapters.py", line 376, in send timeout=timeout File "C:\\Users\\dc500\\AppData\\Local\\Programs\\Python\\Python35\\lib\\site-packages\\requests\\packages\\urllib3\\connectionpool.py", line 559, in urlopen body=body, headers=headers) File "C:\\Users\\dc500\\AppData\\Lo 追溯(最近一次通话):文件“ C:\\ Users \\ dc500 \\ Downloads \\ All 3.0 \\ All 3 \\ Python \\ 3Pies \\ Project_Ordered Tools \\ practice_getsellerlist.py”,第24行,作为响应= api.execute('GetSellerList' ,api_request)执行self.execute_request()文件“ C:\\ Users \\ dc500 \\ AppData \\ Local \\ Programs \\ Python \\ Python35 \\ lib \\ site-packages \\ ebaysdk \\ connection.py”,行120。 “用户\\ dc500 \\ AppData \\ Local \\ Programs \\ Python \\ Python35 \\ lib \\ site-packages \\ ebaysdk \\ connection.py”,行184,位于execute_request allow_redirects = True File“ C:\\ Users \\ dc500 \\ AppData \\ Local \\ Programs \\发送中的Python \\ Python35 \\ lib \\ site-packages \\ requests \\ sessions.py“,行576 r = adapter.send(request,** kwargs)文件” C:\\ Users \\ dc500 \\ AppData \\ Local \\ Programs \\ Python发送超时=超时文件“ C:\\ Users \\ dc500 \\ AppData \\ Local \\ Programs \\ Python \\ Python \\ Python35 \\ lib \\ site-packages \\ requests”中的\\ Python35 \\ lib \\ site-packages \\ requests \\ adapters.py“,行376 \\ packages \\ urllib3 \\ connectionpool.py”,第559行,位于urlopen正文=正文,标头=标头)文件“ C:\\ Users \\ dc500 \\ AppData \\ Lo cal\\Programs\\Python\\Python35\\lib\\site-packages\\requests\\packages\\urllib3\\connectionpool.py", line 353, in _make_request conn.request(method, url, **httplib_request_kw) File "C:\\Users\\dc500\\AppData\\Local\\Programs\\Python\\Python35\\lib\\http\\client.py", line 1084, in request self._send_request(method, url, body, headers) File "C:\\Users\\dc500\\AppData\\Local\\Programs\\Python\\Python35\\lib\\http\\client.py", line 1124, in _send_request self.putheader(hdr, value) File "C:\\Users\\dc500\\AppData\\Local\\Programs\\Python\\Python35\\lib\\http\\client.py", line 1060, in putheader if _is_illegal_header_value(values[i]): TypeError: expected string or bytes-like object cal_Programs \\ Python \\ Python35 \\ lib \\ site-packages \\ requests \\ packages \\ urllib3 \\ connectionpool.py“,第353行,位于_make_request conn.request(方法,URL,** httplib_request_kw)中,文件“ C:\\ Users \\ dc500请求自身中的\\ AppData \\ Local \\ Programs \\ Python \\ Python35 \\ lib \\ http \\ client.py“行1084。_send_request(方法,URL,正文,标头)文件“ C:\\ Users \\ dc500 \\ AppData \\ Local \\ _send_request self.putheader(hdr,value)文件中的Programs \\ Python \\ Python35 \\ lib \\ http \\ client.py“行1124,文件“ C:\\ Users \\ dc500 \\ AppData \\ Local \\ Programs \\ Python \\ Python35 \\ lib \\ http \\ client.py“,行1060,如果_is_illegal_header_value(values [i]),则在putheader中:TypeError:预期的字符串或类似字节的对象

from ebaysdk.trading import Connection as Trading
try:
    api = Trading(config_file='ebay.yaml')
except ConnectionError as e:
    print(e)
    print(e.response.dict())
    log.error('Attempting to get an API object failed with %s', e)

def get_active_listings(page):
    acitvelist = api.execute('GetMyeBaySelling', {'ActiveList': True,
                                              'DetailLevel': 'ReturnAll',
                                              'PageNumber': page})
    return acitvelist.dict()

This works for me and returns all active listings - maybe GetMyeBaySelling is a better call to use ? 这对我GetMyeBaySelling并返回所有活动列表-也许GetMyeBaySelling是更好的使用方法?

Other than that https://developer.ebay.com/devzone/XML/docs/Reference/eBay/GetSellerList.html#Input 除此之外https://developer.ebay.com/devzone/XML/docs/Reference/eBay/GetSellerList.html#Input

does not seem to give the inputFilter as an option for parameters? 似乎没有给inputFilter作为参数的选项? there is outputSelector outputSelector

?? ??

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM