diff options
author | Joas Schilling <coding@schilljs.com> | 2016-12-12 14:19:22 +0300 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2016-12-12 14:19:22 +0300 |
commit | cd8868c6dc272277154a4b0ac6dd0de16165f1e5 (patch) | |
tree | d6f4fa97f5280b43fa93ec1aaf23b3d277f2af22 /docs | |
parent | b06e0837fd0f9160cf01e5342ec29db50d7d734a (diff) |
Adjust the v2 endpoint docs
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'docs')
-rw-r--r-- | docs/endpoint-v2.md | 120 |
1 files changed, 41 insertions, 79 deletions
diff --git a/docs/endpoint-v2.md b/docs/endpoint-v2.md index f29e433c..aea7dabe 100644 --- a/docs/endpoint-v2.md +++ b/docs/endpoint-v2.md @@ -67,17 +67,24 @@ Field name | Type | Value description `type` | string | For most files related activities this is the action that was performed on the file/folder (e.g. `'file_changed'`, `'file_created'` (same is used for both, file and folder)), other apps use other strings (e.g. `'announcementcenter'`) `user` | string (Optional) | User ID of the user that triggered/created this activity (can also be empty in case of public link/remote share action) `affecteduser` | string | User ID of the user that received this activity (always the same) -`subject` | string | Untranslated arbitrary subject (e.g. `'changed_self'`, `'changed_by'`) -`subjectparams` | array | Array with one array per parameter, each parameter array has the key `'type'` and `'value'`. Value is an array-of-parameters in case of type `collection` and a string otherwise -`subject_prepared` | string | Translated version of the subject with parameters included (See section `MarkUp`) (e.g. `You deleted <file link="/files/index.php?dir=%2F&scrollto=welcome.txt">welcome.txt</file>`) -`message` | string (Optional) | Untranslated arbitrary message (unused by core apps) -`messageparams` | array | See `subjectparams` -`message_prepared` | string | Translated version of the message with parameters included (See section `MarkUp`) +`subject` | string | Translated simple subject without markup, ready for use (e.g. `'You created hello.jpg'`) +`subject_rich` | array (Optional) | `0` is the string subject including placeholders, `1` is an array with the placeholders. See [this issue](https://github.com/nextcloud/server/issues/1706) for more information +`message` | string (Optional) | Translated simple message without markup, ready for use (longer text, unused by core apps) +`message_rich` | array (Optional) | See `subject_rich` +`icon` | string (Optional) | A full URL to an icon for the activity `link` | string (Optional) | A full URL pointing to a suitable location (e.g. `'http://localhost/cloud/master/core/index.php/apps/files/?dir=%2Ffolder'` in case the folder got created) `object_type` | string (Optional) | Type of the object this activity is about (e.g. `'files'` is used for files and folders) `object_id` | int (Optional) | ID of the object this activity is about (e.g. ID in the file cache is used for files and folders) `object_name` | string (Optional) | Name of the object this activity is about (e.g. for files it's the relative path to the user's root: `'/folder/.travis.yml'`) -`activity_ids` | array of int (Optional) | Array of `activity_id`s that have been grouped into this activity +`previews` | array (Optional) | A list of potential previews (currently only available for file activities). See `Preview element` for more information + +### Preview element + +Field name | Type | Value description +---------- | ---- | ----------------- +`source` | string | Full URL of the image to be displayed +`link` | string | Full URL the preview should be wrapped in +`isMimeTypeIcon` | bool | True if `source` points to a mime type icon instead of a real preview In case the endpoint returns more fields, they should be ignored and are deprecated (only for backwards compatibility usage) or internal. @@ -88,82 +95,37 @@ In case the endpoint returns more fields, they should be ignored and are depreca "activity_id": 1, "timestamp": 1446137950, "app": "files", - "type": "file_deleted", + "type": "file_created", "user": "test1", "affecteduser": "admin", - "subject": "deleted_self", - "subjectparams": [ - { - "value": "\/welcome.txt", - "type": "file" + "subject": "test1 created hello.jpg", + "subject_rich": { + "0": "test1 created {file1}", + "1": { + "file1": { + "type": "file", + "id": 23, + "name": "hello.jpg", + "path": "\/test\/hello.jpg" + } } - ], - "subject_prepared" : "You deleted <file link=\"\/files\/index.php?dir=%2F&scrollto=welcome.txt\" id=\"3\">welcome.txt<\/file>", - "message": "", - "messageparams": [ - - ], - "message_prepared" : "", + }, + "message": null, + "message_rich": { + "0": "", + "1": [] + }, + "icon": "https:\/\/localhost\/apps\/files\/img\/add-color.svg", "link": "", "object_type": "files", - "object_id": 3, - "object_name": "\/welcome.txt" + "object_id": 23, + "object_name": "\/test\/hello.jpg", + "previews": [ + { + "link": "https:\/\/localhost\/index.php\/apps\/files\/?dir=\/test&scrollto=hello.jpg", + "source": "https:\/\/localhost\/index.php\/core\/preview.png?file=\/hello.jpg&x=150&y=150", + "isMimeTypeIcon": false + } + ] } ``` - -## MarkUp - -Element | Desciption -------- | ---------- -`file` | File should be translated into a link on the file system/web UI -`user` | User should be presented with display name (with avatar) -`federated-cloud-id` | Federated Clout User should be presented with display name -`parameter` | Parameter with no given type, should be presented as is -`collection` | A collection of other parameters, should present the first X elements and then display " and `(#-X)` more" - -### file - -`<file link="/files/index.php?dir=%2F&scrollto=welcome.txt" id="3">welcome.txt</file>` - -Attribute | Desciption ---------- | ---------- -body | Full path to the file -`link` | Link where the item can currently be viewed -`id` | File id (if known, otherwise emtpy string) - -### user - -`<user display-name="Administrator">admin</user>` - -Attribute | Desciption ---------- | ---------- -body | User id -`display-name` | Display name of the user - -### federated-cloud-id - -`<federated-cloud-id display-name="Administrator of Example" user="admin" server="example.com">admin@example.com</federated-cloud-id>` - -Attribute | Desciption ---------- | ---------- -body | Federated cloud id -`display-name` | Display name of the user -`user` | User name -`server` | Server address - -### parameter - -`<parameter>string</parameter>` - -Attribute | Desciption ---------- | ---------- -body | String to use - -### collection - -`<collection><file link="/files/index.php?dir=%2F&scrollto=welcome.txt" id="3">welcome.txt</file><file link="/files/index.php?dir=%2F&scrollto=test.txt" id="4">test.txt</file></collection>` - -Attribute | Desciption ---------- | ---------- -body | Elements to display - |