You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With Nextcloud Hub 26 Winter we introduce a new client integration API. It allows server side apps to expose integrations on Desktop and Mobile.
8
-
For now we support adding app-defined actions to "context menu" of files and folders.
7
+
With Nextcloud Hub 26 Winter we are introducing a new client integration API. It allows server side apps to expose integrations on Desktop and Mobile.
8
+
For now we support adding app-defined actions to a "context menu" of files and folders.
9
9
10
-
The idea behind it, is to ease the integration of specific actions on clients without the need to write and maintain code on those platforms.
10
+
It allows providing easy integration of specific actions on clients without the need to write and maintain code on those platforms.
11
11
12
12
Supported clients
13
13
-----------------
14
14
15
-
Android: 3.36.0
16
-
Desktop: 4.1.0
17
-
iOS: 7.3.0
15
+
Android: 3.36.0 and above
16
+
17
+
Desktop: 4.1.0 and above
18
+
19
+
iOS: 7.3.0 and above
18
20
19
21
Supported server apps
20
22
---------------------
21
23
richdocuments: Convert .docx to .md
24
+
22
25
assistant: Transcribe audio file
26
+
23
27
files_zip: Zip a file or folder
28
+
24
29
contacts: Create new contact from vfc
25
30
26
31
Exposing actions via capability
@@ -57,7 +62,7 @@ Requirements:
57
62
- all urls must be relative
58
63
- params is used for body params (currently only POST)
59
64
- Icons are always svgs
60
-
- Methoth: supported POST/GET
65
+
- Method: supports POST/GET
61
66
62
67
.. code::
63
68
[
@@ -72,16 +77,49 @@ Requirements:
72
77
Response
73
78
--------
74
79
When clicking on a menu entry the client sends a predefined request to the server.
75
-
The app in question can then handle the request and can send two different response types.
80
+
The app in question can then handle the request and can send two different response types:
76
81
77
82
Declarative UI
78
83
^^^^^^^^^^^^^^
84
+
The declarative UI response allows the app to send back a new UI to be rendered by the client:
85
+
- version: Indicates which version it is. Clients will be backwards compatible. If server sends a newer version than the client can understand the response will be ignored.
86
+
- tooltip: Translated text, which will be shown as tooltip / snackbar.
87
+
88
+
.. code::
89
+
90
+
{
91
+
"ocs": {
92
+
"meta": {
93
+
"status": "ok",
94
+
"statuscode": 200,
95
+
"message": "OK"
96
+
},
97
+
"data": {
98
+
"version": 0.1,
99
+
"root": {
100
+
"orientation": "vertical",
101
+
"rows": [
102
+
{
103
+
"children": [
104
+
{
105
+
"element": "URL",
106
+
"text": "Link created",
107
+
"url": "/some/link/to/a/page"
108
+
}
109
+
]
110
+
}
111
+
]
112
+
}
113
+
}
114
+
}
115
+
}
79
116
117
+
At the moment only rows with text and url elements are supported, but in the future we will add more elements and options.
80
118
81
119
Tooltip Response
82
120
^^^^^^^^^^^^^^^^
83
121
The tooltip response is a regular DataResponse type, with payload:
84
-
- version: Indicates which version it is. Clients will be backward compatible. If server sends a newer version than the client can understand the response will be ignored.
122
+
- version: Indicates which version it is. Clients will be backwards compatible. If server sends a newer version than the client can understand the response will be ignored.
85
123
- tooltip: Translated text, which will be shown as tooltip / snackbar.
86
124
87
125
.. code::
@@ -99,9 +137,76 @@ The tooltip response is a regular DataResponse type, with payload:
99
137
}
100
138
}
101
139
140
+
Example:
141
+
----------
142
+
Here is an example of using the Assistant app.
143
+
144
+
**Capabilities:**
145
+
146
+
`ocs/v1.php/cloud/capabilities` returns the following capability:
The Assistant integration has a few endpoints for the client to show and execute. They appear like this on the client side:
179
+
180
+
.. image:: /images/client-integration-ios.png
181
+
alt: "Client integration on iOS"
182
+
183
+
.. image:: /images/client-integration-android.png
184
+
alt: "Client integration on Android"
185
+
186
+
.. image:: /images/client-integration-desktop.png
187
+
alt: "Client integration on Desktop"
188
+
189
+
Looking at the "Summarize using AI" action, it will only show for files with mimetypes starting with "text/" or the specified document and PDF mimetypes, as described in `mimetype_filters`.
190
+
When clicking on the action, the client will send a POST request to the specified URL, replacing {fileId} with the actual file id. The app can then handle the request and for example send a tooltip response back to the client. The client will show the tooltip to the user:
0 commit comments