Cisco Unity Connection Provisioning Interface (CUPI) API -- LDAP Phone Number Transform

From DocWiki

Jump to: navigation, search

Links to Other API pages: Cisco_Unity_Connection_APIs

CUPI Guide Contents
API Overview
Index of All CUPI Documentation

Contents



About LDAP Phone Number Transform

This page contains information on how to use the API to create, list, update, and delete LDAP phone number transforms.

Beginning with Cisco Unity Connection 8.5, we support up to one LDAP phone number transform, which consists of a regular expression and a replacement pattern.

Listing and Viewing

The following is an example of a GET request that lists all LDAP phone number transforms:

GET http://<connection-server>/vmrest/ldapphonenumbertransforms

The following is the response from the above GET request:

200
OK
<?xml version="1.0" encoding="UTF-8"?>
<LdapPhoneNumberTransforms total="1">
  <LdapPhoneNumberTransform>
    <URI>/vmrest/ldapphonenumbertransforms/0d49a281-cc35-4b8b-bccc-f94f8b8903bd</URI>
    <ObjectId>0d49a281-cc35-4b8b-bccc-f94f8b8903bd</ObjectId>
    <Regex>.*([0-9][0-9][0-9][0-9])</Regex>
    <Replacement>9$1</Replacement>
  </LdapPhoneNumberTransform>
</LdapPhoneNumberTransforms>

Creating

The required fields for creating an LDAP phone number transform are Regex and Replacement.

The following is an example of a POST request that creates an LDAP phone number transform with the Regex field set to ".*(\[0-9\]\[0-9\]\[0-9\]\[0-9\])", and the Replacement field set to "9$1":

POST https://<connection-server>/vmrest/ldapphonenumbertransforms/

<LdapPhoneNumberTransform>
    <Regex>.*([0-9][0-9][0-9][0-9])</Regex>
    <Replacement>9$1</Replacement>
</LdapPhoneNumberTransform>

The following is the response from the above POST request:

201
Created
/vmrest/ldapphonenumbertransforms/0d49a281-cc35-4b8b-bccc-f94f8b8903bd

Updating

The Regex and Replacement fields of an LDAP Phone Number Transform can be updated via a PUT request.

The following is an example of a PUT request that modifies the Regex and Replacement fields of an existing LDAP phone number transform:

https://<connection-server>/vmrest/ldapphonenumbertransforms/
0d49a281-cc35-4b8b-bccc-f94f8b8903bd
<LdapPhoneNumberTransform>
  <Regex>.*([0-9][0-9][0-9][0-9][0-9])</Regex>
  <Replacement>8$1</Replacement>
</LdapPhoneNumberTransform>

The following is the response from the above PUT request:

204
No Content
null

Deleting

The following is an example of a DELETE request that deletes an LDAP phone number transform:

DELETE https://<connection-server>/vmrest/ldapphonenumbertransforms/
0d49a281-cc35-4b8b-bccc-f94f8b8903bd

The following is the response from the above DELETE request:

204
No Content
null

Possible Errors

As of Connection 8.5, we support one LDAP phone number transform only, so if you attempt to create a new LDAP phone number transform (via the POST request) when there is already an existing LDAP phone number transform, the following error will be returned:

405
Method Not Allowed
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ErrorDetails>
  <errors>
    <code>METHOD_NOT_ALLOWED</code>
    <message>Unable to perform requested method because an LDAP phone number transform already exists. (This version of Cisco Unity Connection supports up to one LDAP phone number transform only.)</message>
  </errors>
</ErrorDetails>

Rating: 4.0/5 (1 vote cast)

Personal tools