cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Getting a refresh token from the User Tokens page

My app is just for a single user. On the User Tokens page I want to use the "Get a User Token Here" button to get an OAuth Token.

 

It returns the token on screen and I can click to copy the token to my clipboard and use that token in my requests. But I cannot find the refresh token which I will need to refresh this token later. Is that returned to the page somewhere?

Message 1 of 3
latest reply
1 BEST ANSWER

Accepted Solutions

Getting a refresh token from the User Tokens page

@stationeryguru 

 

That screen returns only two-hour tokens. You will need to programmatically fetch the token to get the refresh token.

https://developer.ebay.com/my/auth?env=production&index=0&auth_type=oauth 

 

Developer - OAuth 2 hour tokenDeveloper - OAuth 2 hour token

 

Scroll further down the screen and set up the Sign-In settings.  You can use eBay defaults for the fields that hold them. Click the button to test the sign-in.

 

Or, you can have your server launch the Sign-in request.

https://developer.ebay.com/api-docs/static/oauth-consent-request.html 

 

Accept the request, which will redirect to a "success" page. eBay will have appended your user's 5-minute authorization code as a query to the end of that "success" URL.

https://example.com/success.html?code=v%5E1.1%23i%5E1%23r%5E1...MA%3D%3D&expires_in=299

 

Grab that code value and use it to request an access token and refresh token.

https://developer.ebay.com/api-docs/static/oauth-auth-code-grant-request.html

 

Save the refresh token because you will use that for up to 18-months to mint a new 2-hour access token whenever needed.

https://developer.ebay.com/api-docs/static/oauth-refresh-token-request.html

 

ShipScript has been an eBay Community volunteer since 2003, specializing in HTML, CSS, Scripts, Photos, Active Content, Technical Solutions, and online Seller Tools.

View Best Answer in original post

Message 2 of 3
latest reply
2 REPLIES 2

Getting a refresh token from the User Tokens page

@stationeryguru 

 

That screen returns only two-hour tokens. You will need to programmatically fetch the token to get the refresh token.

https://developer.ebay.com/my/auth?env=production&index=0&auth_type=oauth 

 

Developer - OAuth 2 hour tokenDeveloper - OAuth 2 hour token

 

Scroll further down the screen and set up the Sign-In settings.  You can use eBay defaults for the fields that hold them. Click the button to test the sign-in.

 

Or, you can have your server launch the Sign-in request.

https://developer.ebay.com/api-docs/static/oauth-consent-request.html 

 

Accept the request, which will redirect to a "success" page. eBay will have appended your user's 5-minute authorization code as a query to the end of that "success" URL.

https://example.com/success.html?code=v%5E1.1%23i%5E1%23r%5E1...MA%3D%3D&expires_in=299

 

Grab that code value and use it to request an access token and refresh token.

https://developer.ebay.com/api-docs/static/oauth-auth-code-grant-request.html

 

Save the refresh token because you will use that for up to 18-months to mint a new 2-hour access token whenever needed.

https://developer.ebay.com/api-docs/static/oauth-refresh-token-request.html

 

ShipScript has been an eBay Community volunteer since 2003, specializing in HTML, CSS, Scripts, Photos, Active Content, Technical Solutions, and online Seller Tools.
Message 2 of 3
latest reply

Getting a refresh token from the User Tokens page

that's perfect many thanks

Message 3 of 3
latest reply