Gets all Calendars of a Schedule.
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 Schedule.
The $top system query option requests the number of items in the queried collection to be included in the result. When $top parameter is not provided default is set to 100. $top value cannot exceed 10000.
A token used for pagination to retrieve the next set of results. It indicates where the previous page of results ended, allowing you to fetch the subsequent batch of data.
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
{ "calendars": [{ "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 }, { "dayTypes": [{ "color": "#808080", "description": "Non-Working Day", "id": "7efb7313-9ffa-4574-a103-2b44166a7bf7", "timeBlocks": [], "type": "NonWorking" }, { "color": "#0000FF", "description": "Short Work Day", "id": "693a540f-0fe5-4388-8b78-3b3e2b6c8a21", "timeBlocks": [{ "endTime": "10:00", "startTime": "09:00" }, { "endTime": "13:00", "startTime": "12:00" } ], "type": "Normal" } ], "exceptions": [{ "date": "2024-10-09", "dayTypeId": "7efb7313-9ffa-4574-a103-2b44166a7bf7" }], "id": "9b8f65fa-494a-417a-aecb-bdd0a5e3994e", "name": "Standard", "parentId": "39d8d672-1c35-4d48-a78b-49156203bede", "week": { "fridayDayTypeId": "693a540f-0fe5-4388-8b78-3b3e2b6c8a21", "mondayDayTypeId": "693a540f-0fe5-4388-8b78-3b3e2b6c8a21", "saturdayDayTypeId": "693a540f-0fe5-4388-8b78-3b3e2b6c8a21", "sundayDayTypeId": "693a540f-0fe5-4388-8b78-3b3e2b6c8a21", "thursdayDayTypeId": "693a540f-0fe5-4388-8b78-3b3e2b6c8a21", "tuesdayDayTypeId": "693a540f-0fe5-4388-8b78-3b3e2b6c8a21", "wednesdayDayTypeId": "693a540f-0fe5-4388-8b78-3b3e2b6c8a21" }, "workingDaysPerWeek": 7, "workingSecondsPerDay": 7200 } ], "_links": { "self": { "href": "https://api.bentley.com/schedules/5e11b21e-cba2-48a8-a2c1-2977d2d373e0/calendars?$top=2" }, "next": { "href": "https://api.bentley.com/schedules/5e11b21e-cba2-48a8-a2c1-2977d2d373e0/calendars?$top=2&$continuationToken=eyJQcmltYXJ5U2tpcFRva2VuIjoiMDAwNGE5MDAtM2UxYy00NGNlLThhMzktYWUxZWRlY2M1MWY0IiwiU2Vjb25kYXJ5U2tpcFRva2VuIjpudWxsfQ%3d%3d" } } }
Response headers
A token used for pagination to retrieve the next set of results. It indicates where the previous page of results ended, allowing you to fetch the subsequent batch of data.
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 Schedule is not available.
{ "error": { "code": "ScheduleNotFound", "message": "Requested Schedule is not available.", "target": "scheduleId" } }
Response 422 Unprocessable Entity
The 422 (Unprocessable Entity) status code indicates that the request cannot be processed by the server due to a client error (e.g. malformed request syntax).
{ "error": { "code": "InvalidSchedulesRequest", "details": [{ "code": "InvalidValue", "message": "Top value is not positive, or exceeds maximum page size.", "target": "$top" }, { "code": "InvalidValue", "message": "Provided continuation token is invalid.", "target": "$continuationToken" } ], "message": "The request contains invalid properties." } }
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 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." }
Calendars Response
List of Calendars.
{ "title": "Calendars Response", "type": "object", "properties": { "calendars": { "type": "array", "items": { "$ref": "#/components/schemas/Calendar", "description": "A list of Calendars." }, "nullable": true }, "_links": { "$ref": "#/components/schemas/PagingLinks", "description": "Contains the hyperlinks to the current and next pages of results." } }, "additionalProperties": false, "description": "List of Calendars." }
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." }
Link
Hyperlink container.
Hyperlink to the specific entity.
{ "type": "object", "properties": { "href": { "type": "string", "description": "Hyperlink to the specific entity." } }, "additionalProperties": false, "description": "Hyperlink container." }
Paging Links
URLs for redoing the current request and/or getting the next page of results if applicable.
{ "title": "Paging Links", "type": "object", "properties": { "self": { "$ref": "#/components/schemas/Link", "description": "Relative URL for redoing the current request." }, "next": { "$ref": "#/components/schemas/Link", "description": "Relative URL for getting the next page of results.", "nullable": true } }, "additionalProperties": false, "description": "URLs for redoing the current request and/or getting the next page of results if applicable." }
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." }
DetailedError
Contains error information and an array of more specific errors.
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 and an array of more specific errors.", "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 }, "details": { "type": "array", "description": "Optional array of more specific errors.", "items": { "$ref": "#/components/schemas/Error" } } }, "required": [ "code", "message", "details" ], "additionalProperties": true }
Detailed 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": "Detailed 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 Detailed information.", "$ref": "#/components/schemas/DetailedError" } }, "required": [ "error" ], "additionalProperties": false }
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?