CalendarSet

Prev Next

CalendarSet

/v1/calendarset

Example for calling:

http://server/v1/CalendarSet?id=2094 - retrieves all Calendars from a calendar set with CalendarSet id 2094

http://server/v1/CalendarSet?network_id=94 - retrieves Calendars from a calendar set related to a network with network ID 94

http://server/v1/CalendarSet?network_id=94&meta_field_select=CN - retrieves Calendars from a calendar set related to a network with network id 94, including calendars and non-working period details

http://server/v1/CalendarSet?network_id=94&meta_field_select=0 - retrieves Calendars from a calendar set related to a network with network id 94, excluding calendars and non-working period details

http://server/v1/CalendarSet?meta_field_select=0&owner=safran - retrieves all Calendars from a calendar set where the owner is safran, excluding calendars and non-working period details

information16x16 The calendar set id is found in the Project Response Fields as "cal_id".

Allowed Methods:

[GET]
API Controller: CalendarSet

Description:

Lists Calendar set for the supplied calendar set id.


Parameters:

Name Type Description Notes
id integer Calendar Set ID
network_id integer Network ID Mandatory when "SafranWebApiOwnerVerificationDuringApiCalls" is in use
owner string Owner of the calendar set Relates to "SafranWebApiOwnerVerificationDuringApiCalls" in Application Settings
meta_field_select string List of fields to include in the response, see Response Fields Option to decide whether the Calendars and NoneWorkingPeriods elements are to be included in the response fields. If empty or missing, all fields will be included.
0 = Do not include Calendars and NoneWorkingPeriods elements
C = Include Calendars but not NoneWorkingPeriods elements
N = Include NoneWorkingPeriods, this will also force inclusion of Calendars elements.
  • Combining id with network_id is not supported.
  • When "SafranWebApiOwnerVerificationDuringApiCalls" is used, the CalendarSet retrieved can only be linked to projects owned by the same owner as the Calendar Set. Should the CalendarSet be linked to other projects owned by others, the API will return failure.
  • When meta_field_select=0 and the "SafranWebApiOwnerVerificationDuringApiCalls" are in use, the owner is mandatory, but either of the IDs is not.


Response Fields


CalendarSet

Name Type Description
cal_id integer Calendar set ID
cal_name string Calendar set name
cal_start datetime Calenddar set start date
cal_finish datetime Calendar set finish date
owner string Owner (Username)
cal_type string d=days, h=hours, m=minutes
Calendars calendar[] Collection of defined calendar objects


Calendar

Name Type Description
Hours double Work hours per day
Description string Description
Cal_id integer Calenddar set ID
Wpn integer Calendar number
Units_pr_week double Planned work days per week (used for conversion to days when duration is given by weeks)
NonWorkingPeriods NonWorkingPeriod[] Collection of defined NonWorkingPeriod objects

NonWorkingPeriod

Name Type Description
Cal_id int Calenddar set ID
Wpn int Calendar number
Rest_from datetime Rest from date/time
Rest_until datetime Rest until date/time
Day_of_week short Rest day of Week (Available values are 1,2,3,4,5,6,7,8,9)
Rest_from_hrs short Rest from hours
Rest_until_hrs short Rest until hours
Seq int Unique sequence number
Rest_from_min short Rest from minute
Rest_until_min short Rest until minute


Sample Calendar set shown in Safran Project:

API Methods Calendar Sets Window


Calendar Db model overview:

API Methods Calendar DB Model


Calendar API class structure overview:

API Methods Class Structure


Sample JSON
[
  {
    "Cal_id": 2094,
    "Cal_name": "Sample Calendar Set",
    "Cal_start": "2015-01-01T00:00:00",
    "Cal_finish": "2036-12-31T00:00:00",
    "Owner": "SA",
    "Cal_type": "d",
    "Calendars": [
      {
        "Hours": 7.5,
        "Description": "Calendar 0",
        "Cal_id": 2094,
        "Wpn": 0,
        "Units_pr_week": 7,
        "NonWorkingPeriods": [
          {
            "Cal_id": 2094,
            "Wpn": 0,
            "Day_of_week": 6,
            "Rest_from_hrs": 0,
            "Rest_until_hrs": 0,
            "Seq": 712015,
            "Rest_from_min": 0,
            "Rest_until_min": 0 
          },
          {
            "Cal_id": 2094,
            "Wpn": 0,
            "Day_of_week": 7,
            "Rest_from_hrs": 0,
            "Rest_until_hrs": 0,
            "Seq": 712016,
            "Rest_from_min": 0,
            "Rest_until_min": 0 
          }
        ]
      }
    ]
  }
]