Cisco Unity Connection Provisioning Interface (CUPI) API -- Restriction Tables

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


Restriction Tables

Administrator can use this API to create/update/delete/fetch the restriction table. Various attributes of restriction table can also be updated using this API.


Listing the Restriction Tables

The following is an example of the GET request that lists all the restriction tables:

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

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

<RestrictionTables total="2">
  <RestrictionTable>
     <URI>/vmrest/restrictiontables/71be3f47-fcf4-463d-8e8a-1710a2180de6</URI>
     <ObjectId>71be3f47-fcf4-463d-8e8a-1710a2180de6</ObjectId>
     <CreationTime>2013-01-29T09:46:52Z</CreationTime>
     <DefaultBlocked>false</DefaultBlocked>
     <LocationObjectId>9f59d35f-104b-4875-9995-39925dd024c0</LocationObjectId>
     <LocationURI>/vmrest/locations/connectionlocations/9f59d35f-104b-4875-9995-
   39925dd024c0</LocationURI>
     <MaxDigits>40</MaxDigits>
     <MinDigits>1</MinDigits>
     <DisplayName>Default Transfer</DisplayName>
     <Undeletable>true</Undeletable>
     <RestrictionPatternsURI>/vmrest/restrictiontables/71be3f47-fcf4-463d-8e8a-
   1710a2180de6/restrictionpatterns</RestrictionPatternsURI>
  </RestrictionTable>
  <RestrictionTable>
     <URI>/vmrest/restrictiontables/a056f147-6469-4bb3-8314-5d0ff8011bad</URI>
     <ObjectId>a056f147-6469-4bb3-8314-5d0ff8011bad</ObjectId>
     <CreationTime>2013-01-29T09:46:52Z</CreationTime>
     <DefaultBlocked>false</DefaultBlocked>
     <LocationObjectId>9f59d35f-104b-4875-9995-39925dd024c0</LocationObjectId>
     <LocationURI>/vmrest/locations/connectionlocations/9f59d35f-104b-4875-9995-
   39925dd024c0</LocationURI>
     <MaxDigits>40</MaxDigits>
     <MinDigits>1</MinDigits>
     <DisplayName>Default Outdial</DisplayName>
     <Undeletable>true</Undeletable>
     <RestrictionPatternsURI>/vmrest/restrictiontables/a056f147-6469-4bb3-8314-
   5d0ff8011bad/restrictionpatterns</RestrictionPatternsURI>
  </RestrictionTable>
</RestrictionTables>
Response Code: 200

JSON Example

To list all the restriction tables use the following command, do the following:

Request URI:
GET https://<connection-server>/vmrest/restrictiontables
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",
  "RestrictionTable": [
  {
     "URI": "/vmrest/restrictiontables/4f01e5b1-b649-4f94-b55e-0c53d0e29c38",
     "ObjectId": "4f01e5b1-b649-4f94-b55e-0c53d0e29c38",
     "CreationTime": "2013-02-14T05:05:09Z",
     "DefaultBlocked": "false",
     "LocationObjectId": "bbf3e6ed-0278-479c-9a6e-2da8756eeb6f",
     "LocationURI": "/vmrest/locations/connectionlocations/bbf3e6ed-0278-479c-9a6e-
     2da8756eeb6f",
     "MaxDigits": "40",
     "MinDigits": "1",
     "DisplayName": "Default Transfer",
     "Undeletable": "true",
     "RestrictionPatternsURI": "/vmrest/restrictiontables/4f01e5b1-b649-4f94-b55e-
     0c53d0e29c38/restrictionpatterns"
  },
  {
     "URI": "/vmrest/restrictiontables/d66b1140-986a-40f1-a7d0-09714652d53f",
     "ObjectId": "d66b1140-986a-40f1-a7d0-09714652d53f",
     "CreationTime": "2013-02-14T05:05:09Z",
     "DefaultBlocked": "false",
     "LocationObjectId": "bbf3e6ed-0278-479c-9a6e-2da8756eeb6f",
     "LocationURI": "/vmrest/locations/connectionlocations/bbf3e6ed-0278-479c-9a6e-
     2da8756eeb6f",
     "MaxDigits": "40",
     "MinDigits": "1",
     "DisplayName": "Default Outdial",
     "Undeletable": "true",
     "RestrictionPatternsURI": "/vmrest/restrictiontables/d66b1140-986a-40f1-a7d0-
     09714652d53f/restrictionpatterns"
  }
  ]
}
Response Code: 200


Viewing the Specific Restriction Table

Example 1: With valid object ID

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

GET https://<connection-server>/vmrest/restrictiontables/<restrictiontableobjectid>

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

<RestrictionTable>
     <URI>/vmrest/restrictiontables/71be3f47-fcf4-463d-8e8a-1710a2180de6</URI>
     <ObjectId>71be3f47-fcf4-463d-8e8a-1710a2180de6</ObjectId>
     <CreationTime>2013-01-29T09:46:52Z</CreationTime>
     <DefaultBlocked>false</DefaultBlocked>
     <LocationObjectId>9f59d35f-104b-4875-9995-39925dd024c0</LocationObjectId>
     <LocationURI>/vmrest/locations/connectionlocations/9f59d35f-104b-4875-9995-
   39925dd024c0</LocationURI>
     <MaxDigits>40</MaxDigits>
     <MinDigits>1</MinDigits>
     <DisplayName>Default Transfer</DisplayName>
     <Undeletable>true</Undeletable>
     <RestrictionPatternsURI>/vmrest/restrictiontables/71be3f47-fcf4-463d-8e8a-
   1710a2180de6/restrictionpatterns</RestrictionPatternsURI>
</RestrictionTable>
Response Code: 200

JSON Example

To view specific restriction table, do the following:

