Skip to content

Whitelist IP

sadhasivam edited this page Sep 10, 2024 · 1 revision

Update or Create Whitelist IP

URL: /api/admin/whitelist/updateOrCreate

Method: POST

Description: Adds or updates a whitelist IP.

Parameters

Parameter Type Required/Optional Description
whitelist_host_ip String Required The IP address to be added to the whitelist.
whitelist_host_comments String Optional Additional comments or notes about the whitelisted IP.
id Integer Optional The ID of the whitelist entry to update. If not provided, a new entry will be created.

Response

{
    "success": true,
    "message": "WhiteList Ip has been Created",
    "data": {
        "whitelist_host_id": 1,
        "whitelist_host_ip": "121.0.0.4.3",
        "whitelist_host_comments": "add new whitelist",
        "updated_at": "2024-09-10T05:10:02.000000Z",
        "created_at": "2024-09-10T05:10:02.000000Z"
    }
}

Edit Whitelist IP

URL: /api/admin/whitelist-edit/{id}

Method: GET

Description: Fetches details for editing a whitelist IP.

Parameters

Parameter Type Required/Optional Description
whitelist_host_id Integer Required The ID of the whitelist entry to be retrieved for editing.

Response

{
    "success": true,
    "message": "data",
    "data": {
        "host_data": {
            "whitelist_host_id": 1,
            "whitelist_host_ip": "121.0.0.4.4",
            "whitelist_host_comments": "add new whitelist",
            "created_at": "2024-09-10T05:10:02.000000Z",
            "updated_at": "2024-09-10T05:10:23.000000Z"
        }
    }
}

Delete Whitelist IP

URL: /api/admin/delete-whitelist-ip

Method: POST

Description: Deletes a whitelist IP.

Parameters

Parameter Type Required/Optional Description
whitelist_host_id Integer Required The ID of the whitelist entry to be deleted.

Response

{
    "success": true,
    "message": "The record you have selected has been deleted successfully",
    "data": 1
}

View Whitelist IPs

URL: /api/admin/view-Whitelist

Method: GET

Description: Displays the list of whitelist IPs.

Parameters

This endpoint does not require any parameters.

Response

{
   "success": true,
    "message": "List of Whitelist API",
     "data": [
            {
                "whitelist_host_id": 2,
                "whitelist_host_date": "2024-09-10",
                "whitelist_host_ip": "121.0.0.45",
                "whitelist_host_comments": "test"
            },
            {
                "whitelist_host_id": 1,
                "whitelist_host_date": "2024-09-10",
                "whitelist_host_ip": "121.0.0.4.4",
                "whitelist_host_comments": "add new whitelist"
            }
        ],
}

Clone this wiki locally