Set Two-Factor Phone Verification

How to set two-factor phone verification through the Cosync REST API

Set the two factor phone verification for the user. This function controls whether two-factor phone verification is enabled for the logged in user or not.

URL
    /api/appuser/setTwoFactorPhoneVerification
Method
    POST
Headers
    access-token: "<Access Token>"
Data Parameter
    {
        twoFactor: "<true or false>",
    }

Response:

Success:

StatusCode:
    200 (OK)
Contents:
    true

Error:

StatusCode:
    400 (BAD REQUEST)
    500 (INTERNAL SERVER ERROR)
Content:
    {
        code: "<internal error code>",
        message: "<readable error description>"
    }

The internal codes are integers:

  • 401 - app no longer exists
  • 402 - app is suspended
  • 403 - missing parameter
  • 404 - user account is suspended
  • 405 - invalid access token
  • 409 - app does not support phone two-factor verification
  • 410 - user does not have verified phone number
  • 500 - internal server error
  • 602 - invalid data