CheckSmsVerifyCode

更新时间:
复制 MD 格式

Verifies an SMS verification code and returns the verification result.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

dypns:CheckSmsVerifyCode

none

*All Resource

*

None None

Request parameters

Parameter

Type

Required

Description

Example

SchemeName

string

No

The scheme name. The name can contain up to 20 characters. If you do not specify this parameter, the API uses the default scheme.

Important This value must match the SchemeName specified in the SendSmsVerifyCode request.

测试方案

CountryCode

string

No

The country code of the phone number. The default value is 86.

86

PhoneNumber

string

Yes

The phone number.

186****0000

OutId

string

No

An external ID to track the request.

12123231

VerifyCode

string

Yes

The verification code.

Note
  • The TemplateParam parameter in the SendSmsVerifyCode request can be configured in two ways:

    • {"code":"##code##","min":"5"}

    • {"code":"123456","min":"5"}

  • If you use {"code":"##code##","min":"5"}, the API dynamically generates the verification code, and Alibaba Cloud can verify it.

  • If you use {"code":"123456","min":"5"}, you specify the verification code instead of the API generating one. Alibaba Cloud cannot verify this code.

  • Ensure you pass the correct verification code for your configuration.

1231

CaseAuthPolicy

integer

No

The case-sensitivity policy for verification. Valid values:

  • 1: Case-insensitive.

  • 2: Case-sensitive.

1

Response elements

Element

Type

Description

Example

object

AccessDeniedDetail

string

The access denial details.

Message

string

The description of the status code.

成功

Model

object

The data returned for the request.

OutId

string

The external ID.

1212312

VerifyResult

string

Indicates whether the SMS verification code is valid. Valid values:

  • PASS: The verification is successful.

  • UNKNOWN: The verification failed.

PASS

Code

string

The status code of the request.

  • A value of OK indicates the request was successful.

  • For other error codes, see Error codes.

    Important A successful request does not mean the SMS verification code is valid. The verification result is provided in the Model.VerifyResult parameter.

OK

Success

boolean

Indicates whether the request was successful. Valid values:

  • true: The request was successful.

  • false: The request failed.

    Important A successful request does not mean the SMS verification code is valid. The verification result is provided in the Model.VerifyResult parameter.

true

RequestId

string

The ID of the request.

CF8854E5-DB21-3E5D-A9B1-DDC752FD7384

Examples

Success response

JSON format

{
  "AccessDeniedDetail": "无",
  "Message": "成功",
  "Model": {
    "OutId": "1212312",
    "VerifyResult": "PASS"
  },
  "Code": "OK",
  "Success": true,
  "RequestId": "CF8854E5-DB21-3E5D-A9B1-DDC752FD7384"
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.