Skip to main content

Get API credentials expiration with the REST API

This use case scenario provides the Identity REST API requests for viewing the expiration date for API credentials.

Get the expiration date for your account

Use the following request to view the expiration date and time for your API credentials:

http --auth-type=veracode_hmac GET "https://api.veracode.com/api/authn/v2/api_credentials"

Get the expiration date by API ID

Use the following request to view credentials expiration information for a specific API ID:

http --auth-type=veracode_hmac GET "https://api.veracode.com/api/authn/v2/api_credentials/{apiCredsId}"

Get the expiration date for an API User

To send this request, you must be the administrator for the specified user.

Use the following request to view the current API credentials and their expiration for the API user you specify for userId:

http --auth-type=veracode_hmac --json GET "https://api.veracode.com/api/authn/v2/api_credentials/user_id/{userId}"

You must include the --json parameter to force the request to send the Content-Type: application/json in the HTTP header.