Skip to main content
Skip table of contents

Update Calendar

Overview

PUT /rest/calendar/{calendarId}

This endpoint is used to update the details of the calendar with the specified ID.

See https://www.joda.org/joda-time/timezones.html for accepted time zone names.

Required Permissions

  • Admin can update the details of the calendar with the specified ID.

Request

JSON
PUT <service_url>/rest/calendar/{calendarId}

Parameters

Parameter

Type

Description

Required

calendarId

Integer

The ID of the calendar you want to update.

Yes

Request Body

The request body must be a JSON object with the following structure:

JSON
{
  "name": String, // The name of the calendar
  "timeZone": String, // The time zone of the calendar, serialized using DateTimeZoneSerializer
  "holidays": [
    {
      "name": String, // The name of the holiday
      "date": String, // The date of the holiday
      "recurring": Boolean // Indicates if the holiday is recurring
    }
  ],
  "workingTimes": [
    {
      "weekday": String, // The day of the week
      "start": Long, // The start time in milliseconds
      "end": Long // The end time in milliseconds
    }
  ]
}

Example Request Body

JSON
{
    "name": "Calendar 2",
    "timeZone": "Europe/Istanbul",
    "workingTimes": [
        {
            "weekday": "MONDAY",
            "start": 28800000,
            "end": 61200000
        },
        {
            "weekday": "MONDAY",
            "start": 75600000,
            "end": 82800000
        }
    ],
    "holidays": [
        {
            "name": "Holiday 1",
            "date": "2025-04-28",
            "recurring": true
        }
    ]
}

Example Requests

CODE
PUT https://tis.obss.io/rest/calendar/3

Response

Response Structure

CODE
{
  "id": Integer, // The unique identifier of the calendar
  "name": String, // The name of the calendar
  "clientKey": String, // The client key associated with the calendar
  "isDefault": Boolean, // Indicates if this is the default calendar
  "is7x24Calendar": Boolean, // Indicates if the calendar operates 24/7
  "allWorkingDaysHaveEqualLengths": Boolean, // Indicates if all working days have equal lengths
  "calendarSuccessfullyLoaded": Boolean, // Indicates if the calendar was successfully loaded
  "dailyWorkingHours": Double, // The number of working hours per day
  "timeZone": String, // The time zone of the calendar
  "workingTimes": [
    {
      "weekday": String, // The day of the week
      "start": Long, // The start time in milliseconds
      "end": Long // The end time in milliseconds
    }
  ],
  "holidays": [
    {
      "name": String, // The name of the holiday
      "date": String, // The date of the holiday
      "recurring": Boolean // Indicates if the holiday is recurring
    }
  ]
}

Example Response Body

JSON
{
  "clientKey": "ffa2107c-c816-3aa3-985a-0163faa27103",
  "id": 3,
  "isDefault": false,
  "name": "Calendar 2",
  "timeZone": "Europe/Istanbul",
  "workingTimes": [
    {
      "weekday": "MONDAY",
      "start": 28800000,
      "end": 61200000
    },
    {
      "weekday": "MONDAY",
      "start": 75600000,
      "end": 82800000
    }
  ],
  "holidays": [
    {
      "name": "Holiday 1",
      "date": "2025-04-28",
      "recurring": true
    }
  ],
  "is7x24Calendar": false,
  "allWorkingDaysHaveEqualLengths": true,
  "calendarSuccessfullyLoaded": true,
  "dailyWorkingHours": 11.0
}

Response Codes

  • 200 OK: Returns the updated calendar object.

  • 400 Bad Request: If the request body is invalid.

  • 404 Not Found: If the requested calendar does not exist.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.