# Basic Sample

### Logon

<table><thead><tr><th>Request</th></tr></thead><tbody><tr><td>POST api/Session/logon</td></tr><tr><td>Headers</td></tr><tr><td><pre><code>Content-Type: application/json; api-version=1.0
</code></pre></td></tr><tr><td>Body</td></tr><tr><td><pre><code>{
  "username":"administrator",
  "password":"11112222"
}
</code></pre></td></tr></tbody></table>

\ <br>

<table><thead><tr><th>Response</th></tr></thead><tbody><tr><td>Status:OK (200)<br></td></tr><tr><td><pre><code>{
  "authToken": "[AUTHENTICATION_TOKEN]"
}
</code></pre></td></tr></tbody></table>

\ <br>

### Get All Sites

<table><thead><tr><th>Request</th></tr></thead><tbody><tr><td>GET api/site</td></tr><tr><td>Headers</td></tr><tr><td><pre><code>Content-Type: application/json; api-version=1.0
auth_token: [AUTHENTICATION_TOKEN]
</code></pre></td></tr></tbody></table>

\ <br>

<table><thead><tr><th>Response</th></tr></thead><tbody><tr><td>Status:OK (200)<br></td></tr><tr><td><pre><code>[
  {
    "name": "site11",
    "licensingSite": true,
    "id": 1
  }
]
</code></pre></td></tr></tbody></table>

\ <br>

### Get Site

<table><thead><tr><th>Request</th></tr></thead><tbody><tr><td>GET api/site/1</td></tr><tr><td>Headers</td></tr><tr><td><pre><code>Content-Type: application/json; api-version=1.0
auth_token: [AUTHENTICATION_TOKEN]
</code></pre></td></tr></tbody></table>

\ <br>

<table><thead><tr><th>Response</th></tr></thead><tbody><tr><td>Status:OK (200)</td></tr><tr><td><pre><code>{
  "name": "site11",
  "licensingSite": true,
  "id": 1
}
</code></pre></td></tr></tbody></table>

\ <br>

### Get All Secure Gateways

<table><thead><tr><th>Request</th></tr></thead><tbody><tr><td>GET api/gateway</td></tr><tr><td>Headers</td></tr><tr><td><pre><code>Content-Type: application/json; api-version=1.0
auth_token: [AUTHENTICATION_TOKEN]
</code></pre></td></tr></tbody></table>

\ <br>

<table><thead><tr><th>Response</th></tr></thead><tbody><tr><td>Status:OK (200)<br></td></tr><tr><td><pre><code>[
  {
    "gwMode": 0,
    "preferredPAId": 0,
    "normalModeForwarding": false,
    "forwardHttpServers": "localhost:81",
    "forwardGatewayServers": "",
    "ipVersion": 0,
    "iPs": "126.0.0.5",
    "bindV4Addresses": "",
    "bindV6Addresses": "",
    "optimizeConnectionIPv4": "",
    "optimizeConnectionIPv6": "",
    "enableGWPort": true,
    "broadcast": true,
    "enableClientManagerPort": true,
    "dosPro": true,
    "enableRDP": false,
    "enableRDPUDP": true,
    "gwPort": 80,
    "rdpPort": 3389,
    "enableSSL": true,
    "minSSLVersion": 2,
    "cipherStrength": 2,
    "sslPort": 443,
    "cipher": "EECDH:!SSLv2:!SSLv3:!aNULL:!RC4:!ADH:!eNULL:!LOW:!MEDIUM:!EXP:+HIGH",
    "privateKeyFile": "SelfSignedCertificate.crt",
    "certificateFile": "SelfSignedCertificate.crt",
    "enableUserPortal": true,
    "UserPortalPort": 20020,
    "launchMethod": 0,
    "allowEmbed": false,
    "allowlaunchMethod": true,
    "allowAppsInNewTab": false,
    "allowFileTransfer": true,
    "allowClipboard": true,
    "usePreWin2000LoginFormat": true,
    "enableHSTS": false,
    "hstsIncludeSubdomains": false,
    "hstsPreload": false,
    "hstsMaxAge": 12,
    "enableWyseSupport": true,
    "securityMode": 0,
    "macAllowExceptLst": [],
    "macAllowOnlyLst": [],
    "webRequestsURL": "",
    "fwGWID": 4294967295,
    "server": "126.0.0.5",
    "enabled": true,
    "description": "",
    "siteId": 1,
    "id": 218
  }
]
</code></pre></td></tr></tbody></table>

\ <br>

### New Secure Gateway

