发送登录短信验证码
接口说明
该接口为使用手机验证码登录时发送登录短信验证码时使用
该接口需要在APP后台启用登录接口并配置好短信登录相关配置
注意事项
- 验证码有效期为5分钟(可配置)
- 手机号格式:
- 中国大陆:11位数字,以1开头
- 其他地区:请根据当地手机号格式规范
- 国际区号格式:以+开头,后面跟1-3位数字,如:+86
- 同一手机号每分钟只能发送一次验证码
请求路径
| Method |
URI Path |
鉴权方式 |
| POST |
/v1/login/verify_code |
签名认证 |
请求参数
公共参数
| 参数名 |
类型 |
取值范围 |
是否必须 |
说明 |
| appkey |
string |
- |
是 |
在行云为应用分配的appkey |
| timestamp |
string |
10位数字 |
是 |
当前时间戳(秒级) |
| sign |
string |
32位小写字母和数字 |
是 |
签名,算法为:md5(appkey + timestamp + app_secret),app_secret为在行云为应用分配的appSecret |
业务参数
| 参数名 |
类型 |
取值范围 |
是否必须 |
说明 |
| mcode |
string |
格式为:+xx |
是 |
国际电话区号,如:+86 |
| mobile |
string |
手机号码格式 |
是 |
手机号码,中国大陆为11位数字 |
请求示例代码
- application/x-www-form-urlencoded方式
curl --location --request POST 'https://api.zaihangyun.com/v1/login/verify_code' \
--header 'User-Agent: Apifox/1.0.0 (https://apifox.com)' \
--header 'Accept: */*' \
--header 'Host: api.zaihangyun.com' \
--header 'Connection: keep-alive' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'appkey=D5fceA1sVtmaMY1F' \
--data-urlencode 'mcode=+86' \
--data-urlencode 'timestamp=1745653704' \
--data-urlencode 'sign=89baeb05b60b59108087960b077963ca' \
--data-urlencode 'mobile=18518768888'
curl --location --request POST 'https://api.zaihangyun.com/v1/login/mobile' \
--header 'User-Agent: Apifox/1.0.0 (https://apifox.com)' \
--header 'Content-Type: application/json' \
--header 'Accept: */*' \
--header 'Host: api.zaihangyun.com' \
--header 'Connection: keep-alive' \
--data-raw '{
"appkey": "D5fceA1sVtmaMY1F",
"mcode": "+86",
"mobile": "18518768888",
"timestamp": "1745653954",
"sign": "42704343af5fbc4a6639eb4826a53e91"
}'
{warning} json方式请一定要在header中声明:Content-Type: application/json
返回响应
{
"code": 200,
"msg": "success"
}
{
"code": "400107",
"msg": "mobile must be valid"
}
错误码说明
查看全局错误码
| 错误码 |
说明 |
400104 |
mcode参数缺失 |
400105 |
mcode格式不正确 |
400106 |
mobile参数缺失 |
400107 |
mobile格式不正确 |
400190 |
发送短信异常 |
400191 |
发送短信失败 |
400192 |
阿里云AccessKey配置未找到 |
400193 |
阿里云短信模板未找到 |
400194 |
阿里云短信签名未找到 |
400195 |
阿里云配置未找到 |
400196 |
手机登录未开启 |
400197 |
登录接口未启用 |
400198 |
登录接口配置未找到 |
400199 |
appkey不存在 |