- createToken - Create authentication token
Creates an authentication token for the authenticated user. These are specifically intended to be used with the Web SDK.
Note: The tokens generated from this endpoint are not valid tokens
for use with the Client API (e.g. /rest/api/v1/*).
package hello.world;
import com.glean.api_client.glean_api_client.Glean;
import com.glean.api_client.glean_api_client.models.operations.CreateauthtokenResponse;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
Glean sdk = Glean.builder()
.apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", ""))
.build();
CreateauthtokenResponse res = sdk.client().authentication().createToken()
.call();
if (res.createAuthTokenResponse().isPresent()) {
// handle response
}
}
}| Error Type | Status Code | Content Type |
|---|---|---|
| models/errors/APIException | 4XX, 5XX | */* |