<table><thead><tr><th>Request</th></tr></thead><tbody><tr><td>POST api/gateway?noinstall=true</td></tr><tr><td>Headers</td></tr><tr><td><pre><code>Content-Type: application/json; api-version=1.0
auth_token: [AUTHENTICATION_TOKEN]
</code></pre></td></tr><tr><td>Body</td></tr><tr><td><pre><code>{
  "server":"126.0.0.6",
  "siteId":"1"
} 
</code></pre></td></tr></tbody></table>

\ <br>

<table><thead><tr><th>Response</th></tr></thead><tbody><tr><td>Status:Created (201)<br></td></tr><tr><td><pre><code>{
  "gwMode": 0,
  "preferredPAId": 0,
  "normalModeForwarding": false,
  "forwardHttpServers": "localhost:81",
  "forwardGatewayServers": "",
  "ipVersion": 0,
  "iPs": "126.0.0.6",
  "bindV4Addresses": "",
  "bindV6Addresses": "",
  "optimizeConnectionIPv4": "",
  "optimizeConnectionIPv6": "",
  "enableGWPort": true,
  "broadcast": true,
  "enableClientManagerPort": true,
  "dosPro": true,
  "enableRDP": false,
  "enableRDPUDP": true,
  "gwPort": 80,
  "rdpPort": 3389,
  "enableSSL": true,
  "minSSLVersion": 2,
  "cipherStrength": 2,
  "sslPort": 443,
  "cipher": "EECDH:!SSLv2:!SSLv3:!aNULL:!RC4:!ADH:!eNULL:!LOW:!MEDIUM:!EXP:+HIGH",
  "privateKeyFile": "SelfSignedCertificate.crt",
  "certificateFile": "SelfSignedCertificate.crt",
  "enableUserPortal": true,
  "UserPortalPort": 20020,
  "launchMethod": 0,
  "allowEmbed": false,
  "allowlaunchMethod": true,
  "allowAppsInNewTab": false,
  "allowFileTransfer": true,
  "allowClipboard": true,
  "usePreWin2000LoginFormat": true,
  "enableHSTS": false,
  "hstsIncludeSubdomains": false,
  "hstsPreload": false,
  "hstsMaxAge": 12,
  "enableWyseSupport": true,
  "securityMode": 0,
  "macAllowExceptLst": [],
  "macAllowOnlyLst": [],
  "webRequestsURL": "",
  "fwGWID": 4294967295,
  "server": "126.0.0.6",
  "enabled": true,
  "description": "",
  "siteId": 1,
  "id": 219
}
</code></pre></td></tr></tbody></table>

\ <br>

### Get Secure Gateway

<table><thead><tr><th>Request</th></tr></thead><tbody><tr><td>GET api/gateway/219</td></tr><tr><td>Headers</td></tr><tr><td><pre><code>Content-Type: application/json; api-version=1.0
auth_token: [AUTHENTICATION_TOKEN]
</code></pre></td></tr></tbody></table>

\ <br>

<table><thead><tr><th>Response</th></tr></thead><tbody><tr><td>Status:OK (200)<br></td></tr><tr><td><pre><code>{
  "gwMode": 0,
  "preferredPAId": 0,
  "normalModeForwarding": false,
  "forwardHttpServers": "localhost:81",
  "forwardGatewayServers": "",
  "ipVersion": 0,
  "iPs": "126.0.0.6",
  "bindV4Addresses": "",
  "bindV6Addresses": "",
  "optimizeConnectionIPv4": "",
  "optimizeConnectionIPv6": "",
  "enableGWPort": true,
  "broadcast": true,
  "enableClientManagerPort": true,
  "dosPro": true,
  "enableRDP": false,
  "enableRDPUDP": true,
  "gwPort": 80,
  "rdpPort": 3389,
  "enableSSL": true,
  "minSSLVersion": 2,
  "cipherStrength": 2,
  "sslPort": 443,
  "cipher": "EECDH:!SSLv2:!SSLv3:!aNULL:!RC4:!ADH:!eNULL:!LOW:!MEDIUM:!EXP:+HIGH",
  "privateKeyFile": "SelfSignedCertificate.crt",
  "certificateFile": "SelfSignedCertificate.crt",
  "enableUserPortal": true,
  "UserPortalPort": 20020,
  "launchMethod": 0,
  "allowEmbed": false,
  "allowlaunchMethod": true,
  "allowAppsInNewTab": false,
  "allowFileTransfer": true,
  "allowClipboard": true,
  "usePreWin2000LoginFormat": true,
  "enableHSTS": false,
  "hstsIncludeSubdomains": false,
  "hstsPreload": false,
  "hstsMaxAge": 12,
  "enableWyseSupport": true,
  "securityMode": 0,
  "macAllowExceptLst": [],
  "macAllowOnlyLst": [],
  "webRequestsURL": "",
  "fwGWID": 4294967295,
  "server": "126.0.0.6",
  "enabled": true,
  "description": "",
  "siteId": 1,
  "id": 219
}
</code></pre></td></tr></tbody></table>

