Cisco Unity Connection Provisioning Interface (CUPI) API -- Message Aging Rules

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


Message Aging Rules

Administrator can use this API to update/ fetch the message aging rules. Various attributes of message aging rules can also be updated using this API.


Listing the Message Aging Rules

The following is an example of the GET request that lists all the message aging rules:

  GET https://<connection-server>/vmrest/messageagingpolicies/<messageagingpolicyobject-Id>/messageagingrules

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

<MessageAgingRules total="2">
  <MessageAgingRule>
    <URI>/vmrest/messageagingpolicies/0f02be4e-5d70-4a1d-b182-
    ce14ede90ac0/messageagingrules/6951ad4c-a16c-4bf2-b61a-300bbf24519d</URI>
    <MessageAgingPolicyObjectId>0f02be4e-5d70-4a1d-b182-
    ce14ede90ac0</MessageAgingPolicyObjectId>
    <MessageAgingPolicyURI>/vmrest/messageagingpolicies/0f02be4e-5d70-4a1d-b182-
    ce14ede90ac0</MessageAgingPolicyURI>
    <ObjectId>6951ad4c-a16c-4bf2-b61a-300bbf24519d</ObjectId>
    <Days>7</Days>
    <Enabled>true</Enabled>
    <Secure>false</Secure>
    <SendNotification>true</SendNotification>
    <NotificationDays>3</NotificationDays>
    <RuleDescription>Move Saved Messages to the Deleted Items</RuleDescription>
  </MessageAgingRule>
  <MessageAgingRule>
    <URI>/vmrest/messageagingpolicies/0f02be4e-5d70-4a1d-b182-
    ce14ede90ac0/messageagingrules/8792058b-cf27-4c10-8ac1-e903b8d18065</URI>
    <MessageAgingPolicyObjectId>0f02be4e-5d70-4a1d-b182-ce14ede90ac0</MessageAgingPolicyObjectId>
    <MessageAgingPolicyURI>/vmrest/messageagingpolicies/0f02be4e-5d70-4a1d-b182-
    ce14ede90ac0</MessageAgingPolicyURI>
    <ObjectId>8792058b-cf27-4c10-8ac1-e903b8d18065</ObjectId>
    <Days>15</Days>
    <Enabled>true</Enabled>
    <Secure>false</Secure>
    <SendNotification>false</SendNotification>
    <NotificationDays>3</NotificationDays>
    <RuleDescription>Permanently Delete Messages in the Deleted Items </RuleDescription>
  </MessageAgingRule>
</MessageAgingRules>
Response Code: 200

JSON Example

To list all message aging rules, do the following:

Request URI:
GET https://<connection-server>/vmrest/messageagingpolicies/<messageagingpolicyobject-Id>/messageagingrules
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"
  "MessageAgingRule":
  [
  {
    "URI":"/vmrest/messageagingpolicies/2fcb9e34-bb41-41e3-b212-
    1bff3e1d93ed/messageagingrules/230f8ab1-1dba-45db-8e2c-dbd22cad718a"
    "MessageAgingPolicyObjectId":"2fcb9e34-bb41-41e3-b212-    1bff3e1d93ed"
    "MessageAgingPolicyURI":"/vmrest/messageagingpolicies/2fcb9e34-bb41-41e3-b212-
    1bff3e1d93ed"
    "ObjectId":"230f8ab1-1dba-45db-8e2c-dbd22cad718a"
    "Days":"30"
    "Enabled":"true"
    "Secure":"true"
    "SendNotification":"false"
    "NotificationDays":"3"
    "RuleDescription":"Permanently Delete Secure Touched Messages "
  }
  {
    "URI":"/vmrest/messageagingpolicies/2fcb9e34-bb41-41e3-b212-
    1bff3e1d93ed/messageagingrules/b0bc585c-7704-4f36-b7f6-8e8319d89da3"
    "MessageAgingPolicyObjectId":"2fcb9e34-bb41-41e3-b212-1bff3e1d93ed"
    "MessageAgingPolicyURI":"/vmrest/messageagingpolicies/2fcb9e34-bb41-41e3-b212-
    1bff3e1d93ed"
    "ObjectId":"b0bc585c-7704-4f36-b7f6-8e8319d89da3"
    "Days":"60"
    "Enabled":"false"
    "Secure":"true"
    "SendNotification":"false"
    "NotificationDays":"3"
    "RuleDescription":"Permanently Delete All Secure Messages "
  }
  ]
}
Response Code: 200


Viewing the Specific Message Aging Rule

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

  GET https://<connection-server>/vmrest/messageagingpolicies/<messageagingpolicyobject-
  Id>/messageagingrules/<messageagingruleobject-Id>

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

