Table of contents
Schedules
Download API definition:
This API is a Technical Preview and is available for testing purposes only. Do not use in production.
GET https://dev-api.bentley.com/schedules/{scheduleId}/calendars[?$top][&$continuationToken]

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

Name
Required?
Description
scheduleId
Yes

The unique identifier of the Schedule.

$top
No

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.

$continuationToken
No

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

Name
Required?
Description
If-None-Match
No

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.

Authorization
Yes

OAuth access token with itwin-platform scope

Accept
Yes

Setting to application/vnd.bentley.itwin-platform.v1+json is recommended.

Response 200 OK

OK

json
{
    "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

Name
Description
Continuation-Token

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.

ETag

A header that identifies a specific version of a resource or resource collection. For more information see the official documentation.

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.

json
{
    "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.

json
{
    "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).

json
{
    "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.

json
{
    "error": {
        "code": "RateLimitExceeded",
        "message": "The client sent more requests than allowed by this API for the current tier of the client."
    }
}

Response headers

Name
Description
retry-after

Number of seconds to wait until client is allowed to make more requests.

Calendar

Representation of a Calendar.

Name
Type
Description
dayTypes

The Day Types that are used in the Calendar.

exceptions

A list of exceptions in the usual working schedule.

id
String

The unique identifier of the Calendar.

name
String, null

The name of the Calendar.

parentId
String, null

The unique identifier of the parent Calendar.

week

The Day Types of each week day in the Calendar.

workingDaysPerWeek
Int32, null

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.

workingSecondsPerDay
Int32, null

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.

Calendar Day Type

Representation of a Calendar Day Type.

Name
Type
Description
color
String

The color in which the Calendar Day Type will be displayed.

description
String, null

The description of the Calendar Day Type.

id
String

The unique identifier of the Calendar Day Type.

timeBlocks
TimeBlock[], null

List of time periods that specify work hours.

type

Value specifying whether the Day Type is a work day or not.

Calendar Exception

An exception in the usual working schedule.

Name
Type
Description
date
Date

The date on which the exception occurs.

dayTypeId
String

The unique identifier of the Calendar Day Type, which will override the usual Calendar Day Type for the specified date.

Calendar Week

The Calendar Day Types for each day of the week.

Name
Type
Description
fridayDayTypeId
String

The unique identifier of the Calendar Day Type, that occurs on Fridays.

mondayDayTypeId
String

The unique identifier of the Calendar Day Type, that occurs on Mondays.

saturdayDayTypeId
String

The unique identifier of the Calendar Day Type, that occurs on Saturdays.

sundayDayTypeId
String

The unique identifier of the Calendar Day Type, that occurs on Sundays.

thursdayDayTypeId
String

The unique identifier of the Calendar Day Type, that occurs on Thursdays.

tuesdayDayTypeId
String

The unique identifier of the Calendar Day Type, that occurs on Tuesdays.

wednesdayDayTypeId
String

The unique identifier of the Calendar Day Type, that occurs on Wednesdays.

Calendars Response

List of Calendars.

Name
Type
Description
calendars
Calendar[], null
_links

Contains the hyperlinks to the current and next pages of results.

Day Type

The type of day. Describes if the day is a work day or not.

Name
Type
Description
Normal
String
NonWorking
String
Partial
String
Unknown
String

Link

Hyperlink container.

Name
Type
Description
href
String

Hyperlink to the specific entity.

Paging Links

URLs for redoing the current request and/or getting the next page of results if applicable.

Name
Type
Description
self

Relative URL for redoing the current request.

next
Link, null

Relative URL for getting the next page of results.

Time Block

A block of time.

Name
Type
Description
endTime
String, null

End time of the Time Block. This value will be in the range [00:01, 24:00].

startTime
String, null

Start time of the Time Block. This value will be in the range [00:00, 23:59].

DetailedError

Contains error information and an array of more specific errors.

Name
Type
Description
code
String

One of a server-defined set of error codes.

message
String

A human-readable representation of the error.

target
String, null

The target of the error.

details

Optional array of more specific errors.

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.

Name
Type
Description
error

Error Detailed information.

Error

Contains error information.

Name
Type
Description
code
String

One of a server-defined set of error codes.

message
String

A human-readable representation of the error.

target
String, null

The target of the error.

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.

Name
Type
Description
error

Error information.

Was this page helpful?