Cloud Administration Enable Emergency Tokencode API Version 2
5 months ago

Cloud Administration Enable Emergency Tokencode API Version 2

This API generates an Emergency Access Code for a user. You can enable the oneTimeUse option to restrict the code to a single use. The code’s validity period must be set between 1 minute and 7 days.

For information about managing access to this API, see Accessing the Cloud Administration APIs.

Note:  If the Online Emergency Access Code (EAC) configuration is locked at the company level in the Company Settings, any values sent in the request are overridden by the company-level settings. To configure EAC settings at the company-level, see Configure Session and Authentication Method Settings

Authentication

Clients calling this API must authenticate themselves by including a JSON Web Token in a request. For instructions on using this token, see Authentication for the Cloud Administration REST APIs.

Software Developer Kit

You can download the API Software Developer Kit (SDK) from Cloud Administration REST API Download.

Request Requirements

Use the following information to generate an Emergency Access Code with the oneTimeUse option for a user. The <userId> is a unique user identifier that is returned in the response to the Cloud Administration User Details API.

MethodRequest URLResponse Content Type
PUTAdminInterface/restapi/v2/users/{userId}/emergencyTokencode application/json

Request Body Parameters

This API requires the following parameters.

ParameterDescriptionRequiredDefault ValueDate Type
oneTimeUse Indicates whether the Emergency Access Code is single-use (oneTimeUse) or reusable. NooneTimeUse value set at the tenant levelBoolean
expiryUnit Time unit for code expiration: days, hours, or minutes.Yes, if expiryValue is included in the request. Otherwise, NoexpiryUnit value set at the tenant levelString
expiryValueExpiration time value Yes, if expiryUnit is included in the request. Otherwise, NoexpiryValue value set at the tenant levelInteger

 

Example Request Body

The following example displays a request.

{
    "oneTimeUse": true,
    "expiryUnit": "days",
    "expiryValue": 5
}

 

Response Body Parameters

The following table describes the response parameters and data types.

ParameterDescriptionData Type
emergencyTokencode The value of the Emergency Access Code. String
offlineExpirationDate Expiration datetime for the offline Emergency Access Code. String
configurationsUsedIndicates the JSON Object containing the configurations used to generate the online Emergency Access Code including (Time Expiration unit, Time Expiration value and Type of Emergency Access Code (one-time use vs. reusable). Object
emergencyTokencodeId Unique identifier for the Emergency Access Code. UUID
oneTimeUse Indicates if the Emergency Access Code is single-use (true) or reusable (false). Boolean
configurationsLockedIndicates whether the configurations are locked on the tenant or not. True if configurations are locked and false otherwise.Boolean
expirationDate Expiration datetime for the online Emergency Access Code. String

 

Example Response Body

The following example displays a response body.

{
  "emergencyTokencode": "qvmnsrtt",
  "offlineExpirationDate": null,
  "configurationsUsed": {
     "expiryValue": 60,
     "expiryUnit": "minutes",
     "oneTimeUse": true

  },
  "emergencyTokencodeId": "7f71e069-4a67-7530-e8f2-7d5a230e74cc",
  "oneTimeUse": true,
  "configurationsLocked": false,
  "expirationDate": "2025-09-12T10:17:35.599Z"
}

 

Response Codes

This API returns the following response codes.

CodeDescription
200

Emergency Access Code generated successfully.

400User not found.
400User is disabled.
400The expiryValue property is required when expiryUnit property is specified.
400The expiryUnit property is required when expiryValue property is specified.
400Invalid value for oneTimeUse, expiryUnit, or expiryValue.
403 Not authorized to perform the request.
429Too many requests; rate limit exceeded.
500Internal server error occurred while processing the request.