Activity App
- class nc_py_api.activity.Activity(raw_data: dict)[source]
Description of one activity.
- property actor_id: str
User ID of the user that triggered/created this activity.
Note
Can be empty in case of public link/remote share action.
- property subject: str
Translated simple subject without markup, ready for use (e.g. ‘You created hello.jpg’).
- property subject_rich: list
0 is the string subject including placeholders, 1 is an array with the placeholders.
- property message: str
Translated message without markup, ready for use (longer text, unused by core apps).
- property object_type: str
The Type of the object this activity is about (e.g. ‘files’ is used for files and folders).
- property object_id: int
ID of the object this activity is about (e.g., ID in the file cache is used for files and folders).
- property object_name: str
The name of the object this activity is about (e.g., for files it’s the relative path to the user’s root).
- property objects: dict
Contains the objects involved in multi-object activities, like editing multiple files in a folder.
Note
They are stored in objects as key-value pairs of the object_id and the object_name: { object_id: object_name}
- property link: str
A full URL pointing to a suitable location (e.g. ‘http://localhost/apps/files/?dir=%2Ffolder’ for folder).
- class nc_py_api.activity._ActivityAPI(session: NcSessionBasic)[source]
The class provides the Activity Application API.
- property available: bool
Returns True if the Nextcloud instance supports this feature, False otherwise.
- get_activities(filter_id: ActivityFilter | str = '', since: int | bool = 0, limit: int = 50, object_type: str = '', object_id: int = 0, sort: str = 'desc') list[Activity] [source]
Returns activities for the current user.
- Parameters:
filter_id – Filter to apply, if needed.
since – Last activity ID you have seen. When specified, only activities after provided are returned. Can be set to
True
to automatically use lastlast_given
from previous calls. Default = 0.limit – Max number of activities to be returned.
object_type – Filter the activities to a given object.
object_id – Filter the activities to a given object.
sort – Sort activities ascending or descending. Default is
desc
.
Note
object_type
andobject_id
should only appear together withfilter_id
unset.
- get_filters() list[ActivityFilter] [source]
Returns avalaible activity filters.