For a deeper look into our DataScope Select REST API, look into:

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials

question

Upvotes
Accepted
5 2 1 5

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

dss-rest-apidatascope-selectdss
icon clock
10 |1500

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

@jian.kang, thank you for your participation in the forum. Is the reply below satisfactory in resolving your query? If yes please click the 'Accept' text beneath the reply. This will guide all community members who have a similar question. Otherwise please post again offering further insight into your question. Thanks, AHS

Hello @jian.kang

Thank you for your participation in the forum. Is the reply below satisfactory in resolving your query?

If so please can you click the 'Accept' text next to the appropriate reply. This will guide all community members who have a similar question.

Thanks,

AHS

@jian.kang, please be informed that a reply has been verified as correct in answering the question, and has been marked as such. Thanks, AHS

1 Answer

· Write an Answer
Upvotes
Accepted
4.4k 10 6 9

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.

icon clock
10 |1500

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

Thanks, Warat. But I am implementing a server side java application which will retrieve DSS data periodically. I don't want to request token every time when my downstream clients to request data from my java application. How can I do it reasonable?

Hi @jian.kang

A token is valid for 24 hours, so there are plenty of ways to handle it.

Your server can just keep reusing it until it expires and made an authentication request when received 401.

Or you can make it simpler and just made an authentication request every 12 hours.

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.