Cloud Administration Password Reset Code API
a year ago

Cloud Administration Password Reset Code API

Use the Cloud Administration Password Reset Code API to generate password reset codes for a set of users.

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

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 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 a password code for a user.

ActionMethodRequest URLResponse Content TypeResponse BodyAPI Response Codes
Generate Password Reset CodesPOSTAdminInterface/restapi/v1/users/generateVerifyCode/resetPassword application/json json 1000, 1001, 1002, 1003, 1004, 1005, 1006

Example Request Data

The following example displays a request.

POST /AdminInterface/restapi/v1/users/generateVerifyCode/resetPassword

Accept: application/json

Authorization: Bearer <JWT token>

Request Body Parameters

The following table describes the request body parameters.

Request ParameterDescriptionRequired?Default ValueData Type
emailThe user email that a password reset code should be generated for.Yes String
custom_emailAn alternate email to send the password reset code to.NonullString
code_validityThe time period the generated code is valid for. - If "code_validity" is provided as a parameter, "validity_time_duration_unit" must also be providedNo"10" String
validity_time_duration_unit The unit for the validity period. Can be "MIN" or "HOUR".No"MIN"String
code_send_to

The mode of sending the generated password reset code to the user. Can be "DISPLAY" or "EMAIL".

No
"DISPLAY"
String

Example Request Body

The following is an example request body.

[{
        "email": "user1@example.com",
        "code_validity": "10",
        "validity_time_duration_unit": "MIN"
    }, {
        "email": "user2@example.com",
        "custom_email": "alternate1@example.com",
        "code_validity": "5",
        "validity_time_duration_unit": "HOUR",
        "code_send_to": "EMAIL"
    }
]

Note:  Password reset codes will be emailed to the designated user if the generation request includes the "code_send_to" parameter set to "EMAIL" for that user. You can specify an alternate email address in the request parameters if you want the reset code to be sent to that alternate email instead.

Response Body Parameters

The following table describes the response body parameters.

Response ParameterDescriptionData Type
verify_codeThe generated password reset code.String
verify_code_validity_timeThe timestamp that this generated code will expire at.String
verify_code_generation_modeThe mode this code was generated for. i.e. PASSWORD_RESET or _ENROLLMENTString
verification_LinkThe link to reset the user's password.String

Example Response Body

The following example response shows password reset code for all users when generated successfully.

[
    [{
            "status": 1000,
            "errorMessage": "Code Successfully Generated. ",
            "userDetailsRequestForVerifyCodeGeneration": {
                "email": "user1@example.com",
                "code_validity": "10",
                "validity_time_duration_unit": "MIN",
                "code_send_to": "DISPLAY"
            },
            "verify_code": "123456789",
            "verify_code_validity_time": "2024-07-01 11:24:50 UTC",
            "verify_code_generation_mode": "PASSWORD_RESET",
            "verification_Link": "https://example-admin.com/resetPassword/admin"
        }
    ]

Note:  The response from the generate request will show whether the email delivery was successful. A status code of 1000 indicates that the email was sent successfully, whereas a status code of 1005 signifies an error occurred while attempting to send the email.

Response Codes

The following table shows response codes and descriptions for this API.

CodeAPI Response CodeDescription
400 Bad request caused by the following:
Number of users exceeds maximum allowed value of 100.
{ "code": "400 BAD_REQUEST", "description": "Number of user details (178) in request exceeds maximum allowed (100)" }
429 Too many requests.
2001000Successful code generation.
2001001An unknown error occurred during generation.
2001002

Invalid user.

2001003Invalid email format.
2001004

Invalid validity duration or unit.

2001005

Unable to send the email.

2001006

Code generation not allowed.