changePassword

POST public/changePassword

Changes your SC//AcuVigil password. Use it to set a new password after resetPassword emails you a temporary password, or when your password has expired. If the change succeeds, you're also signed in.

Request syntax

curl https://apiv2.acumera.net/public/changePassword \
  --cookie-jar av_session.txt \
  --data-urlencode "username=<username>" \
  --data-urlencode "password=<current_or_temporary_password>" \
  --data-urlencode "tfa_token=<2fa_code>" \
  --data-urlencode "new_password=<new_password>" \
  --data-urlencode "new_password_confirm=<new_password>"

All parameters are required, even if you already have a session. Because a successful change also signs you in, you can save the session cookie with --cookie-jar.

Request parameters

The request accepts the following parameters in a form-encoded body.

Parameter Type Description Required Default value
username String Your SC//AcuVigil username (your email address). Yes
password String Your current password, or the temporary password from the password reset email. Yes
tfa_token String The current code from your two-factor authentication (2FA) app. Yes
new_password String The new password. It must meet the SC//AcuVigil password rules and can't be a password you've used before. Yes
new_password_confirm String The new password again. It must match new_password exactly. Yes

Response syntax

{
    "success": "string",
    "returnCode": "string",
    "returnMessage": "string"
}

Response parameters

Field Description
success "1" if the password was changed, "0" if it wasn't.
returnCode PASSWORD_SUCCESSFULLY_UPDATED when the password was changed.
returnMessage A description of the result.

Errors

If the call fails, success is "0", and returnCode and returnMessage describe the problem. The HTTP status is still 200.

Return code Message Cause
AUTH_FAILED_NO_USER Authentication failed because no username was provided. username is missing or empty.
AUTH_FAILED_NO_PASSWORD Authentication failed because no password was provided. password is missing or empty.
AUTH_FAILED_NO_TOKEN Authentication failed because no 2FA token was provided. tfa_token is missing or empty.
INVALID_LOGIN We were unable to log you in. Make sure you entered the correct username, password and 2FA code. The username, current password, or 2FA code is wrong.
INVALID_NEW_PASSWORD There is a problem with the new password you entered. Please try again. A new password parameter is missing, the two don't match, the password doesn't meet the password rules, or you've used it before.

Examples

Example: Change your password

curl https://apiv2.acumera.net/public/changePassword \
  --cookie-jar av_session.txt \
  --data-urlencode "username=pat@example.com" \
  --data-urlencode "password=<current_password>" \
  --data-urlencode "tfa_token=123456" \
  --data-urlencode "new_password=<new_password>" \
  --data-urlencode "new_password_confirm=<new_password>"

Response:

{
    "success": "1",
    "returnCode": "PASSWORD_SUCCESSFULLY_UPDATED",
    "returnMessage": "Your password has been successfully updated."
}

Example: New passwords don't match

If new_password and new_password_confirm are different, or the new password isn't allowed, the password isn't changed:

{
    "success": "0",
    "returnCode": "INVALID_NEW_PASSWORD",
    "returnMessage": "There is a problem with the new password you entered. Please try again."
}