Cisco Unity Connection Provisioning Interface (CUPI) API -- Holiday Schedules

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
Schedule Example

Contents


Holiday Schedules API

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

Listing the Holiday Schedule Details

The following is an example of the GET request that list the holiday schedules:

GET https://<connection-server>/vmrest/schedules/<holidayschedule-objectid>/scheduledetails

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

<ScheduleDetails total="1">
     <ScheduleDetail>
          <URI>/vmrest/schedules/f62e3780-4bfc-4c8f-91a4-3ac4e35803c4/scheduledetails/894f29bc-8ff1-4183-b8c1-f1c304d9109b</URI>
          <ObjectId>894f29bc-8ff1-4183-b8c1-f1c304d9109b</ObjectId>
          <ScheduleObjectId>f62e3780-4bfc-4c8f-91a4-3ac4e35803c4</ScheduleObjectId>
          <ScheduleURI>/vmrest/schedules/f62e3780-4bfc-4c8f-91a4-3ac4e35803c4</ScheduleURI>
          <IsActiveMonday>false</IsActiveMonday>
          <IsActiveTuesday>false</IsActiveTuesday>
          <IsActiveWednesday>false</IsActiveWednesday>
          <IsActiveThursday>false</IsActiveThursday>
          <IsActiveFriday>false</IsActiveFriday>
          <IsActiveSaturday>true</IsActiveSaturday>
          <IsActiveSunday>true</IsActiveSunday>
          <StartTime>480</StartTime>
          <EndTime>1020</EndTime>
     </ScheduleDetail>
</ScheduleDetails>
Response Code: 200

JSON Example

To list all the holiday schedules, do the following:

GET https://<connection-server>/vmrest/schedules/<holidayscheduleobjectid>/scheduleobjectid
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": "1",
     "ScheduleDetail":
     {
          "URI": "/vmrest/schedules/f62e3780-4bfc-4c8f-91a4-3ac4e35803c4/scheduledetails/894f29bc-8ff1-4183-b8c1-f1c304d9109b",
          "ObjectId": "894f29bc-8ff1-4183-b8c1-f1c304d9109b",
          "ScheduleObjectId": "f62e3780-4bfc-4c8f-91a4-3ac4e35803c4",
          "ScheduleURI": "/vmrest/schedules/f62e3780-4bfc-4c8f-91a4-3ac4e35803c4",
          "IsActiveMonday": "false",
          "IsActiveTuesday": "false",
          "IsActiveWednesday": "false",
          "IsActiveThursday": "false",
          "IsActiveFriday": "false",
          "IsActiveSaturday": "true",
          "IsActiveSunday": "true",
          "StartTime": "480",
          "EndTime": "1020"
     }
}
Response Code: 200

Viewing the Specific Holiday Schedule

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

GET https://<connection-server>/vmrest/schedules/<holidayscheduleobjectid>

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

<Schedule>
     <URI>/vmrest/schedules/f62e3780-4bfc-4c8f-91a4-3ac4e35803c4</URI>
     <ObjectId>f62e3780-4bfc-4c8f-91a4-3ac4e35803c4</ObjectId>
     <DisplayName>Tenant1_Holiday_1</DisplayName>
     <OwnerLocationObjectId>97a1e9ab-6a69-4272-952a-b0e25c08aaaf</OwnerLocationObjectId>
     <OwnerLocationURI>/vmrest/locations/connectionlocations/97a1e9ab-6a69-4272-952ab0e25c08aaaf</OwnerLocationURI>
     <IsHoliday>true</IsHoliday>
     <Undeletable>false</Undeletable>
     <ScheduleDetailsURI>/vmrest/schedules/f62e3780-4bfc-4c8f-91a4-3ac4e35803c4/scheduledetails</ScheduleDetailsURI>
</Schedule>
Response Code: 200

JSON Example

To view a specific holiday schedule, do the following:

GET https://<connection-server>/vmrest/schedules/<holidayscheduleobjectid>
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/schedules/10c9ac6c-6a4c-4559-be75-2c409ef85054",
     "ObjectId": "10c9ac6c-6a4c-4559-be75-2c409ef85054",
     "DisplayName": "Tenant2_Holiday_1",
     "OwnerLocationObjectId": "97a1e9ab-6a69-4272-952a-b0e25c08aaaf",
     "OwnerLocationURI": "/vmrest/locations/connectionlocations/97a1e9ab-6a69-4272-952ab0e25c08aaaf",
     "IsHoliday": "true",
     "Undeletable": "false",
     "ScheduleDetailsURI": "/vmrest/schedules/10c9ac6c-6a4c-4559-be75-2c409ef85054/scheduledetails"
}
Response Code: 200

