根据手机号和身份证查询注册状态说明

1、根据手机号和身份证查询注册状态, 接口限制调用频次 需每分钟小于30次

2、请求参数手机号和身份证号使用AES(AES/CBC/PKCS5Padding填充方式)加密后传输,密钥首约侧提供

地址URL

测试:https://test-open-gw.01zhuanche.com/driver-register-status/queryDriverInfo

预生产:https://pre-open-gw.01zhuanche.com/driver-register-status/queryDriverInfo

线上:https://open-gw.01zhuanche.com/driver-register-status/queryDriverInfo

HTTP请求方式

POST

Content-Type = application/x-www-form-urlencoded

请求参数

名称 选项 类型及范围 说明
sign 必选 string 签名
phone 必选 string 手机号,AES加密
idCard 必选 string 身份证号,AES加密
channelNo 必选 string 渠道号,首约和密钥一同提供

返回数据

名称 类型 说明
code int 0:成功;非0:失败原因编号
msg string 失败原因描述,若成功则值为空
data jsonObject json数据
data.status number 0:不存在 1:存在

返回示例

{
    "code":1,
    "msg":"sign error",
    "data":null
}

{
    "code":0,
    "data":{
        "status":1
    },
    "msg":"成功",
}
超过频次时返回示例如下
{
    "timestamp": "2025-01-20T07:08:06.126+0000",
    "status": 429,
    "error": "Too Many Requests",
    "message": "429"
}

加密工具java版本示例

package ***;
import lombok.extern.slf4j.Slf4j;
import org.springframework.util.Base64Utils;
import javax.crypto.Cipher;
import javax.crypto.spec.SecretKeySpec;

/**
* AES/ECB/PKCS5Padding
*/
@Slf4j
public class AESUtil {
    private static final String KEY_ALGORITHM = "AES";
    /**
    * 算法/模式/补码方式
    */
    private static final String DEFAULT_CIPHER_ALGORITHM = "AES/ECB/PKCS5Padding";
    private static final String CODE = "utf-8";

     /**
    * 加密
    */
    public static String encrypt(String content, String key) {
        try {
            byte[] encrypted = encrypt2bytes(content, key);
            return Base64Utils.encodeToString(encrypted);
        } catch (Exception e) {
            log.error("failed to encrypt: {} of {}", content, e);
            return null;
        }
    }

    public static byte[] encrypt2bytes(String content, String key) {
        try {
            byte[] raw = key.getBytes(CODE);
            SecretKeySpec secretKeySpec = new SecretKeySpec(raw, KEY_ALGORITHM);
            Cipher cipher = Cipher.getInstance(DEFAULT_CIPHER_ALGORITHM);
            cipher.init(Cipher.ENCRYPT_MODE, secretKeySpec);
            return cipher.doFinal(content.getBytes(CODE));
        } catch (Exception e) {
            log.error("failed to encrypt: {} of {}", content, e);
            return null;
        }
    }

    /**
    * 解密
    */
    public static String decrypt(String content, String key){
    try {
            return decrypt(Base64Utils.decodeFromString(content), key);
        } catch (Exception e) {
            log.error("failed to encrypt: {} of {}", content, e);
            return null;
        }
    }
    public static String decrypt(byte[] content, String key) throws Exception {
        if (key == null) {
            log.error("AES key should not be null");
            return null;
        }
        byte[] raw = key.getBytes(CODE);
        SecretKeySpec keySpec = new SecretKeySpec(raw, KEY_ALGORITHM);
        Cipher cipher = Cipher.getInstance(DEFAULT_CIPHER_ALGORITHM);
        cipher.init(Cipher.DECRYPT_MODE, keySpec);
        try {
            byte[] original = cipher.doFinal(content);
            return new String(original, CODE);
        } catch (Exception e) {
            log.error("failed to decrypt content: {}/ key: {}, e: {}", content, key, e);
            return null;
        }
    }
}
Copyright © 首约科技(北京)有限公司 2020 all right reserved,powered by Gitbook该文件修订时间: 2025-04-03 08:26:30

results matching ""

    No results matching ""