Endpoint: /sites/{siteId}/ipAccessList/{ipAccessId}
Returns, update and deletes network and security Site IP access/ban list Settings for the specified IP.
-
GET
-
PATCH
-
DELETE
Method & URL
GET https://[server URL]:[port]/admin/v2/sites/{siteId}/ipAccessList/ipAccessId
GET Body Sample
### GET Site IP access/ban Settings For specific IP###
GET https://{{host}}/admin/v2/sites/{{Siteid}}/ipAccessList/{{ipAccessId}} HTTP/1.1
Authorization: EFTAdminAuthToken {{AuthToken}}
GET Response Body Sample
{
"data": {
"id": "139:10:112:56::246",
"type": "access",
"attributes": {
"accessType": "Allow",
"date": "2022-02-04",
"isAutoBan": false,
"reason": "API TEST",
"sequenceNumber": 2
}
},
"links": {
"self": "/admin/v2/sites/a70ccebd-1317-4992-84e7-bb4cbddc02e4/ipAccessList/139:10:112:56::246"
}
}
GET PowerShell Sample
####Added 2/07/2022
### GET Site IP access/ban Settings For specific IP ###
### User must obtain the SiteID from Get Sites
Write-Output "GET Site IP access/ban list Settings For specific IP "
Write-Output "----"
#$siteID = Enter SiteID here
$siteList = Invoke-RestMethod -Uri "$baseURL/v2/sites/$siteID/ipAccessList/$ipAccessId" -Method 'GET' -Headers $authHeader
Write-Output $siteList | ConvertTo-Json
Method & URL
PATCH https://[server URL]:[port]/admin/v2/sites/{siteId}/ipAccessList/ipAccessList/{ipAccessId}
PATCH Body Sample
## PATCH Site Network and Security Settings For specific IP###
PATCH https://{{host}}/admin/v2/sites/{{Siteid}}/ipAccessList/{{ipAccessId}} HTTP/1.1
Authorization: EFTAdminAuthToken {{AuthToken}}
{
"data": {
"id": "139:10:112:56::247",
"attributes": {
"accessType": "Allow",
"reason": "This is a test for API PATCH on IP",
"sequenceNumber": 2
}
}
}
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).
{ "data": { "id": "139:10:112:56::247", "type": "access", "attributes": { "accessType": "Allow",
"date": "2022-02-07", "isAutoBan": false, "reason": "This is a test for API PATCH on IP",
"sequenceNumber": 2 } }, "links": { "self":
"/admin/v2/sites/a70ccebd-1317-4992-84e7-bb4cbddc02e4/ipAccessList/139:10:112:56::247" } }
PATCH PowerShell Sample
### PATCH Site Network and Security Settings For specific IP###
### User must obtain the SiteID from Get Sites
Write-Output "PATCH Site Network and Security Settings For specific IP"
Write-Output "-----"
$update =
'{
"data": {
"id": "139:10:112:56::247",
"attributes": {
"accessType": "Allow",
"reason": "This is a test for PS PATCH on IP",
"sequenceNumber": 2
}
}
}'
$update = $update | ConvertFrom-Json
$update = $update | ConvertTo-Json -Depth 9
$patchReturn = Invoke-RestMethod -Uri "$baseURL/v2/sites/$siteID/ipAccessList/$ipAccessId"
-Method 'PATCH' -Headers $authHeader -Body $update
Method & URL
DELETE https://[server URL]:[port]/admin/v2/sites/{siteId}/ipAccessList/{ipAccessId}
DELETE Body Sample
### DELETE Site IP access/ban Settings For specific IP###
DELETE https://{{host}}/admin/v2/sites/{{Siteid}}/ipAccessList/{{ipAccessId}} HTTP/1.1
Authorization: EFTAdminAuthToken {{AuthToken}}
DELETE Response Body Sample
HTTP/1.1 204 No Content Date: Tue, 09 Aug 2022 20:34:49 GMT
Content-Length: 0 Cache-Control: no-cache, no-store, must-revalidate Expires: -1
X-Content-Type-Options: nosniff X-XSS-Protection: 1; mode=block
Content-Security-Policy: default-src 'self' 'unsafe-inline' 'unsafe-eval' data:;
Referrer-Policy: no-referrer
DELETE PowerShell Sample
####Added 2/07/2022
### DELETE Site IP access/ban Settings For specific IP ###
### User must obtain the SiteID from Get Sites
### User must obtain the IP id to be deleted ###
Write-Output "DELETE Site IP access/ban Settings For specific IP ###"
Write-Output "----"
#$siteID = Enter SiteID here
$siteList = Invoke-RestMethod -Uri "$baseURL/v2/sites/$siteID/ipAccessList/$ipAccessId"
-Method 'DELETE' -Headers $authHeader
Write-Output $siteList | ConvertTo-Json