ebaysdk python身份验证失败:无效的应用程序

ebaysdk python身份验证失败:无效的应用程序,python,ebay-sdk,Python,Ebay Sdk,我正在尝试用python脚本连接ebay。这是我的代码,我用过 在运行此程序时,我发现了以下错误。下面是调试结果 2015-08-25 12:24:18,101 ebaysdk [DEBUG]:execute: verb=findItemsAdvanced data={'Keywords': 'Harry Potter', 'MaxEntries': 2, 'AvailableItemsOnly': True} 2015-08-25 12:24:18,107 ebaysdk [DEBUG]:RE

我正在尝试用python脚本连接ebay。这是我的代码,我用过

在运行此程序时,我发现了以下错误。下面是调试结果

2015-08-25 12:24:18,101 ebaysdk [DEBUG]:execute: verb=findItemsAdvanced data={'Keywords': 'Harry Potter', 'MaxEntries': 2, 'AvailableItemsOnly': True}
2015-08-25 12:24:18,107 ebaysdk [DEBUG]:REQUEST (cb3019a4-1f9a-4e82-9ba9-b45ed84329dd): POST http://svcs.ebay.com/services/search/FindingService/v1
2015-08-25 12:24:18,107 ebaysdk [DEBUG]:headers=CaseInsensitiveDict({'X-EBAY-SOA-GLOBAL-ID': 'EBAY-US', 'Content-Length': '254', 'X-EBAY-SOA-SECURITY-APPNAME': u'test-08c4-473a-8461-415f8024798f', 'X-EBAY-SOA-OPERATION-NAME': 'findItemsAdvanced', 'X-EBAY-SOA-SERVICE-NAME': 'FindingService', 'X-EBAY-SOA-SERVICE-VERSION': u'1.0.0', 'User-Agent': 'eBaySDK/2.1.2 Python/2.7.6 Linux/3.16.0-46-generic', 'X-EBAY-SDK-REQUEST-ID': 'cb3019a4-1f9a-4e82-9ba9-b45ed84329dd', 'X-EBAY-SOA-RESPONSE-DATA-FORMAT': 'XML', 'X-EBAY-SOA-REQUEST-DATA-FORMAT': 'XML', 'Content-Type': 'text/xml'})
2015-08-25 12:24:18,107 ebaysdk [DEBUG]:body=<?xml version='1.0' encoding='utf-8'?><findItemsAdvancedRequest xmlns="http://www.ebay.com/marketplace/search/v1/services"><AvailableItemsOnly>True</AvailableItemsOnly><Keywords>Harry Potter</Keywords><MaxEntries>2</MaxEntries></findItemsAdvancedRequest>
2015-08-25 12:24:18,809 ebaysdk [DEBUG]:RESPONSE (cb3019a4-1f9a-4e82-9ba9-b45ed84329dd):
2015-08-25 12:24:18,809 ebaysdk [DEBUG]:elapsed time=0:00:00.701135
2015-08-25 12:24:18,809 ebaysdk [DEBUG]:status code=500
2015-08-25 12:24:18,809 ebaysdk [DEBUG]:headers=CaseInsensitiveDict({'x-ebay-soa-global-id': 'EBAY-US', 'x-ebay-request-id': '14f63a2c-ffb0-a7ea-3304-9134ce2175ca!services.search.FindingService.v1!10.126.163.48!fndngesb[]', 'x-cnection': 'close', 'x-ebay-soa-operation-name': 'findItemsAdvanced', 'transfer-encoding': 'chunked', 'x-ebay-soa-error-response': 'TRUE', 'x-ebay-soa-service-name': '{http://www.ebay.com/marketplace/search/v1/services}FindingService', 'x-ebay-soa-service-version': '1.13.0', 'server': 'Apache-Coyote/1.1', 'x-ebay-soa-locale-list': 'en-US_US', 'x-ebay-soa-message-protocol': 'NONE', 'date': 'Tue, 25 Aug 2015 06:54:17 GMT', 'x-ebay-soa-request-id': '14f63a2d-0360-a7ed-d744-9224fd474628!FindingService!10.126.221.116!v3apifindingcore[]', 'guid': '14f63a2c-ffb0-a7ea-3304-9134ce2175ca', 'content-type': 'text/xml;charset=UTF-8', 'x-ebay-soa-response-data-format': 'XML', 'x-ebay-soa-service-metrics': '4251324'})
2015-08-25 12:24:18,809 ebaysdk [DEBUG]:content=<?xml version='1.0' encoding='UTF-8'?><errorMessage xmlns="http://www.ebay.com/marketplace/search/v1/services"><error><errorId>11002</errorId><domain>Security</domain><severity>Error</severity><category>System</category><message>Authentication failed : Invalid Application: test-08c4-473a-8461-415f8024798f</message><subdomain>Authentication</subdomain><parameter name="Param1">Invalid Application: test-08c4-473a-8461-415f8024798f</parameter></error></errorMessage>
2015-08-25 12:24:18,810 ebaysdk [ERROR]:findItemsAdvanced: Internal Server Error, Domain: Security, Severity: Error, errorId: 11002, Authentication failed : Invalid Application: test-08c4-473a-8461-415f8024798f



