API Request to Blacklist IPs

This topic helps to blacklist IPs through API call.  

There are two steps involved in the process. 

Step 1: Authentication

To access this API, customers must complete authentication through login API.

Click here to learn about the authentication process through login API.

 

Step 2: Blacklist IPs

HTTP Method: POST

Endpoint: https://tas.indusface.com/wafportal/rest/attack/blacklistIps

Header Parameters: application/json

Possible Responses:

200 – Success 

400 – Fail  

500 – Server error

 

Sample Request:

{
"websiteIds": [7425, 7434],
"ips": ["11.11.11.11", "22.22.22.22"]
}

Sample Response:

{
    "params": {
        "jobId": "55rts",
        "blacklistedIps": [
            "11.11.11.11",
            "22.22.22.22"
        ]
    },
    "successMessage": "Successfully blacklisted IPs"
}

Bad Response 1:

{
"errorMessages": [
"There must be at least one website to blacklist an IP for"
]
}

Bad Response 2:

{
"errorMessages": [
"There must be at least one IP to blacklist"
]
}

Bad Response  3:

{
"errorMessages": [
"IP range can take a max value of 31, please modify the subnet mask value range"
]
}

Bad Response 4:

{
    "errorMessages": [
        "IP validation failed"
    ]
}

Bad Response 5:

{
"errorMessages": [
"Internal Server Error"
]
}

Was this helpful?