通过 POST 方式提交,数据编码采用 utf-8 格式。
签名认证【必读】 签名机制文档:https://www.ihuyi.com/api/request.html
https://api.ihuyi.com/empty-number/balance
| 参数名称 | 参数值描述 | 示例 | 类型 | 必填 |
| Content-Type | 内容类型,固定值 | application/json | string | 是 |
| Date | GMT时间,误差±300秒 | Mon, 16 Jun 2025 08:24:34 GMT | string | 是 |
| Authorization | 签名头 | Signature keyId="end7348191", algorithm="hmac-sha256", ... | string | 是 |
| 参数名称 | 参数值描述 | 示例 | 类型 | 必填 |
| 参数名称 | 参数值描述 | 示例 | 类型 | 必返 |
| code | 状态码(2成功) | OK|ParamError | string | |
| msg | 结果描述 | 请求成功|参数错误 | string | |
| data | 数据 | object | ||
| balance | 剩余检测条数 | 1 | int |
| code | msg |
| 0 | 未知错误 |
| 2 | 请求成功 |
| 400 | 非法IP访问 |
| 403 | 应用不存在 |
| 405 | API ID或API KEY不正确 |
| 4050 | 余额查询失败 |
| 40505 | 没有签订合同 |
| 4051 | 剩余条数不足 |
| 1100 | 参数错误 |
不支持
示例(成功)
{ "code":
"OK"
, "msg":
"请求成功"
, "data":
{ "balance":
1
}
}
示例(失败)
{"code":"ParamError","msg":"参数错误"}
$keyId = 'xxxxxxxxxxxxxxxx'; //可登录用户中心查看,对应APIID
$Data = gmdate('D, d M Y H:i:s \G\M\T');
$algorithm = 'hmac-sha256';
$signature = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'; // 请替换为您的签名字符串,可参考:https://gitee.com/shsurlink/api-demo/blob/master/hmac-auth/php/IhuyiSignatureHelper.php
$Authorization = sprintf('Signature keyId="%s", algorithm="%s", headers="%s", signature="%s"', $keyId, $algorithm, '@request-target date host', $signature)
//注意:所有字符编码统一为UTF-8
在线咨询
150,000家
企业客户
21年
行业经验
2V1
2对1客户支持