POST api/Calendar/UpdateCalendar

Updates a resource calendar. Use this method to extend a calendar or to change existing entries.

Exceptions

ExceptionCondition
UnauthorizedAccessException

May be thrown if you do do not have access to calendar

ArgumentNullHttpResponseException

May be thrown if you do not specify the resource id or any other required properties

ArgumentOutOfRangeHttpResponseException

May be thrown if you for example specify a period that is outside the calendar defintion, if the resource does not exists or if the resource does not have a calendar

Examples

The example shows how to change the 1st of May from 8-16 to 10-18.


{
  "CalendarItems": [
    {      
      "AttributeAction": 1,
      "AttributeType": 14,
      "AttributeData": {
         "From": "2018-05-01T08:00:00",
         "To": "2018-05-01T16:00:00",
         "Id": "15eecf03-ad09-4900-897e-9a3e11a9a706"
    }
    }
  ],
  "ResourceId": "hkfch@infocare.org",
  "TicketId": "8d9e7eb3-3e23-443d-bb38-ced65c88e168",
  "Culture": "no"
}
The reply is kind of intersting as it shows that the server actually deletes the period you changed and added a new one using the new time

{
"CalendarItems": [
    {
      "AttributeName": null,
      "AttributeAction": 2,
      "AttributeType": 14,
      "AttributeData": {
        "From": "2018-05-01T08:00:00",
        "To": "2018-05-01T16:00:00",
        "ItemType": 0,
        "Id": "15eecf03-ad09-4900-897e-9a3e11a9a706"
    }
    },
    {
      "AttributeName": null,
      "AttributeAction": 0,
      "AttributeType": 14,
      "AttributeData": {
        "From": "2018-05-01T08:00:00",
        "To": "2018-05-01T16:00:00",
        "ItemType": 0,
        "Id": "7ecafd94-316d-49c2-b3b3-b06874eab167"
    }
  }
],
"From": "2018-05-01T08:00:00",
"To": "2018-05-01T16:00:00",
"CombinedPerformanceId": "sesam10:11b1ca0e-d26b-4fea-a021-f7df8e7da29b"
}

Request Information

URI Parameters

None.

Body Parameters

Specify the resource and the periods you want to add, modify or delete by using the CalendarItems array

CalendarArgumentModel
NameDescriptionTypeAdditional information
ResourceId

Get or sets resource id, this property must be set. You must also have access to this user.

string

None.

From

Get or set from date, if not set we will use the current day

date

None.

To

Get or set the to date, if not set we will use current day pluss one month

date

None.

TicketId

Gets or sets the ticket id

string

None.

Culture

Gets or sets culture, if not specified we will use culture set on user.

string

None.

CalendarItems

Gets or sets the periods

Collection of AttributeUpdateModel

None.

Request Formats

application/json, text/json

Sample:
{
  "CalendarItems": [
    {
      "AttributeName": "sample string 1",
      "AttributeAction": 0,
      "AttributeType": 0,
      "AttributeTransaction": "sample string 2",
      "AttributeData": {}
    },
    {
      "AttributeName": "sample string 1",
      "AttributeAction": 0,
      "AttributeType": 0,
      "AttributeTransaction": "sample string 2",
      "AttributeData": {}
    }
  ],
  "ResourceId": "sample string 1",
  "From": "2026-11-11T20:26:44.6489234+01:00",
  "To": "2026-11-11T20:26:44.6489234+01:00",
  "TicketId": "sample string 2",
  "Culture": "sample string 3"
}

application/xml, text/xml

Sample:
<CalendarArgumentModel xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Rostov.Models">
  <Culture>sample string 3</Culture>
  <TicketId>sample string 2</TicketId>
  <CalendarItems>
    <AttributeUpdateModel>
      <AttributeAction>Add</AttributeAction>
      <AttributeData />
      <AttributeName>sample string 1</AttributeName>
      <AttributeTransaction>sample string 2</AttributeTransaction>
      <AttributeType>Field</AttributeType>
    </AttributeUpdateModel>
    <AttributeUpdateModel>
      <AttributeAction>Add</AttributeAction>
      <AttributeData />
      <AttributeName>sample string 1</AttributeName>
      <AttributeTransaction>sample string 2</AttributeTransaction>
      <AttributeType>Field</AttributeType>
    </AttributeUpdateModel>
  </CalendarItems>
  <From>2026-11-11T20:26:44.6489234+01:00</From>
  <ResourceId>sample string 1</ResourceId>
  <To>2026-11-11T20:26:44.6489234+01:00</To>
</CalendarArgumentModel>

application/x-www-form-urlencoded

Sample:

Failed to generate the sample for media type 'application/x-www-form-urlencoded'. Cannot use formatter 'JQueryMvcFormUrlEncodedFormatter' to write type 'CalendarArgumentModel'.

Response Information

Resource Description

The items you have added, modified or deleted.

CalendarReturnModel
NameDescriptionTypeAdditional information
From

Get or sets the from day

date

None.

To

Gets or sets the to day

date

None.

CombinedPerformanceId

Gets or sets the performance id. If performance monitoring is not turned on this property will not be present or set to null

string

Json null value handling: Ignore

CalendarItems

Gets or sets the periods

Collection of AttributeUpdateModel

None.

Response Formats

application/json, text/json

Sample:
{
  "CalendarItems": [
    {
      "AttributeName": "sample string 1",
      "AttributeAction": 0,
      "AttributeType": 0,
      "AttributeTransaction": "sample string 2",
      "AttributeData": {}
    },
    {
      "AttributeName": "sample string 1",
      "AttributeAction": 0,
      "AttributeType": 0,
      "AttributeTransaction": "sample string 2",
      "AttributeData": {}
    }
  ],
  "From": "2026-11-11T20:26:44.6525216+01:00",
  "To": "2026-11-11T20:26:44.6525216+01:00",
  "CombinedPerformanceId": "sample string 3"
}

application/xml, text/xml

Sample:
<CalendarReturnModel xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Rostov.Models">
  <CombinedPerformanceId>sample string 3</CombinedPerformanceId>
  <CalendarItems>
    <AttributeUpdateModel>
      <AttributeAction>Add</AttributeAction>
      <AttributeData />
      <AttributeName>sample string 1</AttributeName>
      <AttributeTransaction>sample string 2</AttributeTransaction>
      <AttributeType>Field</AttributeType>
    </AttributeUpdateModel>
    <AttributeUpdateModel>
      <AttributeAction>Add</AttributeAction>
      <AttributeData />
      <AttributeName>sample string 1</AttributeName>
      <AttributeTransaction>sample string 2</AttributeTransaction>
      <AttributeType>Field</AttributeType>
    </AttributeUpdateModel>
  </CalendarItems>
  <From>2026-11-11T20:26:44.6525216+01:00</From>
  <To>2026-11-11T20:26:44.6525216+01:00</To>
</CalendarReturnModel>