Endpoint: /sites/{siteId}/workspaces
Returns and updates workspaces settings
-
GET
-
PATCH
Method & URL
GET https://[server URL]:[port]/admin/v2/sites/{siteId}/workspaces/
GET Body Sample
Copy
### GET Workspaces - Folder Sharing Settings####
GET https://{{host}}/admin/v2/sites/{{Siteid}}/workspaces/ HTTP/1.1
Authorization: EFTAdminAuthToken {{AuthToken}}
GET Response Body Sample
Copy
"data": { "type": "workspaces", "id": "0de7387f-1506-427d-b997-e18bcdb8cbae", "attributes": { "enabled": true,
"newUser": { "enabled": true, "allowedDomains": { "enabled": false, "list": [ "*.*" ] }, "deniedDomains": {
"enabled": false, "list": [ "*.*" ] } }, "maxExpiration": { "value": 1, "units": "Year" },
"secondVerification": "email", "guestAccounts": { "expiration": { "enabled": true, "action":
"DeleteAccountOnly", "daysAfterLinksExpiration": 7 }, "grantHomeFolder": true } } }, "links": {
"self": "admin/v2/sites/0de7387f-1506-427d-b997-e18bcdb8cbae/workspaces" } }
GET PowerShell Sample
Copy
###GET workspaces Configuration Details###
Write-Output "GET workspaces Configuration Details"
Write-Output "----"
#$siteID = "Enter site ID"
$wksList = Invoke-RestMethod -Uri "$baseURL/v2/sites/$siteID/workspaces" -Method 'GET' -Headers $authHeader
Write-Output $wksList | ConvertTo-Json -Depth 25
Method & URL
PATCH https://[server URL]:[port]/admin/v2/sites/{siteId}/workspaces
PATCH Body Sample
Copy
### PATCH Workspaces - Folder Sharing Setting ###
PATCH https://{{host}}/admin/v2/sites/{{Siteid}}/workspaces/ HTTP/1.1
Authorization: EFTAdminAuthToken {{AuthToken}}
{
"data": {
"attributes": {
"enabled": true,
"newUsers": {
"enabled": true,
"allowedDomains": {
"enabled": false
}
}
}
}
}
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
HTTP/1.1 200 OK Date: Thu, 25 Aug 2022 19:20:16 GMT
Content-Type: application/vnd.api+json ETag: "FC63C399"
Content-Length: 507 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 { "data": { "type": "workspaces", "id":
"c9551b5d-f904-4612-b690-d51bfde2eb1f", "attributes": { "enabled": true, "newUsers": {
"enabled": true, "allowedDomains": { "enabled": false, "list": [ "*.*" ] }, "deniedDomains": {
"enabled": false, "list": [ "*.*" ] } }, "maxExpiration": { "value": 1, "units": "Year" },
"secondVerification": "email", "guestAccounts": { "expiration": { "enabled": false, "action":
"Disable", "daysAfterLinksExpiration": 7 }, "grantHomeFolder": false } } }, "links": {
"self": "/admin/v2/sites/c9551b5d-f904-4612-b690-d51bfde2eb1f/workspaces" } }
PATCH PowerShell Sample
Copy
##Patch SITE Workspaces settings
Write-Output "Site Workspaces PATCH"
Write-Output "-----"
$update =
'{
"data": {
"attributes": {
"enabled": true,
"newUsers": {
"enabled": true,
"allowedDomains": {
"enabled": false
}
}
}
}
}'
$update = $update | ConvertFrom-Json
$update = $update | ConvertTo-Json -Depth 10
$patchWSReturn = Invoke-RestMethod -Uri "$baseURL/v2/sites/$siteID/workspaces" -Method 'PATCH' -Headers $authHeader -Body $update
Write-Output $patchWSReturn | ConvertTo-Json