Request URI:
GET https://<connection-server>/vmrest/restrictiontables/<restrictiontableobjectid>
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/restrictiontables/d66b1140-986a-40f1-a7d0-09714652d53f",
     "ObjectId": "d66b1140-986a-40f1-a7d0-09714652d53f",
     "CreationTime": "2013-02-14T05:05:09Z",
     "DefaultBlocked": "false",
     "LocationObjectId": "bbf3e6ed-0278-479c-9a6e-2da8756eeb6f",
     "LocationURI": "/vmrest/locations/connectionlocations/bbf3e6ed-0278-479c-9a6e-
     2da8756eeb6f",
     "MaxDigits": "40",
     "MinDigits": "1",
     "DisplayName": "Default Outdial",
     "Undeletable": "true",
     "RestrictionPatternsURI": "/vmrest/restrictiontables/d66b1140-986a-40f1-a7d0-
     09714652d53f/restrictionpatterns"
}
Response Code: 200


Creating a Restriction Table

The following is an example of the POST request that creates a restriction table:

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

Example 1: The following is the example of the create request from the above *POST* request.

Request Body:
<RestrictionTable>
     <DisplayName>Texoma 1</DisplayName>
</RestrictionTable>
Response Code: 201

JSON Example

To create new restriction table, do the following:

POST https://<connection-server>/vmrest/restrictiontables
Accept: application/json
Content-Type: application/json
Connection: keep-alive
Request Body:
{
     "DisplayName": "Texoma 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

Example 2: The following is the example of the create request with maximum and minimum length

Request Body:
<RestrictionTable>
     <DisplayName>Texoma Restriction Table_7</DisplayName>
     <MinDigits>50</MinDigits>
     <MaxDigits>60</MaxDigits>
</RestrictionTable>

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

JSON Example

To create restriction table with maximum and minimum length, do the following:

Request URI:
POST https://<connection-server>/vmrest/restrictiontables
Accept: application/json
Content-Type: application/json
Connection: keep-alive
Request Body:
{
     "MaxDigits": "60",
     "MinDigits": "50",
     "DisplayName": "Texoma Restriction Table_7"
}

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


Updating a Restriction Table Parameters

The following is an example of the PUT request that allows you to update the parameters of the restriction tables:

PUT https://<connection-server>/vmrest/restrictiontables/<restrictiontableobjectid>

Example 1: Update display name of restriction table

Request Body:
<RestrictionTable>
     <DisplayName>Texoma_123</DisplayName>
</RestrictionTable>
Response Code: 204

JSON Example

To update display name of restriction table, do the following:

Request URI:
PUT https://<connection-server>/vmrest/restrictiontables/<restrictiontableobjectid>
Accept: application/json
Content-Type: application/json
Connection: keep-alive
Request Body:
{
     "DisplayName": "Texoma_123"
}

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

Example 2: Update maximum and minimum digits of restriction table

Request Body:
<RestrictionTable>
     <DisplayName>Texoma Restriction Table_7</DisplayName>
     <MinDigits>241</MinDigits> //Minimum digit range is 1-300, it should not exceed above 300
     <MaxDigits>256</MaxDigits> //Maximum digit range is 1-300, it should not exceed above 300
</RestrictionTable>
Response Code: 204

Example 3: Update default blocked parameter

Request Body:
<RestrictionTable>
     <DefaultBlocked>true</DefaultBlocked>
</RestrictionTable>
Response Code: 204


Deleting a Restriction Table

Example 1: Deleting a restriction table with a valid object id

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

DELETE https://<connection-server>/vmrest/restrictiontables/<restrictiontableobjectid>
Response Code: 204

JSON Example

To delete restriction table with a valid object id, do the following:

DELETE https://<connection-server>/vmrest/restrictiontables/<restrictiontableobjectid>
Accept: application/json
Connection: keep-alive
Response Code: 204

NOTE: Default restriction table cannot be edited or deleted.


Explanation of Data Fields

The following chart lists all of the data fields:

Device Name Data Type Operation Comments
ObjectId String(36) Read only Specifies an unique and system generated ID of a particular restriction table object.
DisplayName String(64) Read/Write Specifies unique display name of restriction table in order to display entries in the administrative console.
MaxDigits Integer Read/Write Specifies the maximum number of digits in a dial string (including access codes) allowed by Cisco Unity Connection. Only dial strings that contain a number of digits fewer than or equal to the number of digits specified in this column are checked against the restriction table. Dial strings that contain more than the numbers of digits specified in this column are not permitted. For example, if the local calls in your area are

seven digits long, and you want to prevent subscribers from using long distance phone numbers, enter 8 in this column.(Range 1-300).

MinDigits Integer Read/Write Specifies the minimum number of digits in a dial string (including access codes) allowed by Cisco Unity Connection. Only dial strings that contain a number of digits greater than or equal to the number of digits specified in this column are checked against the restriction table. Dial strings that contain fewer than the number of digits specified in this column are not permitted. For example, to prohibit subscribers from using

four-digit numbers, enter a value of 5 in this column. (Range 1-300)

DefaultBlocked Boolean Read/Write A flag indicating whether Cisco Unity Connection permits the phone number in the case where a phone number does not match any call patterns in this restriction table. This condition should never occur. By default, all restriction tables should have * as the call pattern in the last dial string of the table and an administrator should not be allowed to modify this call pattern setting.

Possible values:

  • false: Blocked
  • true: Not Blocked

Default value: false

CreationTime DateTime Read only Creation date and time of restriction table.
Undeletable Boolean Read/Write A flag indicating whether this restriction table can be deleted via an administrative application such as Cisco Unity Connection Administration. It is used to prevent deletion of factory defaults.

Default Value - false

Rating: 0.0/5 (0 votes cast)

Personal tools