# Blacklist Management

# Check Blacklist Information

# URI

GET /banned

Get the blacklist

Query String Parameters:

NameTypeDescription
_pageIntegerPage number
_limitIntegerNumber of data displayed per page

# Request Message

None

# Response Message

NameTypeDescription
codeInteger0
dataArray of ObjectsBlacklist data
data[].whoStringObjects added to the blacklist
data[].asStringUsed to distinguish the types of blacklist objects
data[].reasonStringDetailed information
data[].byStringIndicate which object was added to the blacklist
data[].atIntegerTime added to blacklist, unit: second
data[].untilIntegerWhen to remove from blacklist, unit: second
metaObjectPaging information
meta.pageIntegerPage number
meta.limitIntegerNumber of data displayed per page
meta.countIntegerTotal number of data

# Request Example

$ curl -u app_id:app_secret -X GET {api}/banned
1

# Response Example

{
  "meta": {
    "page": 1,
    "limit": 10,
    "count": 2
  },
  "data": [
    {
      "who": "clientid_test",
      "until": 1668504415,
      "reason": "reason_test",
      "by": "user",
      "at": 1668504115,
      "as": "clientid"
    },
    {
      "who": "user_test",
      "until": 1668504469,
      "reason": "reason_test",
      "by": "admin",
      "at": 1668504169,
      "as": "username"
    }
  ],
  "code": 0
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26

# create blacklist information

# URI

POST /banned

Add object to blacklist

# Request Message

NameTypeRequiredDefaultDescription
whoStringRequiredObjects added to the blacklist, which can be client identifiers, usernames, and IP addresses
asStringRequiredUsed to distinguish the types of blacklist objects, which can be clientidusernamepeerhost
reasonStringRequiredDetailed information
byStringOptionaluserIndicate which object was added to the blacklist
atIntegerOptionalCurrent system timeTime added to blacklist, unit: second
untilIntegerOptionalCurrent system time+ 5 minutesWhen to remove from blacklist, unit: second

# Response Message

NameTypeDescription
codeInteger0
dataObjectsBlacklist information
data.whoStringObjects added to the blacklist
data.asStringUsed to distinguish the types of blacklist objects
data.reasonStringDetailed information
data.byStringIndicate which object was added to the blacklist
data.atIntegerTime added to blacklist, unit: second
data.untilIntegerWhen to remove from blacklist, unit: second

# Request Example

$ curl -u app_id:app_secret -X POST {api}/banned -d '{"who":"example","as":"clientid","reason":"example"}'
1

# Response Example

{
  "code": 0,
  "data": {
    "who": "example",
    "until": 1668504415,
    "reason": "example",
    "by": "user",
    "at": 1668504115,
    "as": "clientid"
  }
}
1
2
3
4
5
6
7
8
9
10
11

# Delete blacklist information

# URI

DELETE /banned/{as}/{who}

Delete object from blacklist

# Request Message

None

# Response Message

NameTypeDescription
codeInteger0
messageStringReturn only when an error occurs to provide more detailed error information

# Request Example

$ curl -u app_id:app_secret -X DELETE {api}/banned/clientid/example
1

# Response Example

{
  "code": 0
}
1
2
3