Endpoint: /sites/{siteId}/ipAccess

Returns and update the network and security Site IP access/ban list Settings.

  • GET

  • POST

Method & URL

GET https://[server URL]:[port]/admin/v2/sites/{siteId}/ipAccessList

GET Body Sample

Copy
### GET Site IP access/ban list Settings ###
GET https://{{host}}/admin/v2/sites/{{Siteid}}/ipAccessList HTTP/1.1
Authorization: EFTAdminAuthToken {{AuthToken}}

GET Response Body Sample

Copy
{
  "data": [
    {
      "id": "192.168.100.*",
      "type": "access",
      "attributes": {
        "accessType": "Allow",
        "date": "2022-02-04",
        "isAutoBan": false,
        "reason": "Allow for test",
        "sequenceNumber": 1
      }
    },
    {
      "id": "0.0.0.0",
      "type": "access",
      "attributes": {
        "accessType": "Deny",
        "date": "1969-12-31",
        "isAutoBan": true,
        "reason": "",
        "sequenceNumber": 2
      }
    }
  ],
  "links": {
    "self": "/admin/v2/sites/a70ccebd-1317-4992-84e7-bb4cbddc02e4/ipAccessList"
  }
}

GET PowerShell Sample

Copy
### GET Site IP access/ban list Settings###
### User must obtain the SiteID from Get Sites
Write-Output "GET Site IP access/ban list Settings"
Write-Output "----"
#$siteID = Enter SiteID here
$siteList = Invoke-RestMethod -Uri "$baseURL/v2/sites/$siteID/ipAccessList" -Method 'GET' -Headers $authHeader
Write-Output $siteList | ConvertTo-Json 

Method & URL

POST https://[server URL]:[port]/admin/v2/sites/{siteId}/ipAccessList

POST Body Sample

Copy
POST https://{{host}}/admin/v2/sites/{{Siteid}}/ipAccessList HTTP/1.1
Authorization: EFTAdminAuthToken {{AuthToken}}

{
  "data": {
    "id": "139:10:112:56::246",
    "type": "access",
    "attributes": {
      "accessType": "Allow",
      "reason": "API TEST",
      "sequenceNumber": 4
    }
  }
}

PATCH Response Body Sample

The response will return the same response as the GET request, however, it will now include the updated PATCH request(s).

Copy
{
  "data": {
    "id": "139:10:112:56::246",
    "type": "access",
    "attributes": {
      "accessType": "Allow",
      "date": "2022-02-04",
      "isAutoBan": false,
      "reason": "API TEST",
      "sequenceNumber": 4
    }
  },
  "links": {
    "self": "/admin/v2/sites/a70ccebd-1317-4992-84e7-bb4cbddc02e4/ipAccessList/139:10:112:56::246"
  }
}

PATCH PowerShell Sample

Copy

### POST Site IP access/ban list Settings###

### POST Site IP access/ban list Settings###
### User must obtain the SiteID from Get Sites
Write-Output "POST Site IP access/ban list Settings"
Write-Output "-----"
$update = 
'
{
  "data": {
    "id": "139:10:112:57::246",
    "type": "access",
    "attributes": {
      "accessType": "Allow",
      "reason": "API TEST",
      "sequenceNumber": 5
    }
  }
}
'

$update = $update | ConvertFrom-Json
$update = $update | ConvertTo-Json -Depth 9
$patchReturn = Invoke-RestMethod -Uri "$baseURL/v2/sites/$siteID/ipAccessList" 
-Method 'POST' -Headers $authHeader -Body $update