Welcome to mirror list, hosted at ThFree Co, Russian Federation.

api_templates.md « docs - github.com/nextcloud/richdocuments.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: c5ba9864234b85ec14b700f2e06a23a5ab7a5350 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50

# Templates API

### Listing templates

Send a GET to:

`<server>/ocs/v2.php/apps/richdocuments/api/v1/templates/<type>`

Here type can be:

* document
* spreadsheet
* presentation

This returns a list of templates with

* id
* name
* link to preview
* extension

### Template previews

Send a GET to:

`<server>/apps/richdocuments/templates/<id>`

Where `id` is the id of the template obtained in the listing. This returns back
an image (jpeg or png). For displaying.

### Creating document based on a template

Send a POST to

`<server>/ocs/v2.php/apps/richdocuments/api/v1/templates/new`

with:
* `path`: the full path relative to the user where to create the document, including new file name
* `template`: the template id you want to create

## Web frontend

When clicking on a new document a selection popup appears listing the
available templates.

The user can select a template, possible change the name and create it.

This is similar to the current flow with the difference that the user can now
select a template.