Skip to content
Kang Chen edited this page Dec 19, 2015 · 5 revisions

IP Filter

YuanPad uses IP Filter to block IPs which were abused to send junk comments, IP filter is an important part of the anti-spam system.

What can you do with IP Filter?

  1. GET index.php?controller=badip&action=list

    Receive a list of all IPs in the black list.

  2. POST index.php?controller=badip&action=create

    Add an IP address to the black list.

  3. POST index.php?controller=badip&action=update

    Remove one or more IPs from the black list.

Endpoints

  1. GET index.php?controller=badip&action=list

    Receive a list of all IPs in the black list.

    Request:

    Request Header Type Description
    RequestVerificationToken string Required

    Response:

    {
        "statusCode": 200,
        "statusText": "OK",
        "response": [{
            "ip": "192.168.1.251"
        }, {
            "ip": "192.168.1.15"
        }]
    }
    
  2. POST index.php?controller=badip&action=create

    Add an IP address to the black list, and receive the list of all blocked IPs.

    Request:

    Request Header Type Description
    RequestVerificationToken string Required
    Query String Parameter Type Description
    ip string Required.

    The IP address to be added into the black list

    Response:

    {
        "statusCode": 200,
        "statusText": "OK",
        "response": [{
            "ip": "210.78.137.46"
        }]
    }
    
  3. POST index.php?controller=badip&action=update

    Remove one or more IPs from the black list.

    Request:

    Request Header Type Description
    RequestVerificationToken string Required
    Query String Parameter Type Description
    select_ip array Required.

    The IP addresses to be removed from the black list

    Response:

    {
        "statusCode": 200,
        "statusText": "OK",
        "response": [{
            "ip": "192.168.1.54"
        }]
    }
    
Clone this wiki locally