Refresh Token - From where to get eBay Refresh Token
I want to get an access token in C# API for that I will need a refresh token, from where I can get it.
salsha7566
Posted 3 years ago·Last reply 3 years ago
2 comments
I want to get an access token in C# API for that I will need a refresh token, from where I can get it.
five_notch_trading_post
·3 years agoA couple of posts that might help:
https://community.ebay.com/t5/RESTful-Sell-APIs-Fulfillment/c-eBay-Utility-going-round-in-circles-trying-to-handle-multiple/m-p/33594201
https://community.ebay.com/t5/RESTful-Sell-APIs-Fulfillment/the-provided-authorization-grant-code-is-invalid-or-was-issued/m-p/33608452
In addition, the response from shipscript on the other post shows the implementation in php.
Also, don't post any tokens, or credentials you've encoded to the forums, that is a security issue...
So like is mentioned in each of those posts, you do not want the client_credentials grant type you are using, that gives an application token, you want a user token.
The user token is a 2 step process
What you want is to generate a URL first.
Use that url to log in.
When you log in the URL will update to a string that contains a code= &
Grab that, make a body that uses the grant type of authorization_code with just:
"grant_type": "authorization_code"
"redirect_uri": YOUR_REDIRECT_URI_HERE
"code": THE_AUTHORIZATION_CODE_YOU_GOT_FROM_RETURNED_URL_PARAM
This will return the refresh token and the access token.
You can then use:
"grant_type": "refresh_token"
"refresh_token": THE_REFRESH_USER_TOKEN_YOU_GOT
"scope": "your scopes separated by spaces"
on that refresh token from that point forward.
A rough example of the 1st half:
salsha7566
OP3 years ago@five_notch_trading_post Thanks for the help and Suggestions. It is working now.