Cisco Unity Connection Provisioning Interface (CUPI) API -- User Import

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


LDAP Import

A GET of an LDAP user will have a phone number. When a user is imported, an LDAP import must specify a dtmfAccessId in the payload (this is often based on the phone number).

In this document, <type> in a URI refers to ldap value.


Initial Configuration

Before any LDAP users can be imported, the LDAP synchronization has to be set as described in this section of the Design Guide for Cisco Unity Connection 8.x.


GET a List of Users That Can Be Imported

GET http://<server>/vmrest/import/users/<type>

Only users that are eligible for import are returned; users that are already imported are not in this list.


Offset and Limit Parameters Can Be Part of the ldap Query

http://<server>/vmrest/import/users/<type>?offset=x&limit=y

Note the following:

  • Either parameter can be specified individually
  • If the offset exceeds the number of entries, the response is an empty list
  • If no limit is specified and more than 2000 results are returned, the response is an error


Filter and Sort

To put constraints on search results, LDAP requests support the CUPI standard filter and sort parameters.


Example

GET /vmrest/import/users/ldap?limit=5 HTTP/1.1
Accept: application/json
User-Agent: Java/1.6.0_20
Host: cuc-install-69.cisco.com
Connection: keep-alive
Authorization: Basic Y2NtYWRtaW5pc3RyYXRvcjplY3NidWxhYg==

The GET above would produce the following response:

HTTP/1.1 200 OK
Pragma: No-cache
Cache-Control: no-cache
Expires: Wed, 31 Dec 1969 16:00:00 PST
Set-Cookie: JSESSIONIDSSO=11D3599617B30496BAD4BF2BB4C23B32; Path=/
Set-Cookie: JSESSIONID=2D9E4ACB334EF6DED8734E51EDDDB7F9; Path=/vmrest
Content-Type: application/json
Transfer-Encoding: chunked
Date: Wed, 28 Apr 2010 19:39:03 GMT
Server: 

\{"ImportUser":\[\{"alias":"ui","firstName":"unity","lastName":"install","pkid":"af7dea71-d6c7-47d9-b1db-44190073cf6c"\},\{"alias":"um","firstName":"unity","lastName":"msgstore","pkid":"452caa72-57e5-4644-a14c-f6e147a66e54"\},\{"alias":"ud","firstName":"unity","lastName":"dirsvc","pkid":"8bff5502-64f2-4425-9381-7ff524aea491"\},\{"alias":"ua","firstName":"unity","lastName":"admin","pkid":"7ddba5d6-9eaa-4a92-8513-a9454141d27c"\},\{"alias":"S-SvrG","firstName":"Sonya","lastName":"ServerG","pkid":"aca43d25-4aa3-4270-a174-e5e9f1c3b5b5"\}\]\}

Import a User

POST http://<server>/vmrest/import/users/<type>?templateAlias=<voice mail user template> with an ImportUser object as payload

An important point here is that because these users are imported, almost all values come from the internal database. One exception for an LDAP import is the dtmfAccessId. The dtmfAccessId data is not available in the internal database, so an LDAP import must specify both a pkid and a dtmfAccessId.

For example:

POST /vmrest/import/users/ldap?templateAlias=voicemailusertemplate HTTP/1.1
Content-Type: application/json
User-Agent: Java/1.6.0_20
Host: cuc-install-69.cisco.com
Accept: text/html, image/gif, image/jpeg, \*; q=.2, \*/*; q=.2
Connection: keep-alive
Authorization: Basic Y2NtYWRtaW5pc3RyYXRvcjplY3NidWxhYg==
Content-Length: 126

\{"alias":"sdavis","firstName":"sonya","lastName":"davis","dtmfAccessId":"12123","pkid":"c2e2bf1c-f249-40e5-b7b8-31a5b0333647"\}

The POST above would produce the following response:

HTTP/1.1 201 Created

Rating: 1.5/5 (2 votes cast)

Personal tools