Creating a New Holiday Schedule

The following is an example of POST request that can be used to create a new holiday schedule:

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

Request Body:

<Schedule>
     <DisplayName>Texoma_Holiday</DisplayName>
     <OwnerLocationObjectId>5150cb31-a665-47d8-a311-9cc4524810d39</OwnerLocationObjectId>
     <IsHoliday>true</IsHoliday>
</Schedule>

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/schedules/f62e3780-4bfc-4c8f-91a4-3ac4e35803c4

JSON Example

To create a new holiday schedule, do the following:

POST https://<connection-server>/vmrest/schedules
Accept: application/json
Content-Type: application/json
Connection: keep-alive
Request Body:
{
     "DisplayName":"Texoma_Holiday ",
     "OwnerLocationObjectId":"5150cb31-a665-47d8-a311-9cc4524810d3",
     "IsHoliday":"true"
}

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/schedules/f62e3780-4bfc-4c8f-91a4-3ac4e35803c4

Updating the Holiday Schedule

The following is an example of the PUT request that can be used to modify the holiday schedule where only description field can be updated:

PUT https://<connection-server>/vmrest/schedules/<holidayscheduleobjectid>

Request Body:

<Schedule>
     <DisplayName>Texoma1_Holiday</DisplayName>
     <OwnerLocationObjectId>5150cb31-a665-47d8-a311-9cc4524810d3</OwnerLocationObjectId>
</Schedule>
Response Code: 204

JSON Example

To update the holiday schedule, do the following:

PUT https://<connection-server>/vmrest/schedules/<holidayscheduleobjectid>
Accept: application/json
Content-Type: application/json
Connection: keep-alive

Request Body

{
"DisplayName":"Texoma1_Holiday ",
"OwnerLocationObjectId":"5150cb31-a665-47d8-a311-9cc4524810d3"
}

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 a Holiday Schedule

This request can be used to delete an existing holiday Schedule; an administrator makes a DELETE to the schedules resource, specifying the object ID of the holiday schedule they wish to delete in the URI:

DELETE https://<connection-server>/vmrest/schedules/<holidayscheduleobjectid>
Response Code: 204

JSON Example

DELETE https://<connection-ip>/vmrest/schedules/<holidayschedule-objectid>
Accept: application/json
Connection: keep-alive
Response code: 204

Explanation of Data Fields

The following chart lists all of the data fields:

Parameter Data Type Operations Comments
ObjectId String(36) Read Only Specifies a globally unique, system-generated identifier for a Schedule object.
URI String Read Only Specifies the URI for schedule.
DisplayName String(64) Read/Write Specifies the preferred text name of this scheduleto be used when displaying entries in the administrative console and Cisco Personal Assistant.
OwnerLocationObjectId String(36) Read Only Specifies the owner of this schedule. If the owner is a LocationVMS, the unique identifier of the LocationVMS objects to which this schedule belongs. Commonly referred to as a "system" schedule. Otherwise, this attribute is set to NULL.
OwnerPersonalRuleSetObjectId String(36) Read Only Specifies the owner of this schedule. If the owner is a personal rule set, the unique identifier of the personal rule set to which this schedule belongs. Otherwise, this attribute is set to NULL. OwnerSubscriberObjectId String(36) Read Only Specifies the owner of this schedule. If the owner is a subscriber, the unique identifier of the Subscriber objects to which this schedule belongs. Otherwise, this attribute is set to NULL. Undeletable Boolean Read/Write Indicates a flag that checks whether this schedule can be deleted via an administrative application such as Cisco Unity Connection Administration. It is used to prevent deletion of factory defaults.
StartDate DateTime Read/Write The date and time when schedule becomes active, or NULL if active immediately.
StartTime Integer Read/Write The start time (in minutes) for the active day or days. The start time is stored as the number of minutes from midnight. So a value of 480 would mean 8:00 AM and 1020 would mean 5:00 PM. In addition, a value of NULL for the start time indicates 12:00 AM.
  • Range 0-1435
EndDate DateTime Read/Write The date and time when schedule ends, or NULL if effective indefinitely.
EndTime Integer Read/Write The end time (in minutes) for the active day or days. The end time is stored as the number of minutes from midnight. So a value of 480 would mean 8:00 AM and 1020 would mean 5:00 PM. In addition, a value of NULL means "till the end of the day" (e.g. 11:59:59 PM in Linux land).
  • Range 0-1435
IsHoliday Boolean Read/Write A flag indicating whether this schedule represents a holiday.
ScheduleDetailsURI String Read Only URI for scheduledetails

Rating: 0.0/5 (0 votes cast)

Personal tools