# Licensing 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>

### Activate license

<table><thead><tr><th>Request</th></tr></thead><tbody><tr><td>POST api/License/activate</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>{
  "email":"someone@parallels.com",
  "password":"11112222",
  "key":"XXX"
}
</code></pre></td></tr></tbody></table>

\ <br>

<table><thead><tr><th>Response</th></tr></thead><tbody><tr><td>Status:Bad Request (400)</td></tr><tr><td><pre><code>{
  "code": 0,
  "msg": "invalid login or password"
}
</code></pre></td></tr></tbody></table>

\ <br>

### Retrieve license details

<table><thead><tr><th>Request</th></tr></thead><tbody><tr><td>GET api/License</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>{
"usageToday": "0",
"currPeriodUsage": "0",
"billingPeriodStart": "03/05/2019 05:30",
"billingPeriodEnd": "02/06/2019 05:30",
"paUserName": "Evgeny Danilenko",
"paCompanyName": "Parallels",
"paUserEmail": "edanilenko@parallels.com",
"licenseKey": "****-ME****-****-B9****-CV55K2",
"supportExpireDate": "23/03/2021",
"upgradeInsurance": "23/03/2021",
"licenseFirstActive": "21/02/2018 12:39",
"licenseStatus": "",
"licenseType": "Parallels Remote Application Server SPLA",
"expiryDate": "21/02/2021",
"installedUsers": "",
"usersPeak": "0",
"usersLicenseInfo": "0",
"gracePeriodState": "",
"gracePeriodDaysLeft": "",
"type": 3
}
</code></pre></td></tr></tbody></table>

\ <br>

### Deactivate license

<table><thead><tr><th>Request</th></tr></thead><tbody><tr><td>POST api/License/deactivate</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>{
  "email":"someone@parallels.com",
  "password":"11112222"
}
</code></pre></td></tr></tbody></table>

\ <br>

<table><thead><tr><th>Response</th></tr></thead><tbody><tr><td>Status:Bad Request (400)<br></td></tr><tr><td><pre><code>{
  "code": 0,
  "msg": "Failed to Deactivate - Product not activated with a license key."
}
</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) |

<br>
