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/{calendarId}

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

Name
Required?
Description
calendarId
Yes

The unique identifier of the Calendar.

scheduleId
Yes

The unique identifier of the Schedule.

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

Name
Description
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 Calendar or Schedule is not available.

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

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 Response

Container for Calendar object.

Name
Type
Description
calendar

Calendar properties.

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.

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

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].

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?