Skip to content

Banned Clients API

This API documentation provides information on various operations related to managing banned clients list, including viewing banned clients, add clients to the banned clients list, and delete banned clients.

View Banned Clients

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

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

Response Example

JSON
{
  "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
}

Create Banned Clients

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

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

Response Example

JSON
{
  "code": 0,
  "data": {
    "who": "example",
    "until": 1668504415,
    "reason": "example",
    "by": "user",
    "at": 1668504115,
    "as": "clientid"
  }
}

Delete Banned Clients

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

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

Response Example

JSON
{
  "code": 0
}