Endpoint: /experimental/site/templates/{templateName}
Returns the contents of the specified site template.
NOTE: Available as of EFT 8.1.0
-
GET
-
PATCH
Method & URL
GET https://{{host}}/admin/v2/sites/{{Siteid}}/templates/{templateName}
GET Body Sample
Copy
#GET Site Templates -- ##
GET https://{{host}}/admin/v2/sites/{{Siteid}}/templates/WorkspacesAdminAddedParticipantMsg.html HTTP/1.1
Authorization: EFTAdminAuthToken {{AuthToken}}
###
GET Response Body Sample
Copy
HTTP/1.1 200 OK Date: Fri, 05 Aug 2022 13:01:21 GMT
Content-Type: application/vnd.api+json Content-Length: 370
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": "<html>\r\n<body>\r\n
<p>Hello %USER.LOGIN%,</p>\r\n <p>The following
<b>Enhanced File Transfer</b> Workspace has been shared with you:
%FOLDER_NAME% (owner: %WS_OWNER_NAME%).</p>\r\n
<p>Please use the following URL to access this Workspace:</p>\r\n
<a href=\"%LINK%\">%LINK%</a><br/><br/>\r\n \r\n %WS_MESSAGE%<br/>
<br/>\r\n <hr/>\r\n</body>\r\n</html>" }
GET PowerShell Sample
Copy
#####################################
#GET Site Template Details -- ##
Write-Output "GET Site Template Detail"
Write-Output "-------------------------------"
#$siteID = "Enter site ID"
#$TemplateName= "WorkspacesAdminAddedParticipantMsg.html"
$TemplateDetails = Invoke-RestMethod -Uri
"$baseURL/v2/sites/$siteID/templates/WorkspacesAdminAddedParticipantMsg.html"
-Method 'GET' -Headers $authHeader
Write-Output $TemplateDetails | ConvertTo-Json -Depth 25
Method & URL
PATCH https://{{host}}/admin/v2/sites/{{Siteid}}/templates/WorkspacesAdminAddedParticipantMsg.html
PATCH Body Sample
Copy
#Modify Site Template - Will append the site name to the file name should only be used for this site ##
PATCH https://{{host}}/admin/v2/sites/{{Siteid}}/templates/WorkspacesAdminAddedParticipantMsg.html HTTP/1.1
Authorization: EFTAdminAuthToken {{AuthToken}}
{
"data": "<html>\r\n<body>\r\n <p>Update Template Example %USER.LOGIN%,</p>\r\n
<p>The following <b>Enhanced File Transfer</b> Workspace has been shared with you:
%FOLDER_NAME% (owner: %WS_OWNER_NAME%).</p>\r\n
<p>Please use the following URL to access this Workspace:</p>\r\n
<a href=\"%LINK%\">%LINK%</a><br/><br/>\r\n \r\n %WS_MESSAGE%<br/><br/>\r\n
<hr/>\r\n</body>\r\n</html>"
}
####
PATCH Response Body Sample
Copy
HTTP/1.1 204 No Content Date: Fri, 05 Aug 2022 13:48: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
PATCH PowerShell Sample
Copy
####Added 8/4/2022
### Update Content of Template###
### Modify Site Template - Will append the site name to the file name should only be used for this site ###
Write-Output "PATCH Site Connection Profile"
Write-Output "------------------------------"
$update =
'{
"data": "<html>\r\n<body>\r\n <p>PS1. Update Template Example %USER.LOGIN%,</p>\r\n
<p>The following <b>Enhanced File Transfer</b> Workspace has been shared with you:
%FOLDER_NAME% (owner: %WS_OWNER_NAME%).</p>\r\n
<p>Please use the following URL to access this Workspace:</p>\r\n
<a href=\"%LINK%\">%LINK%</a><br/><br/>\r\n \r\n %WS_MESSAGE%<br/><br/>\r\n
<hr/>\r\n</body>\r\n</html>"
}'
$update = $update | ConvertFrom-Json
$update = $update | ConvertTo-Json -Depth 9
$TemplateDetails = Invoke-RestMethod -Uri
"$baseURL/v2/sites/$siteID/templates/WorkspacesAdminAddedParticipantMsg.html"
-Method 'PATCH' -Headers $authHeader -Body $update