Orchestrator
2022.10
false
Banner background image
Orchestrator API Guide
Last updated Nov 10, 2023

Calendars Requests

Retrieving Calendars According to Their Name

The following GET request to the /odata/Calendars endpoint retrieves a specific calendar based on its Name.

GET

/odata/Calendars?$filter=Name%20eq%20'BankHoliday'

Request headers

Key

Value

Authorization

Bearer

Response code

200 OK

Response body

{
  "@odata.context": "/odata/$metadata#Calendars",
  "value": [
    {
      "TimeZoneId": null,
      "ExcludedDates": [],
      "Name": "BankHoliday",
      "Id": 18845
    }
  ]
}{
  "@odata.context": "/odata/$metadata#Calendars",
  "value": [
    {
      "TimeZoneId": null,
      "ExcludedDates": [],
      "Name": "BankHoliday",
      "Id": 18845
    }
  ]
}

Creating a Calendar

The following POST request to the /odata/Calendars endpoint enables you to create a new calendar with an excluded date.
Note: The Id parameter is automatically generated. The TimeZoneId parameter is populated with the tenant's timezone.

POST

/odata/Calendars

Request headers

Key

Value

Authorization

Bearer

Request body

{
  "Name": "VacationCal",
  "TimeZoneId": "string",
  "ExcludedDates": [
    "2019-11-12T14:31:44.778Z"
  ]
}{
  "Name": "VacationCal",
  "TimeZoneId": "string",
  "ExcludedDates": [
    "2019-11-12T14:31:44.778Z"
  ]
}

Response code

200 OK

Response body

{
  "@odata.context": "/odata/$metadata#Calendars/$entity",
  "TimeZoneId": "GTB Standard Time",
  "ExcludedDates": [
    "2019-11-12T00:00:00Z"
  ],
  "Name": "VacationCal",
  "Id": 32718
}{
  "@odata.context": "/odata/$metadata#Calendars/$entity",
  "TimeZoneId": "GTB Standard Time",
  "ExcludedDates": [
    "2019-11-12T00:00:00Z"
  ],
  "Name": "VacationCal",
  "Id": 32718
}

Retrieving Excluded Dates of a Calendar

The GET /odata/Calendars({calendar_id_value}) endpoint retrieves the excluded dates of the specified calendar.
Use the calendar Id to specify the calendar from which you want to retrieve the excluded dates.
To find out the Ids of the existing calendars in your tenant, make a GET request to the /odata/Calendars endpoint first.
Identify the desired calendar and copy the Id value from the response body.

GET

/odata/Jobs/UiPath.Server.Configuration.OData.StartJobs

Request headers

Key

Value

Authorization

Bearer

Response code

200 OK

Response body

{
    "@odata.context": "/odata/$metadata#Calendars",
    "value": [
        {
            "TimeZoneId": null,
            "ExcludedDates": [],
            "Name": "November_excluded_dates",
            "Id": 1461
        }
    ]
}{
    "@odata.context": "/odata/$metadata#Calendars",
    "value": [
        {
            "TimeZoneId": null,
            "ExcludedDates": [],
            "Name": "November_excluded_dates",
            "Id": 1461
        }
    ]
}
To see the excluded dates, make a GET request to the /odata/Calendars({calendar_id_value}).
Replace {calendar_id_value} with the previously copied Id value.

The response body returns all the dates that have been excluded in the specified calendar.

For example, for the calendar with the ID value of 1461, the request looks like below:

GET

/odata/Calendars(1461)

Request headers

Key

Value

Authorization

Bearer

Response code

200 OK

Response body

{
    "@odata.context": "/odata/$metadata#Calendars/$entity",
    "TimeZoneId": "UTC",
    "ExcludedDates": [
        "2021-11-01T00:00:00Z",
        "2021-11-04T00:00:00Z",
        "2021-11-08T00:00:00Z",
        "2021-11-11T00:00:00Z",
        "2021-11-15T00:00:00Z",
        "2021-11-18T00:00:00Z",
        "2021-11-22T00:00:00Z",
        "2021-11-25T00:00:00Z"
    ],
    "Name": "November_excluded_dates",
    "Id": 1461
}{
    "@odata.context": "/odata/$metadata#Calendars/$entity",
    "TimeZoneId": "UTC",
    "ExcludedDates": [
        "2021-11-01T00:00:00Z",
        "2021-11-04T00:00:00Z",
        "2021-11-08T00:00:00Z",
        "2021-11-11T00:00:00Z",
        "2021-11-15T00:00:00Z",
        "2021-11-18T00:00:00Z",
        "2021-11-22T00:00:00Z",
        "2021-11-25T00:00:00Z"
    ],
    "Name": "November_excluded_dates",
    "Id": 1461
}

Was this page helpful?

Get The Help You Need
Learning RPA - Automation Courses
UiPath Community Forum
Uipath Logo White
Trust and Security
© 2005-2024 UiPath. All rights reserved.