Is it possible to pull the SIP Trunk Default Route from the API?
3CX configuration API via web request, with a system owner user authenticated.
- Which API and from where?
- 3CX API in the 3CX per CFD App or call script?
- 3CX configuration API via web request?
- Where is the 3CX hosted?
- How have you access to it?
- What is the purpose of the query?
$uri="https://$tcxurl/xapi/v1/Trunks(1234)?`$expand=RoutingRules(`$select=Id,Condition,Data,OfficeHoursDestination,RuleName)"
((Invoke-RestMethod -uri $uri -headers $headers -Method GET -ContentType "application/json").RoutingRules | Where { $_.Condition -eq "ForwardAll" }).OfficeHoursDestination.Number
Thanks. This is working!powershell example for a single trunk:
Code:$uri="https://$tcxurl/xapi/v1/Trunks(1234)?`$expand=RoutingRules(`$select=Id,Condition,Data,OfficeHoursDestination,RuleName)" ((Invoke-RestMethod -uri $uri -headers $headers -Method GET -ContentType "application/json").RoutingRules | Where { $_.Condition -eq "ForwardAll" }).OfficeHoursDestination.Number
you should know the specific trunk ID or get all in a loop and select it by name there
Founded in 2005, when VoIP was an emerging technology, 3CX has gone on to establish itself as a global leader in business communications.