پرش به مطلب اصلی

Add To Blacklist API

POST /addToBlacklist

Description

This API endpoint allows adding an IP address to the blacklist. Blacklisting an IP address will prevent it from accessing certain resources or services.

Request Body

The request utilizes GraphQL to perform the addToBlacklist mutation.

Mutation:

mutation addToBlacklist ($ipAddress: String!) {
addToBlacklist (ipAddress: $ipAddress) {
id
ipAddress
}
}

Variables:

{
"ipAddress": "<IP_Address>"
}
  • ipAddress (String): The IP address to be added to the blacklist.

Response:

  • Success (200 OK):

    • The response confirms that the IP address has been successfully added to the blacklist and includes details about the blacklisted IP.
    {
    "data": {
    "addToBlacklist": {
    "id": "<ID>",
    "ipAddress": "<IP_Address>"
    }
    }
    }
  • Error (4XX/5XX):

    • If there is an issue with adding the IP address, such as the IP address already being blacklisted or server errors, the response will include an appropriate error message and status code.

Note:

Ensure that the IP address you wish to add to the blacklist is not already on the blacklist. The response will include details confirming the addition of the IP address.