Hi, I've been trying to test publishing a listing to the sandbox with ebay's Trading API Auth'n'Auth. I am using python ebaySDK, and hosting it on heroku. In the section "get a token from eBay via your application", I am clicking on "Auth'n'Auth", and then "test Sign-in", which takes me to a sign in page . I then sign in to one of my sandbox accounts, and click agree. Then it takes me to my app's return URL, which looks like this:
https://my_application.herokuapp.com/return_url/?ebaytkn=&tknexp=1970-01-01+00%3A00%3A00&username=testuser_example
In my program, I am then connecting to the API and making a GetSessionID call to eBay, which seems to work fine, and then making a call to Fetch Token with that session ID. I tried doing this two days ago and it worked fine, successfully publishing a test listing to the sanbox user's page. When I tried to do it again yesterday, it returned the error in the title:
ebaysdk.exception.ConnectionError: 'FetchToken: Class: RequestError, Severity: Error, Code: 21916017, The end user has not completed Auth & Auth sign in flow. The end user has not completed Auth & Auth sign in flow.'
I have not been able to fix this since and have no idea what's wrong.
My code:
from ebaysdk.trading import Connection import requests import xml.etree.ElementTree as ET '''Establishing API conncetion''' api = Connection(domain='api.sandbox.ebay.com', appid="app_id", devid = "dev_id", certid = "SBX-cert_id", debug=True) '''Making GetSessionID call to get session ID of the user who logged in''' request = { 'RuName': "my_ru_name" } sess_id_response = api.execute('GetSessionID', request) # parsing response root = ET.fromstring(sess_id_response.text) sessionID = root[4].text '''Exchanging user's SessionID for a token''' data = { 'SessionID': sessionID } api = Connection(domain='api.sandbox.ebay.com', appid="app_id", devid = "dev_id", certid = "SBX-cert_id", debug=True) token_response = api.execute('FetchToken', data) # parsing response root = ET.fromstring(token_response.text) token = root[4].text print(token)