Skip to main content

Theca-Client-Token

Why it is needed

The Theca-Client-Token is needed to identify which Theca cluster you are connecting to and receiving responses from. The token is a long string that uniquely identifies each client. Provided by Theca.

Note that tokens may be revoked by Theca, e.g., if they are compromised or if a token generating service is implemented in a future version of the API.

How to implement it

The token is sent in the header for every request to theca. Remember to request your unique client-token from your account manager at Theca, otherwise you service might not work as intended.

An example in kotlin

  1. Replace the "demo" with your Theca-Client-Token
  2. Set the Theca-Client-Token
  3. Call the api
fun setHeaders(session: HttpSession): HttpEntity<String> {​
// Create HttpHeaders​
val headers = HttpHeaders()​

    //Theca-Client-Token is set here​
headers.set("Theca-Client-Token", "demo")​
headers.set("Theca-User-Token", session.getAttribute("sessionHash").toString())​
// You can add more headers if needed​

// Create an HttpEntity with headers (no body in this case)​
val entity = HttpEntity<String>(headers)​

return entity
}

Where to read more about it

docs.theca.com/api/overview