StoneLock REST APIs

Overview

Starting from 2020.Summer.1 Imagicle AppSuite release, StoneLock enables two REST APIs which allow respectively to lock and unlock phone lines, at global level or department level.

Required permissions

To invoke those APIs, the following permission levels are required:

EndPoint

To unlock phone lines:

http://{ias-server}/fw/Apps/StoneLock/WebAPI/Phones/Unlock

To lock phone lines:

http://{ias-server}/fw/Apps/StoneLock/WebAPI/Phones/Lock

Filters

You can invoke above APIs by optionally adding QueryString filters to further narrow the StoneLock action based on specific IAS users fields:

/Lock?filterField=<value>

Available fields for filtering are:

API Invoke samples

Please find below a couple of samples to invoke StoneLock APIs:

Request URL (client REST, PUT)

http://staging.imagicle.local/fw/Apps/StoneLock/WebAPI/Phones/Lock?department=R%26D&customField1=Example1

cURL

curl -X PUT "http://staging.imagicle.local/fw/Apps/StoneLock/WebAPI/Phones/Lock?department=R%26D&customField1=Example1" -H "accept: */*"

Scheduled phone lines lock and unlock using Windows Task Scheduler

Windows Task Scheduler is suitable to schedule automatic phone lines lock and unlock at a certain time of the day. This is accomplished by creating a PowerShell script. See below the procedure to create such a script:

$username='' <# user on behalf of phones will be locked #>
$password='' <# password of the user on behalf of phones will be locked #>

<# set authentication headers for API request #>
$encodedCreds = [System.Convert]::ToBase64String([System.Text.Encoding]::ASCII.GetBytes("$($username):$($password)"))
$Headers = @{
    Authorization = "Basic $encodedCreds"
}

<# set IAS parameters #>
$ias_url = '' <# IAS IP Address/FQDN affected by the API call #>
$action = 'Lock' <# action to be performed by the API (including filters) #>
$url = "http://$($ias_url)/fw/Apps/StoneLock/WebAPI/Phones/$($action)"

<# API request #>
Invoke-WebRequest -Uri $url -Headers $Headers -Method PUT

Windows Task Scheduler usage



Article ID: 774
Last updated: 24 Jul, 2020
Revision: 1
Imagicle UC Suite for Cisco UC -> Phone lock -> Administration Guide -> StoneLock REST APIs
https://kbp.imagicle.com/kb/entry/774/