Calendar (Appointment)

Resource type: calendar

Reads the database fields from an appointment record.

If you specify the resource ID of the appointment, the data of the appointment is returned.

If no resource ID is specified, the data of the appointments of a specific period can be requested via the parameters datestart and dateend. It will return the appointments of the logged-in user and his groups, when the parameters users and groups arent specified.

The user rights on appointments set in enterprise are respected. When queried by ID, more information is returned in the response.

The maximum number of appointments that can be queried at one time is 500. To avoid this restriction, please query smaller periods of time in which there are less than 500 appointments.

Parameters:

  • datestart
    STRING. Start date of the time interval for the requested appointments, the time part is ignored.
  • dateend
    STRING. End date of the time interval for the the requested appointments, the time part is ignored.
  • showcancelled
    BOOLEAN. Flag if cancelled appointments should be requested.
  • users
    ARRAY. User IDs. Specify here the appointments of which users you want to read out. Works only in combination with the parameters “datestart” and “dateend”.
  • groups
    ARRAY. Group IDs. Specify here the appointments of which groups you want to read out. Works only in combination with the parameters “datestart” and “dateend”.
  • allusers
    BOOLEAN. Flag for reading out all data. If set on true, the parameters users and groups will be ignored. Default: false.
  • filter
    OBJECT. Key: field, value: array of objects with filter expressions in the format "art": [{"op": "=", "val": "Besichtigung"}]. With op you specify the operator. Possible values for op are the following SQL operators:
    is or =, >, <, >=, <=, != or <>, between, like, not like, in, not in

    For the operator like the value % can be specified as a placeholder.

    With val you specify the value which should be applied to the filtering. The individual filter expressions are linked with the AND operation.

    Multiple values for operators like IN are specified in comma separated array notation.
    "art": [{"op": "IN","val": ["Besichtigung","Notartermin"]}],

    The filter works for the fields start_dt (Starting on), end_dt (Ends on), rp_flag (Flag for serial appointment), description (Subject), von (Creator), erledigt (Done), note (Notes), art (Type of appointment).

    The values for appointment type can be looked up under “Extras >> Settings >> Administration >> Input Fields, Module: Calender management”.
    See also the example below.

Response:

  • (individually)

Example: Read appointment by resource ID:

...
{
	"actionid": "urn:onoffice-de-ns:smart:2.5:smartml:action:read",
	"resourceid": "79",
	"identifier": "",
	"resourcetype": "calendar",
	"parameters": {             
	}
}
...

Response example: Read appointment by resource ID:

{
    "status": {
        "code": 200,
        "errorcode": 0,
        "message": "OK"
    },
    "response": {
        "results": [
            {
                "actionid": "urn:onoffice-de-ns:smart:2.5:smartml:action:read",
                "resourceid": "79",
                "resourcetype": "calendar",
                "cacheable": true,
                "identifier": "",
                "data": {
                    "meta": {
                        "cntabsolute": null
                    },
                    "records": [
                        {
                            "id": 79,
                            "type": "calendar",
                            "elements": {
                                "start_dt": "2017-11-22 09:15:00",
                                "end_dt": "2017-11-22 09:45:00",
                                "description": "",
                                "note": "",
                                "ort": "",
                                "art": {
                                    "Besichtigung": "Besichtigung"
                                },
                                "fuer": [
                                    "Tester (tester)",
                                    "Probe, Paul (paulprobe)"
                                ],
                                "groups": [],
                                "emails": {
                                    "robert": "tester@my-onoffice.de",
                                    "paulprobe": "paulprobe@onoffice.de"
                                },
                                "user_ids": [
                                    17,
                                    25
                                ],
                                "ressources": [],
                                "erinnerung": "",
                                "ganztags": false,
                                "rp_flag": false,
                                "abgesagt": false,
                                "assignedaddressids": [
                                    10465
                                ],
                                "assignedobjectids": [],
                                "rp_type": "t",
                                "rp_tage": 1,
                                "rp_beginn_datum": "2017-11-20",
                                "rp_ende_datum": "2017-11-20",
                                "rp_ende_status": "0",
                                "rp_exception": [],
                                "ProjektNr": null,
                                "von": "robert",
                                "private": "0",
                                "modified": "2020-03-11 16:45:13"
                            }
                        }
                    ]
                },
                "status": {
                    "errorcode": 0,
                    "message": "OK"
                }
            }
        ]
    }
}

Example: Reading out the appointments of a period:

...
    {
        "actionid": "urn:onoffice-de-ns:smart:2.5:smartml:action:read",
        "resourceid": "",
        "identifier": "",
        "resourcetype": "calendar",
        "parameters": {
            "datestart": "2021-02-01 15:00:00",
            "dateend": "2021-02-02 15:00:00",
            "filter": {
                "art": [
                    {
                        "op": "IN",
                        "val": [
                            "Besichtigung"
                        ]
                    }
                ]
            },
            "showcancelled": true,
            "users": [
                25
            ]
        }
    }
...

Response: Reading out the appointments of a period:

{
    "status": {
        "code": 200,
        "errorcode": 0,
        "message": "OK"
    },
    "response": {
        "results": [
            {
                "actionid": "urn:onoffice-de-ns:smart:2.5:smartml:action:read",
                "resourceid": "",
                "resourcetype": "calendar",
                "cacheable": true,
                "identifier": "",
                "data": {
                    "meta": {
                        "cntabsolute": null
                    },
                    "records": [
                        {
                            "id": 2965,
                            "type": "calendar",
                            "elements": {
                                "start_dt": "2021-02-01 16:00:00",
                                "end_dt": "2021-02-01 16:30:00",
                                "ganztags": false,
                                "description": "Wohnungsbesichtigung",
                                "ort": "Charlottenburger Allee 5, 52068 Aachen, Deutschland",
                                "art": {
                                    "Besichtigung": "Besichtigung"
                                },
                                "rp_flag": false,
                                "assignedaddressids": [
                                    9407
                                ],
                                "assignedobjectids": [
                                    2595
                                ],
                                "rp_type": "",
                                "rp_tage": 0,
                                "rp_beginn_datum": "0000-00-00",
                                "rp_ende_datum": "0000-00-00",
                                "rp_ende_status": "0",
                                "rp_exception": [],
                                "abgesagt": false,
                                "erinnerung": "",
                                "ressources": [],
                                "modified": "2021-02-22 11:08:14"
                            }
                        }
                    ]
                },
                "status": {
                    "errorcode": 0,
                    "message": "OK"
                }
            }
        ]
    }
}