How to use the API Testing tool

How to use the API tool.

The TestSuite is located at:
http://developers.digium.com/switchvox/?pageView=testSuite
This tool is very useful for testing API calls and checking their output.

The steps for using the API Tool are:

  1. Enter the Hostname Or IP of your switchvox device.

  2. Enter the Admin Username for this pbx.

  3. Enter the Admin Password for the Admin User.

  4. Choose XML for Request Type.

  5. Select the appropiate version for your switchvox.

  6. Select a Category related to the task you want to perform.

  7. Select the Method you would like to test.

  1. Depending on the Method, there will usually be some variables to define
    This is done from the Request Parameters area. In this example, we are testing
    the switchvox.extensions.search API method, we can filter our search using the request parameters
    or leave them blank to simply return a list of all extensions.

  1. Leave all these fields blank and click the Send Request button.
    This will submit the Request shown below in the Request block of the page, to the switchvox, with authentication.

  1. If successful, The Response block will populate with the output of the method, in this case, a list of every extension on the system.
    On Failures, the failure reason will be displayed instead of the word 'Success!'

Note: If the API fails, but the Response section does not include a failure code, try setting the Request Type to a different method, submitting the request, and changing back.

  1. To complete this example, lets filter the search results by modifying our initial Request.

    1. Next to Extension_Types in the Request Parameters Box, check the Include Checkbox.

    2. The entry below it for a single extension_type is enabled, type ivr in lowercase.

    3. Click Send Request. Check the Response Output, now it is only returning extensions that are of type IVR.

  1. For a complete list of all exposed API Methods and descriptions of their parameters, Check the following link:

http://developers.digium.com/switchvox/wiki/index.php/WebService_methods

Return to Documentation Home I Return to Sangoma Support