Api clients
/
Ruby
/
V1
/
Methods
Jun 25, 2024
Get Secured API Key Remaining Validity | Ruby API Client V1 (Deprecated)
Deprecated content
This documentation is for a deprecated version of Ruby API client .
Some features and settings may be missing or their usage may have changed.
Refer to the documentation for the
latest version of Ruby API client for up-to-date information.
Required API Key: Any secured API key
Method signature
Algolia.get_secured_api_key_remaining_validity(apiKey)
About this method
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
Get the remaining validity on a secured API key:
Copy
1
$remainingValidity = SearchClient::getSecuredApiKeyRemainingValidity('YourSecuredAPIkey');
Parameters
apiKey
|
type: string
default: no default
Required
Secured API Key to retrieve remaining validity for |
Response
No response.
Did you find this page helpful?