Please rate how useful you found this document: 
Average: 3 (2 votes)

Calendars

The following REST endpoints are available to manage calendars in ProcessMaker.

Permissions:

These endpoints need the following permission:

Permission Needed
PM_SETUP_CALENDAR

Calendar:

Name Description Type Value
cal_uid Calendar UID String "9541049475298f190420f51086854718" String of 32 characters
cal_name Calendar name String "Default calendar"
cal_description Calendar description String "Description"
cal_work_days Work days Array [1, 2, 3, 4, 5, 6, 7]
cal_status Status String "ACTIVE", "INACTIVE" (Unique values)
cal_work_hour Work hours object Object array
cal_work_hour . day Day Integer 0, 1, 2, 3, 4, 5, 6, 7 (Unique values) 0: All, 1: Monday, 2: Tuesday, 3: Wednesday, 4: Thursday, 5: Friday, 6: Saturday, 7: Sunday
cal_work_hour . hour_start Start hour String "00:00"
cal_work_hour . hour_end End hour String "23:59"
cal_holiday Holidays Object Object array
cal_holiday . name Holiday name String "Name"
cal_holiday . date_start Holiday start date String "2014-04-01"
cal_holiday . date_end Holiday end date String "2014-04-01"
cal_create_date Creation date (According to setting in "Global Date Format") Datetime "2012-10-22 14:51:11"
cal_update_date Update date (According to setting in "Global Date Format") Datetime "2012-10-22 14:51:11"
cal_total_users Total number of users according to the calendar Integer 0,1,...
cal_total_processes Total number of processes according to the calendar Integer 0,1,...
cal_total_tasks Total number of tasks according to the calendar Integer 0,1,...
filter Search filter String "abc"
start Indicates the initial position of the records returned Integer 0,1,...
limit Restricts the number of records returned Integer 25,...


Available methods:

Get Calendar List: GET /calendars

Get a list of calendars in the workspace.

Permission:

Users must have the PM_SETUP_CALENDAR permission assigned to their role to be able to access the endpoint information.

Structure:

GET /api/1.0/{workspace}/calendars?filter={filter}&start={start}&limit={limit}

URL Parameters:

Name Type Description
workspace String Workspace name

Optional Parameters:

Name Type Description
filter String Search filter
start Integer Indicates the initial position of the records returned
limit Integer Restricts the number of records returned

Result:

Type Description
array Returns an array of objects with each calendar

Example:
Response

 200 (OK)
 [
    {
      "cal_uid": "00000000000000000000000000000001",
      "cal_name": "Default Calendar",
      "cal_description": "Default",
      "cal_work_days": {"1": "Monday", "2": "Tuesday", "3": "Wednesday", "4": "Thursday"},
      "cal_status": "ACTIVE",
      "cal_work_hour":
      [
             {"day": 0, "hour_start": "00:00", "hour_end": "00:00"}
      ],
      "cal_holiday":
      [
             {"name": "h1", "date_start": "2014-04-02", "date_end": "2014-04-04"}
      ],
      "cal_create_date": "01/04/2014",
      "cal_update_date": "07/04/2014",
      "cal_total_users": 0,
      "cal_total_processes": 0,
      "cal_total_tasks": 0
    },
    {
      "cal_uid": "86431145652efa6f2413d29045495711",
      "cal_name": "My calendar Demo",
      "cal_description": "Default",
      "cal_work_days": {"5": "Friday", "6": "Saturday", "7": "Sunday"},
      "cal_status": "INACTIVE",
      "cal_work_hour":
      [
             {"day": 0, "hour_start": "00:00", "hour_end": "00:00"},
             {"day": 7, "hour_start": "09:00", "hour_end": "17:00"}
      ],
      "cal_holiday":
      [
            {"name": "holiday1", "date_start": "2010-01-01", "date_end": "2010-01-10"},
            {"name": "holiday2", "date_start": "2014-04-01", "date_end": "2014-04-04"}
      ],
      "cal_create_date": "01/04/2014",
      "cal_update_date": "09/04/2014",
      "cal_total_users": 0,
      "cal_total_processes": 1,
      "cal_total_tasks": 0
    }
 ]

Get Calendar Information: GET /calendar/{cal_uid}

Get information about a specified calendar.

Permission:

Users must have the PM_SETUP_CALENDAR permission assigned to their role to be able to access the endpoint information.

Structure:

GET /api/1.0/{workspace}/calendar/{cal_uid}

Parameters

Name Type Description
workspace String Workspace name
cal_uid String Calendar UID

Result

Type Description
object Returns an object with data of the calendar

Response

 200 (OK)
 {
     "cal_uid": "86431145652efa6f2413d29045495711",
     "cal_name": "My calendar Demo",
     "cal_description": "Default",
     "cal_work_days":
     {
      "5": "Friday",
      "6": "Saturday",
      "7": "Sunday"
     },
     "cal_status": "INACTIVE",
     "cal_work_hour":
     [
      {"day": 0, "hour_start": "00:00", "hour_end": "00:00"},
        {"day": 7, "hour_start": "09:00", "hour_end": "17:00"}
     ],
     "cal_holiday":
     [
      {"name": "holiday1", "date_start": "2010-01-01", "date_end": "2010-01-10"},
      {"name": "holiday2", "date_start": "2014-04-01", "date_end": "2014-04-04"}
     ],
     "cal_create_date": "01/04/2014",
     "cal_update_date": "09/04/2014",
     "cal_total_users": 0,
     "cal_total_processes": 1,
     "cal_total_tasks": 0
 }

