Api clients / JavaScript / V3 / Methods

Get Secured API Key Remaining Validity | JavaScript API Client V3 (Deprecated)

This version of the JavaScript API client has been deprecated in favor of the latest version of the JavaScript API client.

Required API Key: Any secured API key
Method signature
client.getSecuredApiKeyRemainingValidity(apiKey)

About this method# A

Retrieve the remaining validity of a secured API key in seconds.

This method takes a secured API key as a parameter and returns the amount of seconds left until the API key’s validUntil field expires. If the key is no longer valid, the method returns a negative number indicating the amount of seconds passed since the key expired.

If the API key has no validUntil restriction, this method raises an exception or an error depending on your client.

Examples# A

Get the remaining validity on a secured API key:#

Edit
1
$remainingValidity = SearchClient::getSecuredApiKeyRemainingValidity('YourSecuredAPIkey');

Parameters# A

apiKey #
type: string
default: no default
Required

Secured API Key to retrieve remaining validity for

Response# A

No response.

Did you find this page helpful?