\ <br>

### Create RDS Server

<table><thead><tr><th>Request</th></tr></thead><tbody><tr><td>POST api/rds?noinstall=true</td></tr><tr><td>Headers</td></tr><tr><td><pre><code>Content-Type: application/json; api-version=1.0
auth_token: [AUTHENTICATION_TOKEN]
</code></pre></td></tr><tr><td>Body</td></tr><tr><td><pre><code>{
  "server":"rds.company.dom",
  "siteId":"1"
}
</code></pre></td></tr></tbody></table>

\ <br>

<table><thead><tr><th>Response</th></tr></thead><tbody><tr><td>Status:Created (201)</td></tr><tr><td><pre><code>{
  "directAddress": "rds.company.dom",
  "rasTemplateId": 0,
  "inheritDefaultAgentSettings": true,
  "inheritDefaultPrinterSettings": true,
  "inheritDefaultUPDSettings": true,
  "inheritDefaultDesktopAccessSettings": true,
  "port": 3389,
  "maxSessions": 250,
  "sessionTimeout": 25,
  "sessionLogoffTimeout": 0,
  "allowURLAndMailRedirection": 1,
  "allowRemoteExec": true,
  "enableAppMonitoring": true,
  "useRemoteApps": false,
  "allowFileTransfer": true,
  "allowDragAndDrop": true,
  "preferredPAId": 0,
  "enablePrinting": true,
  "enableTWAIN": true,
  "enableWIA": false,
  "printerNameFormat": 0,
  "removeClientNameFromPrinterName": false,
  "removeSessionNumberFromPrinterName": false,
  "updMode": 0,
  "maxUserProfileDiskSizeGB": 20,
  "diskPath": "\\\\server\\upd-path",
  "roamingMode": 0,
  "includeFolderPath": [],
  "includeFilePath": [],
  "excludeFolderPath": [],
  "excludeFilePath": [],
  "restrictDesktopAccess": false,
  "restrictedUsers": [],
  "server": "rds.company.dom",
  "enabled": true,
  "description": "",
  "siteId": 1,
  "id": 361
}
</code></pre></td></tr></tbody></table>

\ <br>

### Get RDS Status

<table><thead><tr><th>Request</th></tr></thead><tbody><tr><td>GET api/rds/361/status</td></tr><tr><td>Headers</td></tr><tr><td><pre><code>Content-Type: application/json; api-version=1.0
auth_token: [AUTHENTICATION_TOKEN]
</code></pre></td></tr></tbody></table>

\ <br>

<table><thead><tr><th>Response</th></tr></thead><tbody><tr><td>Status:OK (200)<br></td></tr><tr><td><pre><code>{
    "preferredPA": "MC2019",
    "activeSessions": 1,
    "disconnectedSessions": 0,
    "activeConnections": 1,
    "ip": "0.0.0.0",
    "loginStatus": 0,
    "updStatus": 2,
    "cpuLoad": 23,
    "memLoad": 48,
    "diskRead": 10,
    "diskWrite": 0,
    "enabled": true,
    "id": "361",
    "server": "172.30.10.20",
    "siteId": 1,
    "agentVer": "17.0 (build 21257)",
    "serverOS": "Windows Server 2019 Standard Edition (WOW 64)",
    "serviceStartTime": "Wed May 15 09:34:08 2019",
    "systemBootTime": "Tue May 14 09:30:56 2019",
    "unhandledExceptions": 0,
    "agentState": 0,
    "serverType": 1,
    "logLevel": 3
}
</code></pre></td></tr></tbody></table>

\ <br>

### Get RDS Sessions

<table><thead><tr><th>Request</th></tr></thead><tbody><tr><td>GET api/rds/sessions</td></tr><tr><td>Headers</td></tr><tr><td><pre><code>Content-Type: application/json; api-version=1.0
auth_token: [AUTHENTICATION_TOKEN]
</code></pre></td></tr></tbody></table>

\ <br>

<table><thead><tr><th>Response</th></tr></thead><tbody><tr><td>Status:OK (200)</td></tr><tr><td><pre><code>[]
</code></pre></td></tr></tbody></table>

\ <br>

### LogOff

<table><thead><tr><th>Request</th></tr></thead><tbody><tr><td>POST api/Session/logoff</td></tr><tr><td>Headers</td></tr><tr><td><pre><code>Content-Type: application/json; api-version=1.0
auth_token: [AUTHENTICATION_TOKEN]
</code></pre></td></tr></tbody></table>

\ <br>

| Response        |
| --------------- |
| Status:OK (200) |
