Skip to main content

ResetUserPassword

Password initialization request (workspace administrator)

Description

  • The workspace administrator requests that the target user change the password.
  • If you would like to use a Sendgrid email template specific to your system, please contact Hexabase in advance. You can use your Sendgrid email template by specifying the Hexabase email_templates_id issued.
  • If you want to handle mail services other than Sendgrid, please refer here.

Method

POST

Request URL Format

/api/v0/users/password/reset

Payload

{
"email":"パスワードをリセットしたいユーザーのemail", //Required
"sender_address": "[email protected]", // (Optional) Specify if you want to change the mail from to any value.
"host": "", //(Optional) Specify the host name to be used for the URL linked to in the email. If omitted, the Hexabase Management UI is specified. Example implementation = `https://${window.location.host}` (When moving to the page prepared in the SPA UI) If email_templates_id is specified, it is required.
"root_path": "(reset_password に相当する部分のURL内のパス)" , // (Optional)
"query_params": "(一意キーの後続くGETパラメータを指定)", // (Optional) ? Specify after
"email_templates_id" : "5fb205b03545feade82dxxxx", // (Optional)Set this option if you wish to use the Sendgrid template for invitation emails. Please contact Hexabase in advance and provide the email setup ID. If you omit this setting, Hexabase will use its default password change screen.
"exclusive_w_id": "624bea3a879f4e8d8b5dcc6c" // (Optional)Specifies the target workspace ID if the target is a workspace-only user.
}
{
"email":"パスワードをリセットしたいユーザーのemail", //Required
"new_password":"", // Required a new password. Example:test
"confirm_password":"", //Required confirmation password. Example: test This value must be the same as the newly created value
"id":"", //Required Insert here the information embedded inside the email link after sending the API to start password initialization.
"send_password_to_email": true // Send a registration completion email when the API is executed. Default false
"sender_address": "[email protected]" // Specify if you want to change the source of the registration completion email to any value.
}

URL Sample in Payload and Email

Request URL Sample

POST https://api.xxx.com/api/v0/users/password/forgot
  • default
{
"email": "[email protected]"
}

Redirects to the destination indicated by the link generated in the email sent (xxxxxx... は一時的に生成されるユニークID)

https://app.hexabase.com/reset_password/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

For example, if you specify the following:

{
"email": "[email protected]",
"host": `https://${window.location.host}`,
"root_path": "pwd_reset" ,
"query_params": "param1=AAA&param2=BBB"
}

The redirect destination will change as follows (If the hostname of the front-end APP is myapp.sample-spa.com):

https://myapp.sample-spa.com/pwd_reset/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx?param1=AAA&param2=BBB

This makes it possible to pass the necessary parameters to the password reset screen.

Response Sample

{
"valid_email": true //Whether there is an email that you want to initialize the password
}

ResetUserPassword (Example of mail service usage other than Sendgrid)

  • You can set a flag to prevent standard emails from being sent by specifying a flag

Payload

{
"email":"パスワードをリセットしたいユーザーのemail", //Required
"exclusive_w_id": "624bea3a879f4e8d8b5dcc6c", // (Optional)Specifies the target workspace ID if the target is a workspace-only user
"no_confirm_email": true // If true, the Hexabase standard Sendgrid email will not be sent
}

Response Sample

  • no_confirm_email: if true, the confirmation_id corresponding to the request is returned.
  • The returned confirmation_id can be used as the id for SetNewPassword.
{
"confirmation_id": "0vsr2g46q3xuxrx8clg638668d7qacpx9azjl960l07orv31ar3e3yo4lv32iimedye09grwetqubnfbti7nrnsnm6o9ey6fqweo",
"valid_email": true //Whether there is an email that you want to initialize the password.
}