App-Registry
|
Developer Readme
Here you can find the developer README.md for this service on the master branch. Please note that the README is intended for developers and may differ from the description in the admin documentation. Admin Docs provides information that has had specific, developer-only information removed, but it may contain additional administrative or configuration notes relevant to this service.
Developer Topics
Endpoint Access
Clients (for example ownCloud Web) query the app-registry to discover available applications and MIME types, and to open or create files via those applications.
Listing Available Apps and MIME Types
- Endpoint
-
/app/list(as specified in capabilities underapps_url) - Method
-
HTTP GET
- Authentication
-
None
Request example:
curl 'https://ocis.test/app/list'
Response example (HTTP 200):
{
"mime-types": [
{
"mime_type": "application/pdf",
"ext": "pdf",
"app_providers": [
{
"name": "OnlyOffice",
"icon": "https://some-website.test/onlyoffice-pdf-icon.png"
}
],
"name": "PDF",
"description": "PDF document"
},
{
"mime_type": "application/vnd.oasis.opendocument.text",
"ext": "odt",
"app_providers": [
{
"name": "Collabora",
"icon": "https://some-website.test/collabora-odt-icon.png"
},
{
"name": "OnlyOffice",
"icon": "https://some-website.test/onlyoffice-odt-icon.png"
}
],
"name": "OpenDocument",
"icon": "https://some-website.test/opendocument-text-icon.png",
"description": "OpenDocument text document",
"allow_creation": true,
"default_application": "Collabora"
},
{
"mime_type": "text/markdown",
"ext": "md",
"app_providers": [
{
"name": "CodiMD",
"icon": "https://some-website.test/codimd-md-icon.png"
}
],
"name": "Markdown file",
"description": "Markdown file",
"allow_creation": true,
"default_application": "CodiMD"
}
]
}
Open a File With ownCloud Web
- Endpoint
-
/app/open-with-web(as specified in capabilities underopen_web_url) - Method
-
HTTP POST
- Authentication (one of)
-
-
Authorizationheader with OIDC Bearer token or basic auth credentials (if enabled in oCIS) -
X-Access-Tokenheader with a REVA token
-
Query parameters:
file_id(mandatory)-
ID of the file to be opened.
app_name(optional)-
Application to use; defaults to the default app for the MIME type. Possible values come from the
/app/listendpoint.
Request examples:
curl -X POST 'https://ocis.test/app/open-with-web?file_id=ZmlsZTppZAo='
curl -X POST 'https://ocis.test/app/open-with-web?file_id=ZmlsZTppZAo=&app_name=Collabora'
Response example (HTTP 200) — the returned URI is intended to be opened with a GET request in a browser; if the user has no active session, ownCloud Web handles the login flow:
{
"uri": "https://....."
}
Open a File With the App Provider
- Endpoint
-
/app/open(as specified in capabilities underopen_url) - Method
-
HTTP POST
- Authentication (one of)
-
-
Authorizationheader with OIDC Bearer token or basic auth credentials (if enabled in oCIS) -
Public-Tokenheader with a public link token -
X-Access-Tokenheader with a REVA token
-
Query parameters:
file_id(mandatory)-
ID of the file to be opened.
app_name(optional)-
Application to use; defaults to the default app for the MIME type.
view_mode(optional)-
Defaults to the highest possible view mode given the file permissions. Values:
write(edit + download),read(view + download),view(view only, no download). lang(optional)-
ISO 639-1 language code for the application UI (e.g.
de,en,es).
Request examples:
curl -X POST 'https://ocis.test/app/open?file_id=ZmlsZTppZAo='
curl -X POST 'https://ocis.test/app/open?file_id=ZmlsZTppZAo=&lang=de'
curl -X POST 'https://ocis.test/app/open?file_id=ZmlsZTppZAo=&app_name=Collabora'
curl -X POST 'https://ocis.test/app/open?file_id=ZmlsZTppZAo=&view_mode=read'
curl -X POST 'https://ocis.test/app/open?file_id=ZmlsZTppZAo=&app_name=Collabora&view_mode=write'
All apps are expected to open in an iframe. Apps that require a form POST respond with:
{
"app_url": "https://.....",
"method": "POST",
"form_parameters": {
"access_token": "eyJ0...",
"access_token_ttl": "1634300912000",
"arbitrary_param": "lorem-ipsum"
}
}
Apps that require a GET request respond with:
{
"app_url": "https://...",
"method": "GET",
"headers": {
"access_token": "eyJ0e...",
"access_token_ttl": "1634300912000",
"arbitrary_header": "lorem-ipsum"
}
}
Error responses:
| HTTP status | Code | Message |
|---|---|---|
400 |
|
|
400 |
|
|
400 |
|
|
400 |
|
|
400 |
|
|
404 |
|
|
404 |
|
|
Creating a File With the App Provider
- Endpoint
-
/app/new(as specified in capabilities undernew_file_url) - Method
-
HTTP POST
- Authentication (one of)
-
-
Authorizationheader with OIDC Bearer token or basic auth credentials (if enabled in oCIS) -
Public-Tokenheader with a public link token -
X-Access-Tokenheader with a REVA token
-
Query parameters:
parent_container_id(mandatory)-
ID of the folder in which the file will be created.
filename(mandatory)-
Name of the new file.
template(optional)-
Not yet implemented.
Request example:
curl -X POST 'https://ocis.test/app/new?parent_container_id=c2lkOmNpZAo=&filename=test.odt'
Response example (HTTP 200) — returns the file ID of the newly created file, which can be used to open the file in an editor:
{
"file_id": "ZmlsZTppZAo="
}
Error responses:
| HTTP status | Code | Message |
|---|---|---|
400 |
|
|
400 |
|
|
400 |
|
|
404 |
|
|