Cisco Unity Connection Provisioning Interface (CUPI) API -- Search Space API

From DocWiki

Revision as of 12:05, 16 September 2013 by Subabhat (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Links to Other API pages: Cisco_Unity_Connection_APIs

CUPI Guide Contents
API Overview
Index of All CUPI Documentation


Contents


Search Space API

Search spaces are used to define the search scope of objects (users, distribution lists, and so on) that a user or outside caller can reach while interacting with Connection. For example, the search scope that is applied to a user identifies which users, distribution lists, or VPIM contacts the user can address messages to. It also identifies which users and contacts the user can dial by name when using the voicerecognition conversation. A search space is comprised of one or more ordered partitions. When Connection searches for an object on behalf of a caller, it searches the partitions in the order in which they are arranged in the search space. While extensions must be unique within a partition, they do not need to be unique within a search space, so you can use search spaces to handle dial plans that have overlapping extensions. Operation Supported: Create, Read, Update and Delete.


Listing the Search Spaces

The following is an example of the GET request that lists all the search spaces:

GET https://<connection-server>/vmrest/searchspaces

The following is the response from the above *GET* request.

<SearchSpaces total="1">
  <SearchSpace>
     <URI>/vmrest/searchspaces/7479b688-9c97-4a4b-ab69-ea786f6024be</URI>
     <ObjectId>7479b688-9c97-4a4b-ab69-ea786f6024be</ObjectId>
     <Name>Search Space</Name>
     <Description>Default Search Space</Description>
     <LocationObjectId>08b0402c-ba81-4f16-bcba-ca7883de0482</LocationObjectId>
     <LocationURI>/vmrest/locations/connectionlocations/08b0402c-ba81-4f16-bcba
  ca7883de0482</LocationURI>
     <TimeOwnershipChanged>2012-12-10T19:23:29Z</TimeOwnershipChanged>
     <SearchSpaceMembersURI>/vmrest/searchspaces/7479b688-9c97-4a4b-ab69-
  ea786f6024be/searchspacemembers</SearchSpaceMembersURI>
  </SearchSpace>
</SearchSpaces>
Response Code: 200

JSON Example

To list all the search spaces use the following command, do the following: Request URI: GET https://<connection-server>/vmrest/searchspaces Accept: application/json Connection: keep_alive The following is the response from the above *GET* request and the actual response will depend upon the information given by you: {

 "@total":"2",
 "SearchSpace": [
 {
    "URI":"/vmrest/searchspaces/2e836e16-f715-4a18-bb7c-ee5e33281706"
    "ObjectId":"2e836e16-f715-4a18-bb7c-ee5e33281706"
    "Name":"ucbu-aricent-vm463 Search Space"
    "Description":"Default Search Space"
    "LocationObjectId":"cff1347e-87af-4409-bead-d1970625f82e"
    "LocationURI":"/vmrest/locations/connectionlocations/cff1347e-87af-4409-bead
    d1970625f82e"
    "TimeOwnershipChanged":"2013-02-25 09:37:36.99"
    "SearchSpaceMembersURI":"/vmrest/searchspaces/2e836e16-f715-4a18-bb7c
    ee5e33281706/searchspacemembers"
 },
 {
    "URI":"/vmrest/searchspaces/97efa220-31a7-4409-a0cd-2cdfc669182f"
    "ObjectId":"97efa220-31a7-4409-a0cd-2cdfc669182f"
    "Name":"hello_SearchSpace_1"
    "LocationObjectId":"cff1347e-87af-4409-bead-d1970625f82e"
    "LocationURI":"/vmrest/locations/connectionlocations/cff1347e-87af-4409-beadd1970625f82e"
    "TimeOwnershipChanged":"2013-02-26T05:05:10Z"
    "SearchSpaceMembersURI":"/vmrest/searchspaces/97efa220-31a7-4409-a0cd-
    2cdfc669182f/searchspacemembers"
 }
 ]

} </pre>

Response Code: 200


Viewing the Specific Search Space Details

The following is an example of the GET request that lists the details of specific search space represented by the provided value of search space object ID:

GET https://<connection-server>/vmrest/searchspaces/<searchspaceobjectId>

The following is the response from the above *GET* request:

<SearchSpaceMembers total="1">
  <SearchSpaceMember>
     <URI>/vmrest/searchspaces/7479b688-9c97-4a4b-ab69-
    ea786f6024be/searchspacemembers/8433db04-60e0-414d-99bc-c48dcf8254cb</URI>
     <ObjectId>8433db04-60e0-414d-99bc-c48dcf8254cb</ObjectId>
    <PartitionObjectId>ff1c9ff2-6fcc-47e9-a4e0-a220c6e3ae4e</PartitionObjectId>
    <PartitionURI>/vmrest/partitions/ff1c9ff2-6fcc-47e9-a4e0-a220c6e3ae4e</PartitionURI>
    <SearchSpaceObjectId>7479b688-9c97-4a4b-ab69-ea786f6024be</SearchSpaceObjectId>
    <SearchSpaceURI>/vmrest/searchspaces/7479b688-9c97-4a4b-ab69-
   ea786f6024be</SearchSpaceURI>
    <SortOrder>1</SortOrder>
  </SearchSpaceMember>
