What combination of requests and responses are needed to get an Oauth token from eBay? What is a runame and what headers do I need to keep eBay happy?
What combination of requests and responses are needed to get an Oauth token from eBay? What is a runame and what headers do I need to keep eBay happy?
2
Answers
After three frustrating days of trying to get Ebay's oauth to give me an access token, I have finally worked it out. As the docs are pain and there is little to no help online, I have decided to post my solution here in the hope that it will help others. I am no good at StackOverflow so let me know if I need to improve my formatting.
The first thing you need to do is redirect to this URL.
The format is like this
There is also a scope property, but I don't understand that yet, and I got back a token without is so me.
That URL takes you to the eBay login page. If you are using the sandbox, you need to create a sandbox user and login with sandbox credentials.
Once you log in, eBay will redirect you to a URL of your choosing. You enter the URL you want to be redirected to here.
It's in the ebay developer section under Get A Token From Ebay Via your Application.
This URL can be anything. you just have to handle it in node or express or whatever, because as soon as someone signs in that URL is where they are heading.
Here is how I handled it
A few gotchas that got me.
We also had to use JS for the eBay API and solved your mention problem with developing a new Lib. It’s available here. This lib will also automatically try to refresh the token if it’s expires.
This is how we obtain the oAuth token:
Another example with scope can we found here.
Some hints:
Descriptions here, under Sandbox/Production Keys Box. (OAuth
Scopes)
need btoa: