知我云SMS提供简单易用的HTTP API接口,支持短信发送、查询等功能。
所有API请求需要在请求头中携带认证信息:
{
"username": "your_username",
"password": "md5(your_password)",
"tKey": "timestamp"
}
说明:
| 参数名 | 类型 | 必填 | 说明 |
|---|---|---|---|
| mobile | string | 是 | 手机号 |
| tpId | string | 是 | 模板ID |
| signature | string | 是 | 签名(含【】) |
| tpContent | object | 否 | 模板变量 |
{
"username": "test_user",
"password": "c36be9377fab8270c4507d65d852fa6b",
"tKey": "1234567890",
"mobile": "13800138000",
"tpId": "123456",
"signature": "【知我云】",
"tpContent": {
"code": "123456"
}
}
{
"code": 200,
"msg": "发送成功",
"data": {
"msgId": "msg_1234567890"
}
}
说明:批量发送使用相同的接口,通过 records 数组传入多个手机号即可。
{
"username": "test_user",
"password": "c36be9377fab8270c4507d65d852fa6b",
"tKey": "1234567890",
"tpId": "123456",
"signature": "【知我云】",
"records": [
{
"mobile": "13800138000",
"tpContent": {
"code": "123456"
}
},
{
"mobile": "13800138001",
"tpContent": {
"code": "654321"
}
}
]
}
{
"code": 200,
"msg": "success",
"data": {
"balance": 1000.00,
"currency": "CNY"
}
}
| 错误码 | 说明 |
|---|---|
| 200 | 成功 |
| 400 | 参数错误 |
| 401 | 认证失败 |
| 403 | 余额不足 |
| 404 | 资源不存在 |
| 500 | 服务器错误 |