</SearchSpaceMembers>
Response Code: 200

JSON Example

To view the specific search space, use the following command:

GET https://<connection-server>/vmrest/searchspaces/<searchspaceobjectid>
Accept: application/json
Connection: keep_alive

The following is the response from the above *GET* request and the actual response will depend upon the information given by you:

{
     "URI":"/vmrest/searchspaces/2e836e16-f715-4a18-bb7c-ee5e33281706"
     "ObjectId":"2e836e16-f715-4a18-bb7c-ee5e33281706"
     "Name":"ucbu-aricent-vm463 Search Space"
     "Description":"Default Search Space"
     "LocationObjectId":"cff1347e-87af-4409-bead-d1970625f82e"
     "LocationURI":"/vmrest/locations/connectionlocations/cff1347e-87af-4409-bead
     d1970625f82e"
     "TimeOwnershipChanged":"2013-02-25 09:37:36.99"
     "SearchSpaceMembersURI":"/vmrest/searchspaces/2e836e16-f715-4a18-bb7c
     ee5e33281706/searchspacemembers"
}
Response Code: 200


Creating a Search Space

The following is an example of the POST request that creates a search space:

POST https://<connection-server>/vmrest/searchspaces
Request URI:
<SearchSpace>
     <Name>Taxoma_SearchSpace</Name>
</SearchSpace>

The following is the example of the response from the above *Post* request:

Response Code: 201
/vmrest/searchspaces/4fc208e7-cb84-4e3f-bcf0-11f69c212b1d

JSON Example

To create a search space, use the following command:

Request URI:
POST https://<connection-server>/vmrest/searchspaces
Accept: application/json
Content_type: application/json
Connection: keep_alive
Request Body:
{
     "Name": "Taxoma_SearchSpace1"
}

The following is the response from the above *POST* request and the actual response will depend upon the information given by you:

Response Code: 201
/vmrest/searchspaces/4fc208e7-cb84-4e3f-bcf0-11f69c212b1d


Adding a Member in a Search Space

The following conditions should be checked before you add a member in a search space:

  • Identify the search space to which you want to add partitions.
  • Obtain the object ID of the partition that has to be added using the following URI
GET https://<connection-server>/vmrest/partitions

The following is an example of the POST request that allows you to add a member in a search space:

  POST https://<connection-server>/vmrest/searchspaces/<ObjectId>/searchspacemembers
Request Body:
  <SearchSpaceMember>
     <PartitionObjectId>2be94430-a2b4-4a0c-b53c-a0290810d0ef</PartitionObjectId>
     <SortOrder>1</SortOrder>
  </SearchSpaceMember>

The output for this request returns the following response:

Response Code: 201
/vmrest/searchspaces/4fc208e7-cb84-4e3f-bcf0-11f69c212b1d/searchspacemembers/f93deeb3-71b2-
4198-bd55-53dc4a11f37c

JSON Example

To add a member in a search space, use the following command:

Request URI:
POST https://<connection-server>/vmrest/searchspaces/seacrchspaceobjectid/searchspacemembers
Accept: application/json
Content_type: application/json
Connection: keep_alive
Request Body:
{
     "PartitionObjectId": "97bf6afe-346e-4275-967e-43c50be79d32",
     "SortOrder": "1"
}

The following is the response from the above *POST* request and the actual response will depend upon the information given by you:

Response Code: 201
/vmrest/searchspaces/72bf712e-ebad-4398-997c-5c21fb1c18c4/searchspacesmembers/0453712e-ebadeadc-
997c-5c21fb1c18c4


List all the Search Space Members Associated with a Specific Search Space

The following is an example of the GET request that lists all the search space members associated with a specific search space:

GET https://<connection-server>/vmrest/searchspaces/seacrchspaceobjectid/searchspacemembers
<SearchSpaceMembers total="1">
  <SearchSpaceMember>
     <URI>/vmrest/searchspaces/7479b688-9c97-4a4b-ab69-
     ea786f6024be/searchspacemembers/8433db04-60e0-414d-99bc-c48dcf8254cb</URI>
     <ObjectId>8433db04-60e0-414d-99bc-c48dcf8254cb</ObjectId>
     <PartitionObjectId>ff1c9ff2-6fcc-47e9-a4e0-a220c6e3ae4e</PartitionObjectId>
     <PartitionURI>/vmrest/partitions/ff1c9ff2-6fcc-47e9-a4e0-
     a220c6e3ae4e</PartitionURI>
     <SearchSpaceObjectId>7479b688-9c97-4a4b-ab69-
     ea786f6024be</SearchSpaceObjectId>
     <SearchSpaceURI>/vmrest/searchspaces/7479b688-9c97-4a4b-ab69-
     ea786f6024be</SearchSpaceURI>
     <SortOrder>1</SortOrder>
  </SearchSpaceMember>
