Secondary verification interface

2022.01.14 14:05:33

    Every time the user completes a verification, Yidun captcha service will record the verification information related to the request to ensure that the verification is valid and completed recently, and the verification information will be invalidated (default is 20 minutes), set a personalized timeout period for user verification behavior and submission behavior, effectively preventing the risk of batch timing malicious verification.

    Interface Description

    When the user submits the form (post-form) to the product application background, it will carry a parameter related to the verification code. The parameter name is NECaptchaValidate. The product application needs to pass this parameter to the Yidun verification code background for secondary verification. The final verification result is subject to the secondary verification interface.

    Authentication Instructions

    Yidun verification service uses the signature method to authenticate the interface. Every request of all interfaces needs to include the signature information (signature parameter) to verify the user's identity and prevent the information from being maliciously tampered with.
    Currently supports MD5, SHA1, SHA256, SM3, HMAC_SHA256 several encryption algorithms, for details, please refer to Interface Authentication

    Request

    REQUEST DESCRIPTION
    HTTP URL https://c.dun.163.com/api/v2/verify
    HTTP Method POST

    Request Header

    NAME TYPE REQUIRED DESCRIPTION
    Content-Type string YES Fixed value:"application/x-www-form-urlencoded"

    Request Parameter

    Request parameters are composed of common parameters and interface parameters. For common parameters, see Request Common Fields

    Interface Parameter

    NAME TYPE REQUIRED MAX LENGHTH DESCRIPTION
    captchaId string YES 32 captchaId
    validate string YES Unlimited length, 1024 is recommended Submit the verification data for the secondary verification, that is, the NECaptchaValidate value. The verification can only be successful once, and repeated verification will return the verification failure. The effective duration is 20 minutes by default, and can be configured from 1 to 20 minutes on the official website
    user string YES 32 User information, the value can be empty

    Request Body Example

    captchaId=xxx&validate=xxx&signature=xxx&secretId=xxx&version=v2&timestamp=xxx&nonce=xxx
    

    Response Result

    NAME TYPE REQUIRED DESCRIPTION
    result boolean YES The final judgment result of the verification which is based on this field: true: verification passed, false: verification failed
    error int YES Error Code
    msg string YES Error Message
    phone string NO The number is limited to the SMS verification type, and returns to the mobile phone after the user sends the SMS successfully
    captchaType int NO Used to return the verification type, you need to configure whether to return
    token string NO Used to return the verification process token, you need to configure whether to return
    sdkReduce boolean NO It is used to identify whether to go to the degrade strategy. It needs to be configured whether to return
    extraData string NO Returns the extraData content passed in by the business party during initialization, see web access parameter configuration for details.

    Response Body Example

    {
        "result": true,
        "error": 0,
        "msg": "ok",
        "phone": "",
        "extraData": "",
        "captchaType": 2,
        "token": "xxx",
        "sdkReduce": false
    }
    

    Error Code

    HTTP STATUS ERROR CODE Description Troubleshooting suggestions
    200 0 normal
    200 415 Signature verification error It is recommended to check whether the signature method is correct
    200 419 Parameter validation errors, such as parameter type error, parameter value error, required items are empty, etc It is recommended to check whether the parameter value is correct
    200 430 qps over limit
    200 421 Captcha version mismatch It is recommended to check the verification code version information
    Online Chat Tel:95163223