Restriction about token for a long connection

Hi API team,

I have one question when using DSS REST Web Service API.

Is there any restriction for one token to keep a long connection to call DSS REST Web Service API? I am using GET /v1/Users/Users(UserID) to simulate heartbeat to keep token not expired. But after I run the Java client (which I implemented) for one week, it could not connect any more. I need to restart the client.

So I would like to know is there any restriction about long connection to DSS REST Web Service API? Thank you so much.

Thanks,

Jian Kang

Best Answer

  • warat.boonyanit
    Answer ✓

    Hi @jian.kang

    The tokens are valid for 24 hours and there is no need to send heartbeat to DSS server. There is no "connection" to maintain between your client and DSS.

    It is described here, but basically, you will receive a 401 (Authentication Required) status code if you try to use an expired token. You can then handle the 401 by requesting a new token and then use that token in the re-request.

Answers