Endpoint: /sites/{siteId}/termsOfService
Returns and updates the terms of service configuration for specific site
-
GET
-
PATCH
Method & URL
GET https://[server URL]:[port]/admin/v2/sites/{siteId}/termsOfService
GET Body Sample
Copy
### GET Terms of Services Settings####
GET https://{{host}}/admin/v2/sites/{{Siteid}}/termsOfService/ HTTP/1.1
Authorization: EFTAdminAuthToken {{AuthToken}}
GET Response Body Sample
Copy
{ "data": { "id": "0de7387f-1506-427d-b997-e18bcdb8cbae", "type": "termsOfService", "attributes": {
"type": "Disabled", "agreementPath": "", "agreementLabel": "", "effectiveDate": "Dec 16, 1950. 10:05:17 AM"
} }, "links": { "self": "admin/v2/sites/0de7387f-1506-427d-b997-e18bcdb8cbae/termsOfService" } }
GET PowerShell Sample
Copy
###GET terms Of Service Settings###
Write-Output "GET GET terms Of Service Settings"
Write-Output "----------------------------"
#$siteID = "Enter site ID"
$TOSlist = Invoke-RestMethod -Uri "$baseURL/v2/sites/$siteID/termsOfService" -Method 'GET' -Headers $authHeader
Write-Output $TOSlist | ConvertTo-Json -Depth 25
Method & URL
PATCH https://[server URL]:[port]/admin/v2/sites/{siteId}/termsOfService
PATCH Body Sample
Copy
### PATCH Terms of Services Settings###
PATCH https://{{host}}/admin/v2/sites/{{Siteid}}/termsOfService/ HTTP/1.1
Authorization: EFTAdminAuthToken {{AuthToken}}
{
"data": {
"type": "termsOfService",
"attributes": {
"type": "Mandatory",
"values": {
"preventSftpsUntilAgreed": true
},
"agreementPath": "",
"agreementLabel": "",
"effectiveDate": "Dec 16, 2000. 10:05:17 AM"
}
}
}
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": "termsOfService", "attributes": {
"type": "Mandatory", "values": { "preventSftpsUntilAgreed": true }, "agreementPath": "", "agreementLabel": "",
"effectiveDate": "Feb 11, 2022. 01:01:53 PM" } }, "links": { "self":
"admin/v2/sites/0de7387f-1506-427d-b997-e18bcdb8cbae/termsOfService"
} }
PATCH PowerShell Sample
Copy
####Added 2/11/2022
### PATCH terms Of Service Settings###
### User must obtain the SiteID from Get Sites
Write-Output "terms Of Service Settings"
Write-Output "--------------------------"
$update =
'{
"data": {
"type": "termsOfService",
"attributes": {
"type": "Mandatory",
"values": {
"preventSftpsUntilAgreed": true
},
"agreementPath": "",
"agreementLabel": "",
"effectiveDate": "Dec 16, 2000. 10:05:17 AM"
}
}
}'
$update = $update | ConvertFrom-Json
$update = $update | ConvertTo-Json -Depth 30
$patchReturn = Invoke-RestMethod -Uri "$baseURL/v2/sites/$siteID/termsOfService"
-Method 'PATCH' -Headers $authHeader -Body $update