Endpoint: /sites/{siteId}/https

Returns and update the HTTP(s) settings

  • GET

  • PATCH

Method & URL

GET https://[server URL]:[port]/admin/v2/sites/{siteId}/https

GET Body Sample

Copy
### GET Site HTTP(s) Settings ###
GET https://{{host}}/admin/v2/sites/{{Siteid}}/https/ HTTP/1.1
Authorization: EFTAdminAuthToken {{AuthToken}}

GET Response Body Sample

Copy
{
  "data": {
    "type": "site",
    "id": "892b16dc-24a8-473f-a74e-c597b824c879",
    "attributes": {
      "http": {
        "enabled": false,
        "port": 80
      },
      "https": {
        "enabled": true,
        "port": 411
      },
      "domain": "172.22.150.62",
      "enableRestPage": false,
      "redirectHttpToHttps": false,
      "enableHsts": true,
      "allowWebServices": false,
      "as2": {
        "enabled": false,
        "id": "",
        "cert": {
          "passPhrase": true,
          "privateKeyPath": "",
          "publicKeyPath": ""
        }
      },
      "mfa": {
        "enabled": false,
        "type": "email"
      },
      "mtc": {
        "enabled": true,
        "value": {
          "enableFileCache": true,
          "enableFileOpenInExternalApps": true,
          "enableFileSharing": true,
          "enableFilesSavingToVault": true,
          "enableSavingProfilePassword": true
        }
      }
    }
  },
  "links": {
    "self": "/admin/v2/sites/892b16dc-24a8-473f-a74e-c597b824c879/https"
  }
}

GET PowerShell Sample

Copy
### GET Site HTTP(s) Settings###
### User must obtain the SiteID from Get Sites
Write-Output "Site HTTPS(S) Settings"
Write-Output "----"
#$siteID = Enter SiteID here
$siteList = Invoke-RestMethod -Uri "$baseURL/v2/sites/$siteID/https" -Method 'GET' -Headers $authHeader
Write-Output $siteList | ConvertTo-Json 

Method & URL

PATCH https://[server URL]:[port]/admin/v2/sites/{siteId}/https

PATCH Body Sample

Copy
PATCH https://{{host}}/admin/v2/sites/{{Siteid}}/https/ HTTP/1.1
Authorization: EFTAdminAuthToken {{AuthToken}}

{
  "data": {
    "attributes":{
      "https": {
        "enabled": true,
        "port": 490
      }
    }
  }
}

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": {
    "type": "site",
    "id": "892b16dc-24a8-473f-a74e-c597b824c879",
    "attributes": {
      "http": {
        "enabled": false,
        "port": 80
      },
      "https": {
        "enabled": true,
        "port": 490
      },
      "domain": "172.22.150.62",
      "enableRestPage": false,
      "redirectHttpToHttps": false,
      "enableHsts": true,
      "allowWebServices": false,
      "as2": {
        "enabled": false,
        "id": "",
        "cert": {
          "passPhrase": true,
          "privateKeyPath": "",
          "publicKeyPath": ""
        }
      },
      "mfa": {
        "enabled": false,
        "type": "email"
      },
      "mtc": {
        "enabled": true,
        "value": {
          "enableFileCache": true,
          "enableFileOpenInExternalApps": true,
          "enableFileSharing": true,
          "enableFilesSavingToVault": true,
          "enableSavingProfilePassword": true
        }
      }
    }
  },
  "links": {
    "self": "/admin/v2/sites/892b16dc-24a8-473f-a74e-c597b824c879/https"
  }
}

PATCH PowerShell Sample

Copy
### PATCH  Site HTTP(s) Settings###
### User must obtain the SiteID from Get Sites
Write-Output "PATCH  Site HTTP(s) Settings"
Write-Output "-----"
$update = 
'{
  "data": {
    "attributes":{
      "https": {
        "enabled": true,
        "port": 25
      }
    }
  }
}'

$update = $update | ConvertFrom-Json
$update = $update | ConvertTo-Json -Depth 9
$patchReturn = Invoke-RestMethod -Uri "$baseURL/v2/sites/$siteID/https" 
-Method 'PATCH' -Headers $authHeader -Body $update