Create Calendar: POST /calendar

Create a new calendar.

Permission:

Users must have the PM_SETUP_CALENDAR permission assigned to their role to be able to access the endpoint information.

Structure:

POST /api/1.0/{workspace}/calendar

URL Parameters:

Name Type Description
workspace String Workspace name

POST Fields:

Name Type Description
cal_name String Calendar name
cal_work_days Array Work days

Optional POST Fields:

Name Type Description
cal_description Description String
cal_status String Calendar status
cal_work_hour Object Work hours
cal_work_hour . day Integer Calendar days
cal_work_hour . hour_start String Start hour
cal_work_hour . hour_end String End hour
cal_holiday Object Holidays
cal_holiday . name String Holiday name
cal_holiday . date_start String Holiday start date
cal_holiday . date_end String Holiday end date
cal_create_date Datetime Calendar creation date
cal_update_date Datetime Calendar update date
cal_total_users Integer Total number of users registered according to the calendar
cal_total_processes Integer Total number of processes according to the calendar
cal_total_tasks Integer Total number of tasks according to the calendar

Result:

Type Description
object Returns an object with the new calendar data plus the cal_uid attribute

Example:
Request

 Content-Type: application/json
 {
     "cal_name": "My calendar Demo",
     "cal_description": "Default",
     "cal_work_days": [5, 6, 7],
     "cal_work_hour":
        [
           {"day": 0, "hour_start": "00:00", "hour_end": "00:00"},
           {"day": 7, "hour_start": "09:00", "hour_end": "17:00"}
        ],
     "cal_holiday":
        [
           {"name": "holiday1", "date_start": "2010-01-01", "date_end": "2010-01-10"},
           {"name": "holiday2", "date_start": "2014-04-01", "date_end": "2014-04-04"}
        ]
 }

Response

 200 (OK)
 {
     "cal_uid": "86431145652efa6f2413d29045495711",
     "cal_name": "My calendar Demo",
     "cal_description": "Default",
     "cal_work_days": [5, 6, 7],
     "cal_work_hour":
        [
           {"day": 0, "hour_start": "00:00", "hour_end": "00:00"},
           {"day": 7, "hour_start": "09:00", "hour_end": "17:00"}
        ],
     "cal_holiday":
        [
           {"name": "holiday1", "date_start": "2010-01-01", "date_end": "2010-01-10"},
           {"name": "holiday2", "date_start": "2014-04-01", "date_end": "2014-04-04"}
        ]
 }

Update Calendar: PUT /calendar/{cal_uid}

Update an existing calendar.

Permission:

Users must have the PM_SETUP_CALENDAR permission assigned to their role to perform this action.

Structure:

PUT /api/1.0/{workspace}/calendar/{cal_uid}

URL Parameters:

Name Type Description
workspace String Workspace name
cal_uid String Calendar UID

Optional Fields:

Name Type Description
cal_name String Calendar name
cal_work_days Array Work days
cal_description Description String
cal_status String Calendar status
cal_work_hour Object Work hours
cal_work_hour . day Integer Calendar days
cal_work_hour . hour_start String Start hour
cal_work_hour . hour_end String End hour
cal_holiday Object Holidays
cal_holiday . name String Holiday name
cal_holiday . date_start String Holiday start date
cal_holiday . date_end String Holiday end date
cal_create_date Datetime Calendar creation date
cal_update_date Datetime Calendar update date
cal_total_users Integer Total number of users registered according to the calendar
cal_total_processes Integer Total number of processes according to the calendar
cal_total_tasks Integer Total number of tasks according to the calendar

Result:

Type Description
empty No result

Example:
Request

 Content-Type: application/json
 {
    "cal_name": "My calendar Demo",
    "cal_description": "Default",
    "cal_work_days": [5, 6, 7],
    "cal_status": "INACTIVE",
    "cal_work_hour": [
      {"day": 0, "hour_start": "00:00", "hour_end": "00:00"},
      {"day": 7, "hour_start": "09:00", "hour_end": "17:00"}
    ],
    "cal_holiday": [
      {"name": "holiday1", "date_start": "2010-01-01", "date_end": "2010-01-10"},
      {"name": "holiday2", "date_start": "2014-04-01", "date_end": "2014-04-04"}
    ]
 }

Response

 200 (OK)

Delete Calendar: DELETE /calendar/{cal_uid}

Delete a calendar.

Permission:

Users must have the PM_SETUP_CALENDAR permission assigned to their role to perform this action.

Structure:

DELETE /api/1.0/{workspace}/calendar/{cal_uid}

URL Parameters:

Name Type Description
workspace String Workspace name
cal_uid String Calendar UID

Result:

Type Description
empty No return

Example:
Response:

 200 (OK)