question

tanikatechit avatar image
0 Likes"
tanikatechit asked ·

How to check the token is expire or not ?

Hello,

I am new in eBay development.

I am successfully getting an access token and refresh token but the access token gets expire in 2 hr so is there any way to check the token is expire or not or is there any API to get the token status?


tokensaccesstokenewtoken
10 |600 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

sagar_developersupport avatar image
0 Likes"
sagar_developersupport answered ·

Hi @tante-50 ,

You can use GetTokenStatus call of Trading API for getting the status of a token. Please go through the link given below to know more about the call.

Ref: https://developer.ebay.com/devzone/xml/docs/reference/ebay/GetTokenStatus.html

For security, a User access token is short-lived. However, a Refresh token is long-lived and you can use it to renew a User access token after the token expires. When you mint a new User access OAuth token, the access token is returned along with a refresh token, which you can use to renew the User access token for the associated user. A refresh token request mints an access token that contains the same authorization properties as the original access token.

To know more about how you can update expired access tokens using a refresh token to update a User access token, please go through the link given below:

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

Best Regards ,
eBay Developer Support

·
10 |600 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

tanikatechit avatar image
0 Likes"
tanikatechit answered ·

Hello @tapdevelop,
Thanks for giving a reply. As you say I need to check whether the API returns the error or not. okay, I will try this.


Can you please help me with one more thing here is the link https://forums.developer.ebay.com/questions/40862/cant-able-to-connect-the-paypal-sendbox-account-an.html


· 1 ·
10 |600 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Great idea man thanks keep it up all the time. I am very happy to see your standard.

0 Likes 0 ·
tapdevelop avatar image
0 Likes"
tapdevelop answered ·

If you are making any API call and the access token is expired, the API returns an HTTP response code 401 and an error 1001 in its response (errorId). If that's the case then request a new token and make the same API call again.

·
10 |600 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.