.. index:: SOAP API Reference .. _soap-api-reference: ================== SOAP API Reference ================== .. note:: Web services defined in this section for configuration of the system are all SOAP based services and require administrator privileges to be used. About SOAP ---------- The SOAP API enables administrators to perform a variety of functions offered by sipxconfig, but without the need to directly interacting with the sipxconfig webui. The server utilizes the `Apache Axis `_ framework. SOAP base URL ~~~~~~~~~~~~~ The base URL for the configuration API is the following:: https://host.domain/sipxconfig/services/ SOAP use case examples ~~~~~~~~~~~~~~~~~~~~~~ Use case examples for the SOAP APIs might be: * Integration of sipxcom functionality with your company Intranet site. * Automate or script processes such as adding or importing users, updating phones, assigning phones to groups, etc. * Customize the sipxconfig webui to suit your needs. You can use SOAP with WDSL, which is a formal API definition, and generate bindings in your preferred programming language such as Python, Perl, Ruby, Java, and others. It is recommended to select a programming language with good SOAP client support. **Ruby:** From the WSDL you can use the `SOAP4R project `_ to build client bindings. **Perl:** Install `SOAP for Perl `_ with:: perl -MCPAN -e 'install SOAP::lite' **Command line:** Use the following command:: java -jar $WsdlDocDir/wsdldoc.jar {color} -title "sipXconfig SOAP API v3.2" {color} -dir `pwd`"/ws-api-3.2" {color} http://sipXcom.sipfoundry.org/rep/sipXcom/main/sipXconfig/web/src/org/sipfoundry/sipxconfig/api/sipxconfig.wsdl Administration Services ----------------------- The following resources for the Configuration API are only available for users with administration rights. **Permissions** * Add permissions * Find permissions * Manage permissions **Call Groups** * Add call group * Find call groups * WSDL Call Group **Users** * Add users * Find users * Manage users **Phones** * Add phones * Find phones * Manage phones **Tests** * Reset Permissions ~~~~~~~~~~~ The Permission Web Services supported are SOAP based services. These services use the Web Service Definition Language (WSDL) to define the interfaces supported. **URI** :: https://host.domain/sipxconfig/services/PermissionService **WSDL** :: - .. note:: wsdlsoap:address location specified at the end of the WSDL will be specific to your system. Add Permissions ~~~~~~~~~~~~~~~ **Name:** *addPermission* **Description:** Add a custom call permission to the system. **Input Parameters:** .. list-table:: * - **Name** - **Value type** - **Required/Optional** - **Description** - **Editable/Read only** * - *name* - string - Required - The name of the permission to add. Even though it is a required parameter its value is ignored and an internal name is generated. - Editable * - *label* - string - Optional - The label of the permission to add. Label is the name displayed in the webui. - Editable * - *description* - string - Optional - Indicates if the permission is enabled (true) or disabled (false) by default for users. - Editable * - *defaultValue* - boolean - Optional - Indicates if the permission is enabled (true) or disabled (false) by default for users. - Editable * - *type* - string - - The type of permission. Read only, any string on add will be ignored. - Read Only * - *builtIn* - boolean - - Indicates if the permission is builtin (true) or not (false). Read only, any string on add will be ignored. - Read Only **Output parameters:** Empty response. **Example:** Adding a call permission with label "Test three" whose default value is false:: Test3 Third test permission false Find Permissions ~~~~~~~~~~~~~~~~ **Name:** *findPermission* **Description:** Search for a permission or permissions defined in the system. **Input Parameters:** .. list-table:: * - **Name** - **Value type** - **Required/Optional** - **Description** - **Editable/Read only** * - *byName* - string - Optional - Indicates a name for permissions by their name. May be null. - Editable * - *byLabel* - string - Optional - Indicates a search for permissions by their label. May be null. - Editable **Output Parameters:** Array of items representing the permissions found in the search. .. list-table:: * - **Name** - **Value Type** - **Description** * - *name* - string - The name of the permission. * - *label* - string - The value representing the label of the permission. * - *description* - string - Describes the permission. * - *defaultValue* - - Boolean indicating if the permission is enabled (true) or disabled (false) by default for users. * - *builtIn* - boolean - Indicates if the permission is builtin (true) or not (false). **Example:** Search to find all permissions defined in the system. :: **Example:** Search to find permission with label "test three". :: Test Three Manage Permissions ~~~~~~~~~~~~~~~~~~ **Name:** *managePermission* **Description:** Manage (update or delete) existing permissions defined in the system. Only permissions which are not built into the system can be edited or deleted. **Input Parameters:** .. list-table:: * - **Name** - **Value type** - **Required/Optional** - **Description** - **Editable/Read only** * - *byName* - string - Optional - String used to indicate a search for permissions by their name. May be null. Name is internally generated value and may not be useful for searching. - Editable * - *byLabel* - string - Optional - Indicates a search for permissions by their label. May be null. - Editable * - *property* - - - Name of the permission field to edit. - * - *value* - - - Value to use for the permission field being edited. - * - *deletePermission* - boolean - Optional - Indicating to delete (true) a permission. - **Output Parameters:** Empty response. **Example**:: foo Call Groups ----------- The call group web services are SOAP based services. These services use the Web Service Definition Language (WSDL) to define the interfaces supported. A call group service deals with information related to hunt groups. Any information queried or added in one of the implemented services are mapped to a hunt group in the configuratio database. **URI** :: https://host.domain/sipxconfig/services/CallGroupService **WSDL** :: Add Call Groups ~~~~~~~~~~~~~~~ .. list-table:: * - **Name** - **Value type** - **Required/Optional** - **Description** - **Editable/Read only** * - *name* - string - Required - String representing the name of the hunt group to add. - Editable * - *extension* - string - Optional - The extension to be associated with the hunt group. - Editable * - *description* - string - Optional - Describes the hunt group. - Editable * - *enabled* - boolean - Optional - Describing the members of the hunt group, their position in the group, time (in seconds) to ring the user. - 0 or more repetitions. * - *expiration* - - - Time in seconds to present the call to the user. - * - *type* - string - - The ring sequence. Can be "delayed" or "immediate". Delay is used to build a sequential type hunt group and immediate a broadcast type hunt group. A mix can be used. - * - *position* - - - The unique position (starting at 0) of the user in the group. - * - *username* - string - - The extension of the user. - **Output Parameters:** Empty response. **Example:** Add a new hunt group "TestGroup2" that is enabled, dialable at extension 556 and contains 4 members (212, 215, 211, and 221). :: TestGroup2 556 Sample SOAP created Hunt Group true 10 delayed 0 212 10 immediate 1 215 15 immediate 2 211 15 delayed 3 221 Get Call Groups ~~~~~~~~~~~~~~~ **Name:** *getCallGroups* **Description:** Query the hunt groups defined in the system. **Input Parameters:** None **Output Parameters:** Array of items representing the permissions found in the search. .. list-table:: * - **Name** - **Value Type** - **Description** * - *name* - string - The name of the hunt group. * - *extension* - string - Representing the extension associated with the hunt group. * - *description* - string - Describes the hunt group. * - *enabled* - boolean - Indicates if the hunt group is enabled (true) or disabled (false). * - *rings* - array - The members of the hunt group, their position, time (in seconds) to ring the user (0 or more repetitions). * - *expiration* - - Time in seconds to present the call to user. * - *type* - string - The ring sequence. Can be 'delayed' or 'immediate'. Delayed is sequential, immediate is broadcast. * - *position* - - The unique position (starting at 0) of the user in the group. * - *username* - string - The extension of the user. **Example:** Query the hunt groups defined in the system. :: Users ----- The user web services are SOAP based services. These services use the Web Service Definition Language (WSDL) to define the interfaces supported. **URI** :: https://host.domain/sipxconfig/services/UserService **WSDL** :: - .. note:: wsdlsoap:address location specified at the end of the WSDL will be specific to your system. Add Users ~~~~~~~~~ **Name:** *addUser* **Description:** Add a new user to the system. **Input Parameters:** .. list-table:: * - **Name** - **Value type** - **Required/Optional** - **Description** - **Editable/Read only** * - *userName* - string - Required - The name of the user to add. - Editable * - *pinToken* - string - optional - Internally generated token that is an encrypted version of the voicemail pin. This should not be specified as it will be internally generated. - Read Only * - *lastName* - string - Optional - The last name of the user. - Editable * - *firstName* - string - Optional - The first name of the user. - Editable * - *sipPassword* - string - Optional - The SIP password for the user. - * - *aliases* - array - - Array of strings, each representing membership in defined groups. - * - *permissions* - array - - Array of strings, each representing a permission name that is granted to the user. Permissions can be general or call permissions. See *findPermission* - * - *pin* - string - Required - The PIN for the user. - Editable * - *branchName* - string - Optional - User branch - Editable **Output Parameters:** Empty response. **Example:** Add a new user 223 to the system with sip password 4567, pin 1234, along with various permissions and group memberships in the branch Berlin. :: 223 Einstein Albert 4567 albertE@yahoo.com Berlin Managers FreeswitchVoicemailServer InternationalDialing LocalDialing LongDistanceDialing Mobile TollFree Voicemail music-on-hold perm_8 personal-auto-attendant tui-change-pin 1234 Find Users ~~~~~~~~~~ **Name:** *findUser* **Description:** Find defined user(s) in the system. **Input Parameters:** Either null for a listing of all users, or one of the following optional parameters. .. list-table:: * - **Name** - **Value Type** - **Required/Optional** - **Description** - **Editable/Read Only** * - *byUserName* - string - Optional - The name of the user to find. - Editable * - *byFuzzyUserNameOrAlias* - string - Optional - A partial user name or alias to search for, a type of wildcard search. - Editable * - *byGroup* - string - Optional - The users which are members of a particular defined group. - Editable **Output parameters:** An array of 0 or more of the following. .. list-table:: * - **Name** - **Value Type** - **Description** * - *userName* - string - The name of the user to add. * - *pinToken* - string - Internally generated token that is an encrypted version of the pin. * - *lastName* - string - The last name of the user. * - *firstName* - string - The first name of the user. * - *sipPassword* - string - The SIP password for the user. * - *aliases* - array - Array of strings, each representing a user alias. * - *emailAddress* - string - The email address of the user. * - *groups* - array - Array of strings, each representing membership in defined groups. * - *pin* - string - The PIN for the user. * - *branchName* - string - Users branch. **Example:** Find all defined users in the system. :: **Example:** Find all users that are members of the group "Managers". :: Managers **Example:** Find the user 223. :: 223 **Example:** Find users whose userName begins with 22. :: 22 Manage Users ~~~~~~~~~~~~ **Name:** *manageUser* **Description:** Manage (update or delete) users defined in the system. **Input Paramters:** Either null to list all, or one of the following optional parameters. .. list-table:: * - **Name** - **Value Type** - **Required/Optional** - **Description** - **Editable/Read Only** * - *byUserName* - string - Optional - The name of the user to find. - Editable * - *byFuzzyUserNameOrAlias* - string - Optional - A partial username or alias to search for. A type of wildcard search. - Editable * - *byGroup* - string - Optional - The users which are members of a particular defined group. - Editable * - *property* - string - Optional - Name of the user field to edit. - Editable * - *value* - string - Optional - Value to use for the user field being edited. - Editable * - *deleteUser* - boolean - Optional - Indicates to delete (true) user(s). Dependent upon search results. - Editable * - *addGroup* - string - Optional - The name of the group to add the user(s) to. Dependent upon search results. - Editable * - *removeGroup* - string - Optional - The name of the group to remove the user(s) from. Dependent upon search results. - Editable * - *updateBranch* - string - Optional - The name of the branch to update the user(s) to. - Editable **Output Parameters:** Empty response **Example:** Remove all users in the system beginning with 22 from group Managers :: 22 Managers **Example:** Add user with username 211 to the group Managers :: 211 Managers **Example:** Change all users from group Managers to have a *lastName* of "SuperDog" and *firstName* of "I am" :: Managers lastName SuperDog firstName I am **Example:** Update user with username 211 to the branch Berlin :: 211 Berlin Park Orbits ----------- The park orbit web services are SOAP based services. These services use the Web Service Definition Language (WSDL) to define the interfaces supported. **URI** :: https://host.domain:8443/sipxconfig/services/ParkOrbitService **WSDL** :: - Add Park Orbits ~~~~~~~~~~~~~~~ **Name:** *addParkOrbit* **Description:** Add a new call park orbit to the system. **Input Parameters:** Either null to list all users, or provide one of the following optional parameters. .. list-table:: * - **Name** - **Value Type** - **Required/Optional** - **Description** - **Editable/Read Only** * - *name* - string - Required - The name of the call park orbit to add. - Editable * - *extension* - string - Optional - Dialable extension to be used. - Editable * - *description* - string - Optional - Description of the call park orbit. - Editable * - *enabled* - boolean - Optional - Indicates if the call park is enabled (true) or disabled (false) - Editable * - *music* - path - Optional - Path to a wav file to play as background music for parked calls. - Editable .. note:: wav files must be in the appropriate format of RIFF (little-endian) data, WAVE audio, Microsoft PCM, 16 bit, mono 8000 Hz **Output parameters:** Empty response. **Example:** Add a new call park orbit with the name ParkSales at extension 46 and is enabled. :: ParkSales 46 Sales calls park orbit true Get Park Orbits ~~~~~~~~~~~~~~~ **Name:** *getParkOrbits* **Description:** Queries information on all call park orbits defined in the system. **Input Parameters:** None **Output Parameters:** .. list-table:: * - **Name** - **Value Type** - **Description** * - *name* - string - The name of the call park orbit. * - *extension* - string - The dialable extension. * - *description* - string - A description of the call park orbit. * - *enabled* - boolean - Indicates if the call park orbit is enabled (true) or disabled (false). * - *music* - - Path to a wav file to play as background music for parked calls. .. note:: wav files must be in the appropriate format of RIFF (little-endian) data, WAVE audio, Microsoft PCM, 16 bit, mono 8000 Hz **Example:** Query the call park orbits defined in the system. :: Phones ------ The phone web services are SOAP based services. These services use the Web Service Definition Language (WSDL) to define the interfaces supported. **URI** :: https://host.domain/sipxconfig/services/PhoneService **WSDL** :: - .. note:: wsdlsoap:address location specified at the end of the WSDL will be specific to your system. Add Phones ~~~~~~~~~~ **Name:** *addPhone* **Description:** Add a new phone to the system. **Input Parameters:** .. list-table:: * - **Name** - **Value Type** - **Required/Optional** - **Description** - **Editable/Read Only** * - *serialNumber* - string - Required - The MAC address of the phone. - Editable * - *modelId* - string - Required - A supported model ID. - Editable * - *description* - string - Optional - A description of the phone. - Editable * - *groups* - string - Optional - The phone group(s) the new phone will be a member of. - Editable * - *lines* - string - Optional - String representing assigned lines to the phone. - Editable * - *deviceVersion* - string - Optional - The version of the phone. - Editable **Output Parameters:** Empty response. **Example:** Add a new polycom spip 321 phone to the system, assign line 221, and add to phone group FirstPhoneGroup. :: 000000000002 polycom321 SOAP added phone FirstPhoneGroup 221 221@Uniteme.ezuce.com **List of supported phones:** :: aastra53i aastra55i aastra57i aastra560m aastra sip ip 53i audiocodesMP112_FXS audiocodesMP114_FXS audiocodesMP118_FXS audiocodesMP124_FXS avaya-1210 avaya-1220 avaya-1230 bria ciscoplus7911G ciscoplus7941G ciscoplus7945G ciscoplus7961G ciscoplus7965G ciscoplus7970G ciscoplus7975G cisco7960 cisco7940 cisco7912 cisco7905 cisco18x clearone gtekAq10x gtekHl20x gtekVt20x gsPhoneBt100 gsPhoneBt200 gsPhoneGxp2020 gsPhoneGxp2010 gsPhoneGxp2000 gsPhoneGxp1200 gsPhoneGxv3000 gsFxsGxw4004 gsFxsGxw4008 gsHt286 gsHt386 gsHt486 gsHt488 gsHt496 hitachi3000 hitachi5000 hitachi5000A ipDialog isphone karelIP116 karelIP112 karelIP111 karelNT32I karelNT42I linksys901 linksys921 linksys922 linksys941 linksys942 linksys962 linksys2102 linksys3102 linksys8000 SPA501G SPA502G SPA504G SPA508G SPA509G SPA525G mitel nortel11xx nortel1535 lip6804 lip6812 lip6830 polycom321 polycom320 polycom330 polycom331 polycom335 polycom430 polycom450 polycom550 polycom560 polycom650 polycom670 polycomVVX1500 polycom5000 polycom6000 polycom7000 snom300 snom320 snom360 snom370 snomM3 unidatawpu7700 Find Phones ~~~~~~~~~~~ **Name:** *findPhone* **Description:** Find defined phone(s) in the system. **Input Parameters:** Either null for a listing of all, or provide one of the following optional parameters. .. list-table:: * - **Name** - **Value Type** - **Required/Optional** - **Description** - **Editable/Read Only** * - *bySerialNumber* - string - Required - The MAC address of the phone to find - Editable * - *byGroup* - string - Optional - The phones which are members of the specified group. - Editable **Output Parameters:** An array of 0 or more of the following. .. list-table:: * - **Name** - **Value Type** - **Description** * - *serialNumber* - string - The MAC address of the phone. * - *extension* - string - The dialable extension * - *description* - string - The description of the phone **Example:** List all defined phones. :: **Example:** Find all phones that are members of the phone group FirstPhoneGroup. :: FirstPhoneGroup **Example:** Find all phones with the MAC address of 000000000001 :: 000000000001 Manage Phones ~~~~~~~~~~~~~ **Name:** *managePhone* **Description:** Update or delete phones defined in the system. **Input Parameters:** Either null for a listing of all, or provide one of the following optional parameters. .. list-table:: * - **Name** - **Value Type** - **Required/Optional** - **Description** - **Editable/Read Only** * - *bySerialNumber* - string - Required - Search for a phone by MAC address. May be null. - Editable * - *byGroup* - string - Optional - Phones which are members of a specified phone group. - Editable * - *property* - - - The name of the phone field to edit. - * - *value* - - - Value to use for the phone field being edited. - * - *deletePhone* - boolean - Optional - Indicates to delete (true) the phone(s). Dependent upon search results. - * - *addGroup* - string - Optional - The phone group to add the phone(s) to. Dependent upon search results. - * - *removeGroup* - string - Optional - The phone group to remove the phone(s) from. Dependent upon search results. - * - *addLine* - string - Optional - userid and uri to add to the phone(s). Dependent upon search results. - * - *addExternalLine* - string - Optional - userid, dispalyname, password, registrationserver and voicemail of the external line to add to the phone(s). Dependent upon search results. - * - *userId* - string - Required - The user portion of the SIP URI and default value for authorization. - * - *displayName* - string - Optional - The display name to use for the userId. - * - *password* - string - Optional - The password for the userid. - * - *registrationServer* - string - Required - The domain the userid should register to. - * - *voicemail* - string - Optional - The voicemail extension for the userid. - * - *removeLineByUserId* - string - Optional - The userid of the line to remove from the phone(s). Dependent upon search results. - * - *removeLineByUri* - string - Optional - The uri of the line to remove from the phone(s). Dependent upon search results. - * - *restart* - boolean - Optional - Indicates to restart (true) the phone(s). Dependent upon search results. - **Output Parameters:** Empty Response **Example:** Delete all phones which are a part of the group FirstPhoneGroup. :: FirstPhoneGroup true **Example:** Add line with userid 221 to the phones in FirstPhoneGroup, generate the profiles for the phones and restart them. :: FirstPhoneGroup 221 221@Uniteme.ezuce.com true true **Example:** Remove all the phones in FirstPhoneGroup. :: FirstPhoneGroup FirstPhoneGroup Test ---- The test web services are SOAP based services. These services use the Web Service Definition Language (WSDL) to define the interfaces supported. **URI** :: https://host.domain/sipxconfig/services/TestService **WSDL** :: - Reset services ~~~~~~~~~~~~~~ **Name:** *resetServices* **Description:** Resets (deletes) the data associated with one or more web services. .. warning:: This is an extremely dangerous service as it could permanently delete large amounts of configuration data. Use extreme caution! **Input Parameters:** .. list-table:: * - **Name** - **Value Type** - **Required/Optional** - **Description** - **Editable/Read Only** * - *callGroup* - boolean - Optional - Indicates to delete (true) all callGroup (hunt group) data. - Editable * - *parkOrbit* - boolean - Optional - Indicates to delete (true) all call park orbits. - Editable * - *permission* - boolean - Optional - Indicates to delete (true) all non-system defined permissions. - Editable * - *phone* - boolean - Optional - Indicates to delete (true) all defined phones. - Editable * - *user* - boolean - Optional - Indicates to delete (true) all defined users except superadmin. - Editable * - *superadmin* - boolean - Optional - Indicates to delete (true) all superadmin data except for the PIN. - Editable **Output Parameters:** Empty response. **Example:** Remove all hunt groups, park orbits, and permissions defined. :: true true true