Backendless Support
 
Answered

REST API - How can I check if user token is still valid?

Hi everyone,

Is there any Backendless Rest API endpoint where I can verify if a user token is still valid?

I would also like to know if there is an error number I will always get if I make a request with an invalid user token.

Thanks you all very much

Best Answer
photo

Hi, Nicolas,

Yes, there is such route:

http://api.backendless.com/<version_name>/users/isvalidusertoken/<user_token>, which will return you true or false.

<version_name> is the name of your version, like "v1",

<user_token> is the user token you want to check.

Leave a Comment

Comments (4)

photo
2

Hi, Nicolas,

Yes, there is such route:

http://api.backendless.com/<version_name>/users/isvalidusertoken/<user_token>, which will return you true or false.

<version_name> is the name of your version, like "v1",

<user_token> is the user token you want to check.

photo
1

Sergey Chupov thanks for your reply. I have one more question, I noticed that if I make a request with an invalid user token, Backendless would return an error code 3064. Am I always going to get this error in any endpoint? If so, I could set my app to always handle this error by sending the user to login screen.

Thanks you very much!

photo
2

Hi Nikols.

Yes, you could. Also, add this check for error with code 3091 ("Session timeout").

Regards,

Kate.

photo
1

Great!

Thanks you all very much for your help!