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.
To invoke those APIs, the following permission levels are required:
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
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:
Please find below a couple of samples to invoke StoneLock APIs:
http://staging.imagicle.local/fw/Apps/StoneLock/WebAPI/Phones/Lock?department=R%26D&customField1=Example1
curl -X PUT "http://staging.imagicle.local/fw/Apps/StoneLock/WebAPI/Phones/Lock?department=R%26D&customField1=Example1" -H "accept: */*"
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