# 短信黑名单接口说明文档

## 接口1： 黑名单查询接口

```http
POST HTTP://127.0.0.1:12120/sms/blacklist/api/query/
Content-Type: application/json

{
    "phone": "13231899751",
    "fromSystem": "test"
}
```

```json
{
  "success": true,
  "code": 200,
  "message": "成功",
  "data": {
    "querySuccess": true,
    "queryMessage": "当前在黑名单",
    "queryResult": {
      "reason": "1",
      "startTime": "20220702173144",
      "endTime": "20220801173144",
      "describe": "主叫流量：达到加黑阈值100条/3600秒，最低被叫用户数0；安全系数1.0，实际发送100，实际被叫用户数100",
      "allowToDel": true
    }
  }
}
```

### 返回参数说明
<table>
    <tr><td>querySuccess</td><td>是否在黑</td></tr>
    <tr><td>queryMessage</td><td>在黑情况：（1）无加黑记录（2）曾在黑名单，已解黑（3）当前在黑名单</td></tr>
    <tr><td>reason</td><td>入黑名单原因</td></tr>
    <tr><td>startTime</td><td>开始时间</td></tr>
    <tr><td>endTime</td><td>结束时间</td></tr>
    <tr><td>describe</td><td>命中策略说明</td></tr>
    <tr><td>allowToDel</td><td>是否允许解黑</td></tr>
</table>

## 接口2： 黑名单解除接口

- 本地访问 18631137650

```http
POST HTTP://127.0.0.1:12120/sms/blacklist/api/remove/
Content-Type: application/json

{
    "phone": "18631137650",
    "fromSystem": "test",
    "operator": "test01"
}
```

- 正式环境

```http
POST HTTP://133.96.94.108:12120/sms/blacklist/api/remove/
Content-Type: application/json

{
    "phone": "13739798862",
    "fromSystem": "test",
    "operator": "test01"
}
```

```json
HTTP/1.1 200 
Content-Type: application/json
Transfer-Encoding: chunked
Date: Mon, 01 Aug 2022 02:18:48 GMT
Connection: close

{
  "success": true,
  "code": 200,
  "message": "成功",
  "data": {
    "delBlkSuccess": true,
    "delBlkMessage": "成功解除黑名单"
  }
}
```

```json
HTTP/1.1 200 
Content-Type: application/json
Transfer-Encoding: chunked
Date: Wed, 03 Aug 2022 01:10:35 GMT
Connection: close

{
  "success": true,
  "code": 200,
  "message": "成功",
  "data": {
    "delBlkSuccess": false,
    "delBlkMessage": "解除黑名单失败"
  }
}

```
