negotiation/v1/find_eligible_items call doesn't accept a valid authorization token
Hello,
I am trying to get the set of IDs that are eligible for a seller-initiated discount offer to a buyer by calling GET https://api.ebay.com/sell/negotiation/v1/find_eligible_items as per https://developer.ebay.com/api-docs/sell/negotiation/resources/offer/methods/findEligibleItems.
Here is my code:
headers = {
'Authorization' : "Bearer " + userAccessToken,
'X-EBAY-C-MARKETPLACE-ID' : 'EBAY_US'
}
response = requests.get( url, headers = headers )
userAccessToken is created with the authorization code grant flow. It is valid as I am able to use it to make Marketing API calls. I've also tried my Auth'n'Auth and OAuth user access tokens.
Scopes https://api.ebay.com/oauth/api_scope/sell.inventory.readonly and https://api.ebay.com/oauth/api_scope/sell.inventory are available to my application as per the Application Keys page.
The error I am getting is {"errors": [ { "errorId": 1001, "domain": "OAuth", "category": "REQUEST", "message": "Invalid access token", "longMessage": "Invalid access token. Check the value of the Authorization HTTP request header." }]\n}
What am I doing wrong?
I appreciate your help.
Best regards,
2 comments
swiv-o-matic
·3 years agoAre you sure you're generating a User Access Token and not an Application Access token? The Marketplace API expects a GET which is generally associated with 'Application access' credentials.
"Application tokens are general-use tokens that give access to interfaces that return application data. For example, many GET requests require only an Application token for authorization."
https://developer.ebay.com/api-docs/static/oauth-token-types.html#:~:text=For%20example%2C%20many%20GET%20requests,an%20Application%20token%20for%20authorization.&text=You%20must%20employ%20a%20User,user%20information%20and%20account%20data).
Here's my working example (tested with a User Access Token):
swiv-o-matic
·3 years agoPython version, also tested and working: