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

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials

question

Upvotes
Accepted
5 2 1 3

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 5.0 MiB each and 10.0 MiB total.

1 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 5.0 MiB each and 10.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.

Click below to post an Idea Post Idea