Child pages
  • WHM API 1 Functions - delete_cphulk_record
Skip to end of metadata
Go to start of metadata

Description

This function deletes a record or records from cPHulk's whitelist or blacklist.

Examples 


 JSON API
https://hostname.example.com:2087/cpsess##########/json-api/delete_cphulk_record?api.version=1&list_name=white&ip=192.168.0.1
 XML API
https://hostname.example.com:2087/cpsess##########/xml-api/delete_cphulk_record?api.version=1&list_name=white&ip=192.168.0.1
 Command Line
whmapi1 delete_cphulk_record list_name=white ip=192.168.0.1


Notes:

  • You must URI-encode values.
  • For more information and additional output options, read our Guide to WHM API 1 documentation or run the whmapi1 --help command.
  • If you run CloudLinux™, you must use the full path of the whmapi1 command:

    /usr/local/cpanel/bin/whmapi1

 Output (JSON)
{
 "data": {
    "requester_ip": "10.0.0.0",
    "ips_removed": [
      "192.168.0.1"
    ],
    "ips_failed": {
       
    },
    "list_name": "white"
  },
  "metadata": {
    "version": 1,
    "reason": "OK",
    "result": 1,
    "command": "delete_cphulk_record"
  }
}
 Output (XML)
<result>
    <data>
        <requester_ip>10.0.0.0</requester_ip>
        <ips_removed>192.168.0.1</ips_removed>
        <ips_failed/>
        <list_name>white</list_name>
    </data>
    <metadata>
        <version>1</version>
        <reason>OK</reason>
        <result>1</result>
        <command>delete_cphulk_record</command>
    </metadata>
</result>


Note:

Use WHM's API Shell interface (WHM >> Home >> Development >> API Shell) to directly test WHM API calls.

Parameters

ParameterTypeDescriptionPossible valuesExample
list_namestring

Required

The cPHulk list's name.

  • black
  • white
white
ipstring

Required

The record's IP address.

Note:

To delete multiple IP addresses, increment the parameter name. For example, ip-1, ip-2, ip-3

A valid IP address.192.168.0.1

Returns

ReturnTypeDescriptionPossible valuesExample
requester_ipstringThe requester's IP address.A valid IP address.192.168.0.1

list_name

stringThe cPHulk list's name.
  • black
  • white
white
ips_removedarray of stringsAn array of the IP addresses that the function removed from the list.An array of IP addresses.192.168.0.1
ips_failedhashA hash of information about IP addresses that the system failed to add to the list.This hash contains one or more IP address returns. 

IP address

string

The reason why the system failed to add the IP address to the list.

Note:

The IP address is the return's name.

The function returns this value in the ips_failed hash.

A valid string.Invalid IP address or range "192.68.0.1"