u'findItemsAdvanced: Internal Server Error, Domain: Security, Severity: Error, errorId: 11002, Authentication failed : Invalid Application: test-08c4-473a-8461-415f8024798f'



{'errorMessage': {'error': {'category': 'System', 'domain': 'Security', 'severity': 'Error', 'message': 'Authentication failed : Invalid Application: test-08c4-473a-8461-415f8024798f', 'subdomain': 'Authentication', 'parameter': {'value': 'Invalid Application: test-08c4-473a-8461-415f8024798f', '_name': 'Param1'}, 'errorId': '11002'}}}
2015-08-25 12:24:18101 ebaysdk[DEBUG]:执行:verb=findItemsAdvanced data={'Keywords':'Harry Potter','MaxEntries':2,'AvailableItemsOnly':True}
2015-08-25 12:24:18107 ebaysdk[调试]:请求(cb3019a4-1f9a-4e82-9ba9-b45ed84329dd):发布http://svcs.ebay.com/services/search/FindingService/v1
2015-08-25 12:24:18107 ebaysdk[DEBUG]:headers=CaseInsensitiveDict({'X-EBAY-SOA-GLOBAL-ID':'EBAY-US','Content Length':'254','X-EBAY-SOA-SECURITY-APPNAME':u'test-08c4-473a-8461-415f8024798f','X-EBAY-SOA-OPERATION-NAME':'findItemsAdvanced','X-EBAY-SOA-SERVICE-NAME':'FindingService','X-EBAY-SOA-SERVICE-VERSION':u'1.0.0','User-Agent':'eBaySDK/2.1.2.7.6 Linux/3.16.0-46-generic-requeue-SDKST-ID':'cb3019a4-1f9a-4e82-9ba9-b45ed84329dd','X-EBAY-SOA-RESPONSE-DATA-FORMAT':'XML','X-EBAY-SOA-REQUEST-DATA-FORMAT':'XML','Content Type':'text/XML')
2015-08-25 12:24:18107 ebaysdk[DEBUG]:body=TrueHarry Potter2
2015-08-25 12:24:18809 ebaysdk[调试]:响应(cb3019a4-1f9a-4e82-9ba9-b45ed84329dd):
2015-08-25 12:24:18809 ebaysdk[调试]:运行时间=0:00:00.701135
2015-08-25 12:24:18809 ebaysdk[调试]:状态代码=500
2015-08-25 12:24:18809 ebaysdk[DEBUG]:headers=CaseInsensitiveDict({'x-ebay-soa-global-id':'ebay-US','x-ebay-request-id':'14f63a2c-ffb0-a7ea-3304-9134ce2175ca!services.search.FindingService.v1!10.126.163.48!fndngesb[]“,”x-C部分“:”关闭“,”x-ebay-soa-operation-name“:”FindItemAdvanced“,”传输编码“:”分块“,”x-ebay-soa-error-response“:”为真“,”x-ebay-soa-service-name“:”{http://www.ebay.com/marketplace/search/v1/services}FindingService’、‘x-ebay-soa-service-version’:‘1.13.0’、‘服务器’:‘Apache Coyote/1.1’、‘x-ebay-soa-locale-list’:‘en-US_-US’、‘x-ebay-soa-message-protocol’:‘无’、‘日期’:‘2015年8月25日星期二06:54:17 GMT’、‘x-ebay-soa-request-id’:‘14f63a2d-0360-a7ed-d744-9224fd474628!FindingService!10.126.221.116!V3ApidingCore[]“,”guid“:”14f63a2c-ffb0-a7ea-3304-9134ce2175ca“,”内容类型“:”text/xml;charset=UTF-8“,”x-ebay-soa-response-data-format“:”xml“,”x-ebay-soa-service-metrics“:”4251324“})
2015-08-25 12:24:18809 ebaysdk[调试]:内容=11002安全错误系统身份验证失败:无效应用程序:test-08c4-473a-8461-415F8024798错误身份验证验证应用程序:test-08c4-473a-8461-415f8024798f
2015-08-25 12:24:18810 ebaysdk[错误]:FindItemAdvanced:内部服务器错误,域:安全性,严重性:错误,错误ID:11002,身份验证失败:无效应用程序:test-08c4-473a-8461-415f8024798f
u'FindItemAdvanced:内部服务器错误,域:安全性,严重性:错误,错误ID:11002,身份验证失败:无效应用程序:test-08c4-473a-8461-415f8024798f'
{'errorMessage':{'error':{'category':'System','domain':'Security','severity':'error','message':'Authentication失败:无效的应用程序:test-08c4-473a-8461-415f8024798f','Param1','errorId':'11002'}
猜猜看,我错过了什么

提前感谢。

您正在通过生产环境使用ebay api进行呼叫。您需要使用沙盒凭据进行呼叫。您的凭据可能正确,但您需要更改域。 ebaysdk-pythonapi默认调用生产环境

通过在域中传递ebay沙盒终结点来更改行

api = finding(domain='svcs.sandbox.ebay.com', debug=True, config_file='myebay.yaml')
它会给你成功的回应

希望这有帮助

api = finding(domain='svcs.sandbox.ebay.com', debug=True, config_file='myebay.yaml')