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
aren’t 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 requested appointments, the time part is ignored.modifiedstart
STRING. Earliest date of last edit for requested appointments. Can be used alone or in combination withmodifiedend
. Will be ignored if used together withdatestart
anddateend
.The response parameter for the time stamp
modified
is stored internally in UTC in enterprise, i.e. independent of the local time. You should convert your local time to UTC when queryingmodifiedstart
andmodifiedend
and then perform the request with UTC time if you refer to the value ofmodified
. There are conversion options for this inPHP
and other programming languages.modifiedend
STRING. Latest date of last edit for requested appointments. Can be used alone or in combination withmodifiedstart
. Will be ignored if used together withdatestart
anddateend
.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 parametersdatestart
anddateend
.groups
ARRAY. Group IDs. Specify here the appointments of which groups you want to read out. Works only in combination with the parametersdatestart
anddateend
.allusers
BOOLEAN. Flag for reading out all data. If set ontrue
, the parametersusers
andgroups
will be ignored. Default:false
.filter
OBJECT. Key: field, value: array of objects with filter expressions in the format"art": [{"op": "=", "val": "Besichtigung"}]
. Withop
you specify the operator. Possible values forop
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)
ressources
. German labels of the resources of the appointment.ressourcesWithKeys
. Keys (column field in the administration) and translated labels (column content in the administration) of the resources of the appointment.users
. ARRAY of OBJECTS. The users who have been explicitly added to an appointment. If the user is a participant in the appointment via his group, he is listed underuser_ids
. The following data of the user are output:id
,username
,firstName
,lastName
,email
.user_ids
. ARRAY. IDs of all participants of the appointment, regardless of whether they were explicitly added to the appointment as a user or via their group.
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": 1 }, "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, 169, 23 ], "ressources": [ "Konferenzraum", "Firmenfahrzeug", "PC" ], "ressourcesWithKeys": { "Konferenzraum": "Conference room", "Firmenfahrzeug": "Company car", "ind_Schl_3141": "PC" }, "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", "users": [ { "id": "169", "username": "antontest", "firstName": "Anton", "lastName": "Test", "email": "testonffice123@onoffice.de" }, { "id": "23", "username": "theotest", "firstName": "Theo", "lastName": "Test", "email": "test4235@onoffice.de" } ] } } ] }, "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": 1 }, "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": [], "ressourcesWithKeys": [], "modified": "2021-02-22 11:08:14", "users": [ { "id": "169", "username": "antontest", "firstName": "Anton", "lastName": "Test", "email": "testonffice123@onoffice.de" }, { "id": "23", "username": "theotest", "firstName": "Theo", "lastName": "Test", "email": "test4235@onoffice.de" } ] } } ] }, "status": { "errorcode": 0, "message": "OK" } } ] } }
Example: Reading out appointments edited in a period:
{ "actionid": "urn:onoffice-de-ns:smart:2.5:smartml:action:read", "resourceid": "", "identifier": "", "resourcetype": "calendar", "parameters": { "modifiedstart": "2022-05-20 13:45:54", "modifiedend": "2022-05-24 17:45:00", "showcancelled": true, "users": [ 21 ] } }
Response: Reading out appointments edited in 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": 1 }, "records": [ { "id": 2965, "type": "calendar", "elements": { "start_dt": "2022-05-20 9:45:00", "end_dt": "2022-05-20 10: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": [], "ressourcesWithKeys": [], "modified": "2022-05-20 13:45:54", "users": [ { "id": "169", "username": "antontest", "firstName": "Anton", "lastName": "Test", "email": "testonffice123@onoffice.de" }, { "id": "23", "username": "theotest", "firstName": "Theo", "lastName": "Test", "email": "test4235@onoffice.de" } ] } } ] }, "status": { "errorcode": 0, "message": "OK" } } ] } }