Verify Pass-code

Check whether the passcode by user input is effective or not. The required parameter are the mobile number, the pass code to verify, and the token of client.

Request

URI: /2fa/verifyCode

Request Type:POST

Content Type:application/json

HTTP-Head: sms-token, it must be the same as the token returned by the invoke of 'send' rest api

Parameter

Parameter Data Type Required Description Example
phoneNumber String required the number of phone received the pass-code +8613118101234
code String required the pass-code by user input 123456
{"phoneNumber": "1234567890", "code": "322675"}

Request Sample

curl --request POST \
  --url https://dev.ebaocloud.com/api/two-factor-service/2fa/verifyCode \
  --header 'content-type: application/json' \
  --header 'sms-token: 8qpvjb57otdu72eo6tenjqms0n' \
  --data '{
    "phoneNumber": "1234567890",
    "code": "322675"
}'

Response

Parameter

Field Data Type Description Example
errorMessage String error message "verification code expired"
isVerified boolean the code is effective or not true/false

Response Sample

  • success

    {"errorMessage":"", "isVerified": true}
    • fail
    {"errorMessage":"wrong verification code", "isVerified": false}

results matching ""

    No results matching ""