Plantronics + Polycom. Now together as Poly Logo

[FAQ] REST API

Polycom Employee & Community Manager

[FAQ] REST API

Since UC Software 5.8.0 the REST API is publicly available to everybody.

 

27/02/2018: Addedd Trio Rest API document

 

The attached manual applies to the following Polycom VVX models: 101, 150, 201, 250, 300, 301, 310, 311, 350, 400, 401, 410, 411, 450, 500, 501, 600, 601,1500, Trio 8800 and Trio 8500.

 

To enable simply logon to the Web Interface and browse to Settings > Applications > REST API

 

REST_API.png

 

This can also be enabled via configuration:

 

<test apps.restapi.enabled="1" />

IMPORTANT:

 

  • The password must be changed from 456 to anything else or the REST API will not work

Power Shell Examples

 

RESET:

 

Attached is the PDF explaining all supported parameters and below is an example how to Reset a Phone using Windows Power Shell

 

$username = "Polycom"
$password = "789" | ConvertTo-SecureString -AsPlainText -Force
$cred = New-Object System.Management.Automation.PSCredential($username,$password)

add-type @"
        using System.Net;
        using System.Security.Cryptography.X509Certificates;

            public class IDontCarePolicy : ICertificatePolicy {
            public IDontCarePolicy() {}
            public bool CheckValidationResult(
                ServicePoint sPoint, X509Certificate cert,
                WebRequest wRequest, int certProb) {
                return true;
            }
        }
"@
[System.Net.ServicePointManager]::CertificatePolicy = new-object IDontCarePolicy 
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls11


 Invoke-RestMethod -Uri "https://10.252.149.61/api/v1/mgmt/safeRestart" -Credential $cred  -Method Post -ContentType "application/json"  -TimeoutSec 2

The above will use the following:

  • Username: Polycom
  • Password: 789
  • Phone IP: 10.252.149.61

DIAL:

 

The below example dials 123

$username = "Polycom"
$password = "789" | ConvertTo-SecureString -AsPlainText -Force
$cred = New-Object System.Management.Automation.PSCredential($username,$password)

add-type @"
        using System.Net;
        using System.Security.Cryptography.X509Certificates;

            public class IDontCarePolicy : ICertificatePolicy {
            public IDontCarePolicy() {}
            public bool CheckValidationResult(
                ServicePoint sPoint, X509Certificate cert,
                WebRequest wRequest, int certProb) {
                return true;
            }
        }
"@
[System.Net.ServicePointManager]::CertificatePolicy = new-object IDontCarePolicy 
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls11

 				$body = @"
{
`"data`":
{
`"Dest`": `"123`", 
`"Line`": `"1`",
`"Type`": `"SIP`"
}
}

"@
 Invoke-RestMethod -Uri "https://10.252.149.61/api/v1/callctrl/dial" -Credential $cred  -body $body -Method Post -ContentType "application/json"  -TimeoutSec 2

LineInfo:

 

The below prints the Line Info

$username = "Polycom"
$password = "789" | ConvertTo-SecureString -AsPlainText -Force
$cred = New-Object System.Management.Automation.PSCredential($username,$password)

add-type @"
        using System.Net;
        using System.Security.Cryptography.X509Certificates;

            public class IDontCarePolicy : ICertificatePolicy {
            public IDontCarePolicy() {}
            public bool CheckValidationResult(
                ServicePoint sPoint, X509Certificate cert,
                WebRequest wRequest, int certProb) {
                return true;
            }
        }
"@
[System.Net.ServicePointManager]::CertificatePolicy = new-object IDontCarePolicy 
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls11
 Invoke-RestMethod -Uri "https://10.252.149.61/api/v1/mgmt/lineInfo" -Credential $cred  -Method Get -ContentType "application/json"  -TimeoutSec 2

 

Curl Example:

 

REST API command Format for GET:

 

curl -X GET -H "Content-Type: application/JSON" http://Polycom:789@10.221.72.163/api/v1/mgmt/transferType/get

 

For POST Method:

 

curl -d "{\"data\": {\"Dest\": 123,\"Line\": 1,\"Type\": \"SIP\"}}" -H "Content-Type: application/json" http://Polycom:789@10.221.72.163/api/v1/callctrl/dial



<======== Signature / Disclaimer ========>
Please be aware:For questions about the type of support to expect please check here

Please also ensure you always check the VoIP , Video Endpoint , Skype for Business , PSTN or RPM FAQ's

Please remember, if you see a post that helped you , and it answers your question, please mark it as an "Accept as Solution".

The title Polycom Employee & Community Manager is an automatic setting within the community and any forum reply or post is based upon my personal experience and does not reflect the opinion or view of my employer.
Poly employee participation within this community is not mandatory and any post or FAQ article provided by myself is done either during my working hours or outside working hours, in my private time, and maybe answered on weekends, bank holidays or personal holidays.