timotheus / ebaysdk-python

eBay API SDK for Python
https://developer.ebay.com/tools/sdks
Other
808 stars 326 forks source link

Shopping API, Token not found, yet included in YAML #375

Open amrakrr opened 1 year ago

amrakrr commented 1 year ago

using the Shopping API Class, I've constructed the YAML as so :

open.api.ebay.com: iaf_token: myToken appid: myappid certid : mycertid version: 799

Yet I received this error:

'GetSingleItem: Class: RequestError, Severity: Error, Code: 1.33, Token not available in request. Token not available in request. Please specify a valid token as HTTP header.' {'Timestamp': '2023-03-21T23:08:05.329Z', 'Ack': 'Failure', 'Errors': {'ShortMessage': 'Token not available in request.', 'LongMessage': 'Token not available in request. Please specify a valid token as HTTP header.', 'ErrorCode': '1.33', 'SeverityCode': 'Error', 'ErrorClassification': 'RequestError'}, 'Build': 'E1199_CORE_APILW_19146596_R1', 'Version': '1199'}

Would anyone be able to help?

amrakrr commented 1 year ago

When I hard code the iaf token in the headers of the shopping init.py file (I know, not the best practice) the call works and returns data!

The init file doesn't pick up the iaf token correctly from the yaml file.

I can use this: s.config.values and it returns the variables, including the iaf token from the yaml file. But the init file doesn't pick it up.

tekgecko commented 1 year ago

When I hard code the iaf token in the headers of the shopping init.py file (I know, not the best practice) the call works and returns data!

The init file doesn't pick up the iaf token correctly from the yaml file.

I can use this: s.config.values and it returns the variables, including the iaf token from the yaml file. But the init file doesn't pick it up.

Thanks, this also worked for me.

sndao commented 1 year ago

This fix was committed but never made it into the latest release.

Since it seems this library isn't being maintained anymore, here's a workaround to include the fix:

pip uninstall ebaysdk # uninstalls 2.2.0 -- latest release

pip install ebayskgit+https://github.com/timotheus/ebaysdk-python.git --no-cache-dir

You can also include in your requirements.txt (although you may hit an error if ebaysdk is in pip cache):

git+https://github.com/timotheus/ebaysdk-python.git

Nazzcodek commented 11 months ago

When I hard code the iaf token in the headers of the shopping init.py file (I know, not the best practice) the call works and returns data!

The init file doesn't pick up the iaf token correctly from the yaml file.

I can use this: s.config.values and it returns the variables, including the iaf token from the yaml file. But the init file doesn't pick it up.

please can you elaborate on what you do