</SearchSpaceMembers>
Response Code: 200

JSON Example

To add a member in a search space, use the following command: GET https://<connection-server>/vmrest/searchspaces/seacrchspaceobjectid/searchspacemembers Accept: application/json Content_type: application/json Connection: keep_alive The following is the response from the above *GET* request and the actual response will depend upon the information given by you: {

 "@total":"1"
 "SearchSpaceMember":
 {
    "URI":"/vmrest/searchspaces/8190d682-9775-4622-9609-
    a113e594b84a/searchspacemembers/540fc81a-d391-4760-9c5f-3d5eac6b8568"
    "ObjectId":"540fc81a-d391-4760-9c5f-3d5eac6b8568"
    "PartitionObjectId":"97bf6afe-346e-4275-967e-43c50be79d32"
    "PartitionURI":"/vmrest/partitions/97bf6afe-346e-4275-967e-43c50be79d32"
    "SearchSpaceObjectId":"8190d682-9775-4622-9609-a113e594b84a"
    "SearchSpaceURI":"/vmrest/searchspaces/8190d682-9775-4622-9609-a113e594b84a"
    "SortOrder":"1"
 }

} </pre>

Response Code: 200
<pre>


=== Updating a Search Space ===

The following is an example of the PUT request that allows you to update a search space:
<pre>
  PUT https://<connection-server>/vmrest/searchspaces/<searchspaceobjectid>
Request Body:
<SearchSpace>
     <Name>Taxoma_SearchSpace</Name>
     <Description>Default search space for taxoma</Description>
</SearchSpace>
Response Code: 204

The output for this request returns the successful response code.

JSON Example

To update a search space, use the following command:

Request URI:
PUT https://<connection-server>/vmrest/searchspaces/seacrchspaceobjectid/
Accept: application/json
Content_type: application/json
Connection: keep_alive
Request Body:
{
     "Name": "Taxoma_SearchSpace",
     "Description": "Default search space for taxoma"
}

The following is the response from the above *PUT* request and the actual response will depend upon the information given by you:

Response Code: 204


Deleting the Search Space

The following is an example of the DELETE request that deletes a specific search space where you need to mention the search space object ID:

DELETE https://<connection-server>/vmrest/searchspaces/<seacrchspaceobjectid>
Response Code: 204

Note: You are not allowed to delete a default search space or if a search space that has been assigned to any user, call handler or a routing rule. The output for this request returns the successful response code.

JSON Example

To delete a search space, use the following command:

DELETE: https://<connection-server>/vmrest/searchspaces/<seacrchspaceobjectid >
Accept: application/json
Connection: keep_alive
Response Code: 204


Deleting the Search Space Members

The following is an example of the DELETE request that deletes a specific search space member where you need to mention the search space members object ID:

DELETE https://<connection-server>/vmrest/searchspaces/<seacrchspaceobjectid>
/searchspacemembers/<searchspacememberobjectid>
Response Code: 204

JSON Example

To delete a search space member, use the following command:

DELETE: https://<connectionserver>/
vmrest/searchspaces/seacrchspaceobjectid/searchspacemembers/<searchspacememberobjectid>
Accept: application/json
Connection: keep_alive
Response Code: 204


Explanation of Data Fields

Search Space

The following chart lists all of the data fields for search space:

Parameter Operations Data Type Comments
URI Read Only String The search space URL.
ObjectId Read Only String (36) The primary key for this table. A systemgenerated, globally unique object identifier.
Name Read/Write String (50) The unique text name of this search space.
Description Read/Write String (50) The description of the search space.
LocationObjectId Read Only String (36) The unique identifier on which this search space was created.
LocationURI Read Only String The location of the URL.
TimeOwnershipChanged Date/Time The time when the ownership of this search space changed. If ownership has never changed, this value will show the creation time.
SearchSpaceMemberURI Read Only String URI of the search space member


Search Space Members

Parameter Operations Data Type Comments
URI Read Only String URI of Search Space’s member
ObjectId Read Only String(36) Object Id of the search space’s member
PartitionObjectId Read Only String(36) Object Id of the partition.
PartitionURI Read Only String URI of the partition.
SearchSpaceObjectId Read Only String(36) Object Id of the search space
SearchSpaceURI Read Only String URI of the search space
SortOrder Read Only Integer Order preference of the member Partition.

Rating: 0.0/5 (0 votes cast)

Personal tools