...
Note | ||
---|---|---|
| ||
Download here. Do not hesitate to contribute in order to make this example better - we welcome Pull Requests! |
Request
...
access token for a
...
trusted app
Download the code:
Code Block | ||
---|---|---|
| ||
curl "https://raw.githubusercontent.com/4psa/uapi-example-perl/master/01_req_token.pl" -o 01_req_token.pl -L |
Make a Sandbox
Callcall
Unified API can be tested using the Sandbox numbers. The example below uses the Create Simple PhoneCalls request to make the call.
Code Block |
---|
curl "https://raw.githubusercontent.com/4psa/uapi-example-perl/master/02_sandbox_call.pl" -o 02_sandbox_call.pl -L |
Park a
Phone Callphone call
The example below demonstrates how you can use Unified API to park a party of an ongoing phone call. It uses the Park PhoneCalls request.
Code Block |
---|
curl "https://raw.githubusercontent.com/4psa/uapi-example-perl/master/03_park_call.pl" -o 03_park_call.pl -L |
Transfer a
Callcall to a
Public Numberpublic number
The example below demonstrates how you can use Unified API to transfer a call to a public number, not registered with VoipNow. It uses the Transfer PhoneCalls request.
Code Block |
---|
curl "https://raw.githubusercontent.com/4psa/uapi-example-perl/master/04_transfer_call.pl" -o 04_transfer_call.pl -L |
Record an
Ongoing Conversationongoing conversation
The example below demonstrates how you can use Unified API to record an ongoing conversation. This action is possible for phone numbers that are registered with VoipNow. The recording is saved in the wav format and uses the StartRecording PhoneCalls request.
Code Block |
---|
curl "https://raw.githubusercontent.com/4psa/uapi-example-perl/master/05_record_call.pl" -o 05_record_call.pl -L |
Log in an
Agentagent to a
Queuequeue
The example below demonstrates how you can use Unified API to log in an agent to a queue. It uses the Update QueueAgents request.
Code Block |
---|
curl "https://raw.githubusercontent.com/4psa/uapi-example-perl/master/06_agent_login.pl" -o 06_agent_login.pl -L |
List the
Registration Statusregistration status of an
Extensionextension
The example below demonstrates how you can use Unified API to list the status of an extension. It uses the List Presence request.
Code Block |
---|
curl "https://raw.githubusercontent.com/4psa/uapi-example-perl/master/07_list_registration.pl" -o 07_list_registration.pl -L |
Barge in on an
Existing Phone Callexisting phone call
The example below demonstrates how you can use Unified API to barge in on an ongoing phone call. It uses the BargeIn PhoneCalls request.
Code Block |
---|
curl "https://raw.githubusercontent.com/4psa/uapi-example-perl/master/08_barge_in.pl" -o 08_barge_in.pl -L |
Except where otherwise noted, content in this space is licensed under a Creative Commons Attribution 4.0 International.