Gets the details of a Calendar.
Authentication
Requires Authorization
header with valid Bearer token for scope itwin-platform
.
For more documentation on authorization and how to get access token visit OAUTH2 Authorization page.
Rate limits
All iTwin Platform API operations have a rate limit. For more documentation on that visit Rate limits and quotas page.
Request parameters
The unique identifier of the Calendar.
The unique identifier of the Schedule.
Request headers
A header that makes the request conditional. If the ETag of the requested resource or resource collection matches the provided value, a 304 (Not Modified) response is returned. For more information see the official documentation.
OAuth access token with itwin-platform
scope
Setting to application/vnd.bentley.itwin-platform.v1+json
is recommended.
Response 200 OK
OK
{ "calendar": { "dayTypes": [{ "color": "#808080", "description": "Non-Working Day", "id": "7efb7313-9ffa-4574-a103-2b44166a7bf7", "timeBlocks": [], "type": "NonWorking" }, { "color": "#d4d0c8", "description": "Normal Working Day", "id": "f98dcc19-e475-4fff-af1d-eb6d19c7660c", "timeBlocks": [{ "endTime": "17:00", "startTime": "09:00" }], "type": "Normal" } ], "exceptions": [], "id": "1e6717b6-e37a-4046-a86e-d5dc457a2de6", "name": "Standard", "parentId": null, "week": { "fridayDayTypeId": "f98dcc19-e475-4fff-af1d-eb6d19c7660c", "mondayDayTypeId": "f98dcc19-e475-4fff-af1d-eb6d19c7660c", "saturdayDayTypeId": "7efb7313-9ffa-4574-a103-2b44166a7bf7", "sundayDayTypeId": "7efb7313-9ffa-4574-a103-2b44166a7bf7", "thursdayDayTypeId": "f98dcc19-e475-4fff-af1d-eb6d19c7660c", "tuesdayDayTypeId": "f98dcc19-e475-4fff-af1d-eb6d19c7660c", "wednesdayDayTypeId": "f98dcc19-e475-4fff-af1d-eb6d19c7660c" }, "workingDaysPerWeek": 5, "workingSecondsPerDay": 28800 } }
Response headers
A header that identifies a specific version of a resource or resource collection. For more information see the official documentation.
Response 304 Not Modified
Not Modified
Response 401 Unauthorized
This response indicates that request lacks valid authentication credentials. Access token might not been provided, issued by the wrong issuer, does not have required scopes or request headers were malformed.
{ "error": { "code": "HeaderNotFound", "message": "Header Authorization was not found in the request. Access denied." } }
Response 404 Not Found
This response indicates that the provided Calendar or Schedule is not available.
{ "error": { "code": "CalendarNotFound", "message": "Requested Calendar is not available.", "target": "calendarId" } }
Response 429 Too many requests
This response indicates that the client sent more requests than allowed by this API for the current tier of the client.
{ "error": { "code": "RateLimitExceeded", "message": "The client sent more requests than allowed by this API for the current tier of the client." } }
Response headers
Number of seconds to wait until client is allowed to make more requests.
Calendar
Representation of a Calendar.
The unique identifier of the Calendar.
The name of the Calendar.
The unique identifier of the parent Calendar.
The number of working days per normal week. This can be used to calculate durations in weeks. Task duration properties are in total seconds, so to convert to weeks calculate as: duration / workingSecondsPerDay / workingDaysPerWeek.
The number of working seconds per normal day. This can be used to calculate durations in days. Task duration properties are in total seconds, so to convert to days calculate as: duration / workingSecondsPerDay.
{ "type": "object", "properties": { "dayTypes": { "type": "array", "items": { "$ref": "#/components/schemas/CalendarDayType" }, "description": "The Day Types that are used in the Calendar.", "nullable": true }, "exceptions": { "type": "array", "items": { "$ref": "#/components/schemas/CalendarException" }, "description": "A list of exceptions in the usual working schedule.", "nullable": true }, "id": { "type": "string", "description": "The unique identifier of the Calendar." }, "name": { "type": "string", "description": "The name of the Calendar.", "nullable": true }, "parentId": { "type": "string", "description": "The unique identifier of the parent Calendar.", "nullable": true }, "week": { "$ref": "#/components/schemas/CalendarWeek", "description": "The Day Types of each week day in the Calendar." }, "workingDaysPerWeek": { "type": "integer", "description": "The number of working days per normal week. This can be used to calculate durations in weeks. Task duration properties are in total seconds, so to convert to weeks calculate as: duration / workingSecondsPerDay / workingDaysPerWeek.", "format": "int32", "nullable": true }, "workingSecondsPerDay": { "type": "integer", "description": "The number of working seconds per normal day. This can be used to calculate durations in days. Task duration properties are in total seconds, so to convert to days calculate as: duration / workingSecondsPerDay.", "format": "int32", "nullable": true } }, "additionalProperties": false, "description": "Representation of a Calendar." }
Calendar Day Type
Representation of a Calendar Day Type.
The color in which the Calendar Day Type will be displayed.
The description of the Calendar Day Type.
The unique identifier of the Calendar Day Type.
{ "title": "Calendar Day Type", "type": "object", "properties": { "color": { "type": "string", "description": "The color in which the Calendar Day Type will be displayed.", "example": "#00FF00" }, "description": { "type": "string", "description": "The description of the Calendar Day Type.", "nullable": true }, "id": { "type": "string", "description": "The unique identifier of the Calendar Day Type." }, "timeBlocks": { "type": "array", "items": { "$ref": "#/components/schemas/TimeBlock" }, "description": "List of time periods that specify work hours.", "nullable": true }, "type": { "$ref": "#/components/schemas/DayType", "description": "Value specifying whether the Day Type is a work day or not." } }, "additionalProperties": false, "description": "Representation of a Calendar Day Type." }
Calendar Exception
An exception in the usual working schedule.
The date on which the exception occurs.
The unique identifier of the Calendar Day Type, which will override the usual Calendar Day Type for the specified date.
{ "title": "Calendar Exception", "type": "object", "properties": { "date": { "type": "string", "description": "The date on which the exception occurs.", "format": "date" }, "dayTypeId": { "type": "string", "description": "The unique identifier of the Calendar Day Type, which will override the usual Calendar Day Type for the specified date." } }, "additionalProperties": false, "description": "An exception in the usual working schedule." }
Calendar Response
Container for Calendar object.
{ "title": "Calendar Response", "type": "object", "properties": { "calendar": { "$ref": "#/components/schemas/Calendar", "description": "Calendar properties." } }, "additionalProperties": false, "description": "Container for Calendar object." }
Calendar Week
The Calendar Day Types for each day of the week.
The unique identifier of the Calendar Day Type, that occurs on Fridays.
The unique identifier of the Calendar Day Type, that occurs on Mondays.
The unique identifier of the Calendar Day Type, that occurs on Saturdays.
The unique identifier of the Calendar Day Type, that occurs on Sundays.
The unique identifier of the Calendar Day Type, that occurs on Thursdays.
The unique identifier of the Calendar Day Type, that occurs on Tuesdays.
The unique identifier of the Calendar Day Type, that occurs on Wednesdays.
{ "title": "Calendar Week", "type": "object", "properties": { "fridayDayTypeId": { "type": "string", "description": "The unique identifier of the Calendar Day Type, that occurs on Fridays." }, "mondayDayTypeId": { "type": "string", "description": "The unique identifier of the Calendar Day Type, that occurs on Mondays." }, "saturdayDayTypeId": { "type": "string", "description": "The unique identifier of the Calendar Day Type, that occurs on Saturdays." }, "sundayDayTypeId": { "type": "string", "description": "The unique identifier of the Calendar Day Type, that occurs on Sundays." }, "thursdayDayTypeId": { "type": "string", "description": "The unique identifier of the Calendar Day Type, that occurs on Thursdays." }, "tuesdayDayTypeId": { "type": "string", "description": "The unique identifier of the Calendar Day Type, that occurs on Tuesdays." }, "wednesdayDayTypeId": { "type": "string", "description": "The unique identifier of the Calendar Day Type, that occurs on Wednesdays." } }, "additionalProperties": false, "description": "The Calendar Day Types for each day of the week." }
Day Type
The type of day. Describes if the day is a work day or not.
{ "title": "Day Type", "enum": [ "Normal", "NonWorking", "Partial", "Unknown" ], "type": "string", "description": "The type of day. Describes if the day is a work day or not." }
Time Block
A block of time.
End time of the Time Block. This value will be in the range [00:01, 24:00].
Start time of the Time Block. This value will be in the range [00:00, 23:59].
{ "title": "Time Block", "type": "object", "properties": { "endTime": { "type": "string", "description": "End time of the Time Block. This value will be in the range [00:01, 24:00].", "nullable": true }, "startTime": { "type": "string", "description": "Start time of the Time Block. This value will be in the range [00:00, 23:59].", "nullable": true } }, "additionalProperties": false, "description": "A block of time." }
Error
Contains error information.
One of a server-defined set of error codes.
A human-readable representation of the error.
The target of the error.
{ "type": "object", "description": "Contains error information.", "properties": { "code": { "type": "string", "description": "One of a server-defined set of error codes." }, "message": { "type": "string", "description": "A human-readable representation of the error." }, "target": { "type": "string", "description": "The target of the error.", "nullable": true } }, "required": [ "code", "message" ], "additionalProperties": true }
Error Response
Gives details for an error that occurred while handling the request. Note that clients MUST NOT assume that every failed request will produce an object of this schema, or that all of the properties in the response will be non-null, as the error may have prevented this response from being constructed.
{ "type": "object", "title": "Error Response", "description": "Gives details for an error that occurred while handling the request. Note that clients MUST NOT assume that every failed request will produce an object of this schema, or that all of the properties in the response will be non-null, as the error may have prevented this response from being constructed.", "properties": { "error": { "description": "Error information.", "$ref": "#/components/schemas/Error" } }, "required": [ "error" ], "additionalProperties": false }
Was this page helpful?