Endpoint: /experimental/server/templates/{templateName}

NOTE: Available as of EFT 8.1.0

Returns and updates the contents of the specified server template.

Method & URL

GET HTTPS://{{host}}/admin/experimental/server/templates/{templateName}

GET Body Sample

Copy
#GET Server Templates -- ##
GET https://{{host}}/admin/experimental/server/templates/WorkspacesAdminAddedParticipantMsg.html HTTP/1.1
Authorization: EFTAdminAuthToken {{AuthToken}}
###

GET Response Body Sample

Copy
HTTP/1.1 200 OK Date: Mon, 08 Aug 2022 13:17:16 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 Server Templates -- ##
Write-Output "GET Server Templates Detail"
Write-Output "-------------------------------"
#$siteID = "Enter site ID"
#$TemplateName= "WorkspacesAdminAddedParticipantMsg.html"
$TemplateDetails = Invoke-RestMethod -Uri "$baseURL/experimental/server/templates/WorkspacesAdminAddedParticipantMsg.html" -Method 'GET' -Headers $authHeader
Write-Output $TemplateDetails | ConvertTo-Json -Depth 25

Method & URL

PATCH HTTPS://{{host}}/admin/experimental/server/templates/{templateName}

PATCH Body Sample

Copy
###
#PATCH - Update Server template ###
PATCH https://{{host}}/admin/experimental/server/templates/PasswordResetReminderMsg.html HTTP/1.1
Authorization: EFTAdminAuthToken {{AuthToken}}

{
  "data": "<html>\r\n<body>\r\n HELLO USERS %USER.FULL_NAME%,<br>\r\nThe -___API TEST___ password for account:
  %USER.LOGIN% will expire in %DAYS_LEFT% days. Please change your password at your earliest convenience.\r\n
  Instructions for changing your password via FTP, SFTP, and HTTP/S are provided below for your convenience:<br>
  \r\n1. Please enter the following URL into your browser: %SITE.ACCOUNT_MANAGEMENT_URL%<br>\r\n2. 
  Supply your current password when prompted<br>\r\n3. Enter your new password and confirm<br>\r\n4. 
  If approved, exit the browser and login as normal<br>\r\n</body>\r\n</html>"
}

PATCH PowerShell Sample

Copy
### Update Content of Template###
### Modify Server Template - ###
Write-Output "PATCH Server Template"
Write-Output "---------------------"
$update = 
'
{
  "data":  "Notice: ___PATCH TEST__The SSL certificate: %certid% is set to expire %d% day(s) from now on
  %expirationdate%, which may impact operations or communications with the entity associated with this certificate."
}
'

$update = $update | ConvertFrom-Json
$update = $update | ConvertTo-Json -Depth 9
$TemplateDetails = Invoke-RestMethod -Uri "$baseURL/experimental/server/templates/SSLCertExpirationWarning.txt" 
-Method 'PATCH' -Headers $authHeader -Body $update