API Reference / API Methods / API keys / Get secured API key remaining validity

Get Secured API Key Remaining Validity

Required API Key: Any secured API key
Method signature
Algolia::Search::Client.get_secured_api_key_remaining_validity(String apiKey)

About this method # A

You’re currently reading the Ruby API client v2 documentation. Check the migration guide to learn how to upgrade from v1 to v2. You can still access the v1 documentation.

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:#

1
remaining_validity = Algolia::Search::Client.get_secured_api_key_remaining_validity('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?
Ruby v2