Endpoint: /sites/{siteId}/privacyPolicy
Returns and updates the privacy policy configuration for specific site
-
GET
-
PATCH
Method & URL
GET https://[server URL]:[port]/admin/v2/sites/{siteId}/privacyPolicy
GET Body Sample
Copy
### GET Privacy Policy Settings####
GET https://{{host}}/admin/v2/sites/{{Siteid}}/privacyPolicy/ HTTP/1.1
Authorization: EFTAdminAuthToken {{AuthToken}}
GET Response Body Sample
Copy
{ "data": { "id": "0de7387f-1506-427d-b997-e18bcdb8cbae", "type": "privacyPolicy",
"attributes": { "type": "Mandatory", "values": { "preventSftpsUntilAgreed": true,
"impliedForNonSubjects": true }, "agreementPath": "", "agreementLabel": "",
"effectiveDate": "Feb 11, 2022. 01:01:39 PM" } }, "links": { "self":
"admin/v2/sites/0de7387f-1506-427d-b997-e18bcdb8cbae/privacyPolicy" } }
GET PowerShell Sample
Copy
####Added 2/11/2022 ###
###GET Privacy Policy Settings###
Write-Output "GET Privacy Policy Settings"
Write-Output "----------------------------"
#$siteID = "Enter site ID"
$PPlist = Invoke-RestMethod -Uri "$baseURL/v2/sites/$siteID/privacyPolicy" -Method 'GET' -Headers $authHeader
Write-Output $PPlist | ConvertTo-Json -Depth 25
Method & URL
PATCH https://[server URL]:[port]/admin/v2/sites/{siteId}/privacyPolicy
PATCH Body Sample
Copy
### PATCH Privacy Policy Settings###
PATCH https://{{host}}/admin/v2/sites/{{Siteid}}/privacyPolicy/ HTTP/1.1
Authorization: EFTAdminAuthToken {{AuthToken}}
{
"data": {
"type": "privacyPolicy",
"attributes": {
"type": "Mandatory",
"values": {
"preventSftpsUntilAgreed": false,
"impliedForNonSubjects": false
},
"agreementPath": "",
"agreementLabel": "",
"effectiveDate": "Feb 11, 2020. 01:01:39 PM"
}
}
}
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": "0de7387f-1506-427d-b997-e18bcdb8cbae", "type": "privacyPolicy", "attributes": {
"type": "Mandatory", "values": { "preventSftpsUntilAgreed": false, "impliedForNonSubjects": false },
"agreementPath": "", "agreementLabel": "", "effectiveDate": "Feb 11, 2022. 01:01:39 PM" } }, "links": {
"self": "/admin/v2/sites/0de7387f-1506-427d-b997-e18bcdb8cbae/privacyPolicy" } }
PATCH PowerShell Sample
Copy
### PATCH Privacy Policy Settings###
### User must obtain the SiteID from Get Sites
Write-Output "Privacy Policy Settings"
Write-Output "------------------------------"
$update =
'{
"data": {
"type": "privacyPolicy",
"attributes": {
"type": "Mandatory",
"values": {
"preventSftpsUntilAgreed": true,
"impliedForNonSubjects": true
},
"agreementPath": "",
"agreementLabel": "",
"effectiveDate": "Feb 11, 2020. 01:01:39 PM"
}
}
}'
$update = $update | ConvertFrom-Json
$update = $update | ConvertTo-Json -Depth 30
$patchReturn = Invoke-RestMethod -Uri "$baseURL/v2/sites/$siteID/privacyPolicy"
-Method 'PATCH' -Headers $authHeader -Body $update