Records last seen

Resource: recordsLastSeen

This API call can be used to query the number of recently viewed records. In enterprise this is the view “Last opened datasets” via the star.

Currently the call only returns the number of records under “cntabsolute”, the records array is always empty. The call might be extended later.

The maximum number of records is 1000, as in enterprise, where the number of records displayed is reduced to the 1000 most recent records every night per module.

As with other read calls, restrictions can be made via the filter parameter.

Parameters:

  • module
    STRING. MANDATORY. Possible values: address, estate, task, email
  • listlimit
    INTEGER. MANDATORY. Must be set to 0.
  • user
    INTEGER. User ID for the user whose data records are to be queried. In order to be able to query other users for the parameter user, the user right “Last opened datasets” under “Logging/Statistics” must be set accordingly. If user is not specified, the data sets of the logged-in user are delivered.
  • filter
    OBJECT. For the filter date can be specified to limit the time period of the records last seen. date is a DATETIME, the exact time can be given with seconds. If no time is set, 00:00:00 is added. For the query of time periods use the operator BETWEEN. Some operators do not give meaningful results. See example below for usage.

    You can also filter by the fields of the modules. For addresses and estates all fields specified in the enterprise administration are valid here. For tasks, the field names can be looked up here. Email fields cannot be filtered, only the date for emails.

    Key: field, value: array of objects with filter expressions in the format "date": [{"op": "BETWEEN", "val": ["2010-01-01 00:00:00","2022-04-01 15:00:00"]}]. 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.

Example:

...
    {
        "actionid": "urn:onoffice-de-ns:smart:2.5:smartml:action:read",
        "resourceid": "",
        "identifier": "",
        "resourcetype": "recordsLastSeen",
        "parameters": {
            "user": 17,
            "listlimit": 0,
            "module": "email",
            "filter": {
                "date": [
                    {
                        "op": "BETWEEN",
                        "val": [
                            "2021-01-01 00:00:00",
                            "2021-09-01 00:00:00"
                        ]
                    }
                ]
            }
        }
    }
...

Response: The number of datasets can be found under cntabsolute

...
{
    "status": {
        "code": 200,
        "errorcode": 0,
        "message": "OK"
    },
    "response": {
        "results": [
            {
                "actionid": "urn:onoffice-de-ns:smart:2.5:smartml:action:read",
                "resourceid": "",
                "resourcetype": "recordsLastSeen",
                "cacheable": false,
                "identifier": "",
                "data": {
                    "meta": {
                        "cntabsolute": 50
                    },
                    "records": []
                },
                "status": {
                    "errorcode": 0,
                    "message": "OK"
                }
            }
        ]
    }
}
...