<MessageAgingRule>
    <URI>/vmrest/messageagingpolicies/0f02be4e-5d70-4a1d-b182-
    ce14ede90ac0/messageagingrules/c160becb-0042-441e-a021-4bb4aeb05da4</URI>
    <MessageAgingPolicyObjectId>0f02be4e-5d70-4a1d-b182-
    ce14ede90ac0</MessageAgingPolicyObjectId>
    <MessageAgingPolicyURI>/vmrest/messageagingpolicies/0f02be4e-5d70-4a1d-b182-
    ce14ede90ac0</MessageAgingPolicyURI>
    <ObjectId>c160becb-0042-441e-a021-4bb4aeb05da4</ObjectId>
    <Days>30</Days>
    <Enabled>false</Enabled>
    <Secure>true</Secure>
    <SendNotification>false</SendNotification>
    <NotificationDays>3</NotificationDays>
    <RuleDescription>Permanently Delete Secure Touched Messages </RuleDescription>
</MessageAgingRule>
Response Code: 200

JSON Example

To list details of an individual message aging rule, do the following:

Request URI:
GET https://<connection-server>/vmrest/messageagingpolicies/<messageagingpolicyobject-
Id>/messageagingrules/<messageagingruleobject-Id>
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/messageagingpolicies/0f02be4e-5d70-4a1d-b182-
ce14ede90ac0/messageagingrules/c160becb-0042-441e-a021-4bb4aeb05da4"
    "MessageAgingPolicyObjectId":"0f02be4e-5d70-4a1d-b182-ce14ede90ac0"
    "MessageAgingPolicyURI":"/vmrest/messageagingpolicies/0f02be4e-5d70-4a1d-b182-
ce14ede90ac0"
    "ObjectId":"c160becb-0042-441e-a021-4bb4aeb05da4"
    "Days":"60"
    "Enabled":"false"
    "Secure":"true"
    "SendNotification":"false"
    "NotificationDays":"3"
    "RuleDescription":"Permanently Delete Secure Touched Messages"
}
Response Code: 200


Updating a Message Aging Rule

The following is an example of the PUT request that allows you to update the days parameter of enabled message aging rule:

PUT https://<connection-server>/vmrest/messageagingpolicies/<messageagingpolicyobject-Id>/messageagingrules/<messageagingruleobject-Id>
Request Body:
<MessageAgingRule>
    <Days>25</Days>
</MessageAgingRule>

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

JSON Example

To update the days parameter of enabled message aging rule, do the following:

PUT https://<connection-server>/vmrest/messageagingpolicies/<messageagingpolicyobject-Id>/messageagingrules/<messageagingruleobject-Id>
Accept : application/json
Content-Type: application/json
Connection: keep-alive
Request Body:
{
    "Days":"25"
}

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

NOTE: You can't update the days as well as the NotificationDays parameter if message aging rule is disabled.


Explanation of Data Fields

The following chart lists all of the data fields:

Parameter Operations Data Type Comments
Days Read/Write Integer Age message older than this number of days. Range: 1 to 365.
Action Read/Write Integer Describes the action to take when the rule is applied.

Default Value: 0 Values:

  • 0: Soft Delete
  • 1: Hard Delete
  • 2: ToSaved
Enabled Read/Write Boolean It specifies whether the particular rule is enabled or not.

Values : true or false Default Value: true.

MessageAgingPolicyObjectId Read Only String(36) It specifies the object id of respective Message Aging Policy
MessageAgingPolicyURI Read Only String URI of Message Aging Policy.
AgingRuleType Read/Write Integer Contains the type or purpose of the aging rule.

Default Value: 10 Values:

  • 10: MoveSeenToDeleted
  • 11: HardDeleteDeleted
  • 12: HardDeleteSecureTouched
  • 13: HardDeleteAllSecure
  • 14: MoveNewToSaved
AgingTimeType Read/Write Integer This defines what column to use (modificationtime or arrivaltime) when calculating messages to age.

Default Value: 0 Value:

  • 0: ModificationTime
  • 1: ArrivalTime
LastMessageNotifiedMarker Read/Write datetime A marker used by the sysagent task so we don't send more than one notification per message.
NotificationDays Read/Write Integer If SendNotification is True, send the notification this many days before the rule takes place. It is always less than equal to Days parameter.

Range: 0 to 365. Default Value: 3.

ObjectId Read Only String(36) Object id of Message Aging Rule
RuleDescription Read Only String It describes the action taken by rule.
Secure Read Only Boolean It specifies whether the message is secured type or not.
SendNotification Read/Write Boolean It specifies whether notification is sent prior to taking action.

Values: true or false. Default Value: false.

Seen Read/Write Integer Apply this rule to messages where tbl_FolderItem. Seen is equal to this value. Default Value: NULL
Recent Read/Write Integer If SendNotification is True, send the notification this many days before the rule takes place.

Default Value: 3

URI Read Only String URI of Message Aging Rule.

Rating: 0.0/5 (0 votes cast)

Personal tools