Newer
Older
description: |
The Rednerd rendering server. For a list of available rendering engines
and their options, see <a href="/docs/engines">Rednerd Engines</a>.
consumes:
- application/io.orus.rednerd.v1+json
- application/json
produces:
- application/io.orus.rednerd.v1+json
schemes:
- http
- https
securityDefinitions:
type: apiKey
in: header
name: Authorization
description: |
Authentication by token bearer.
The token is obtained by user the 'auth' API.
The header format is <pre>"Authorization: Bearer <token>"</pre>.
cookie:
type: apiKey
in: header
name: Cookie
description: |
Authentication by cookie. See the 'auth' API to get a proper cookie
apikey:
type: apiKey
in: header
name: Rednerd-API-Key
description: |
Authentication by API key.
Each user can have one or several API keys and can be managed with the
user-management API.
- token: []
- cookie: []
tags:
- name: auth
description: Authentication
- name: user-management
description: User management
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
- name: template-management
description: |
The template management API let the user save templates for later use with
the rendering api
- name: rendering
description: Rendering API
paths:
/v1/auth/authenticate:
post:
tags:
- auth
operationId: authenticate
security: []
parameters:
- name: credentials
in: body
schema:
$ref: "#/definitions/credentials"
responses:
200:
description: A Json Web Token with a 5 minutes validity
schema:
type: string
401:
$ref: '#/responses/unauthorized'
default:
$ref: '#/responses/default'
/v1/auth/refresh_token:
post:
tags:
- auth
operationId: refresh-token
responses:
200:
description: A Json Web Token with a 5 minutes validity
schema:
type: string
401:
$ref: '#/responses/unauthorized'
default:
$ref: '#/responses/default'
/v1/auth/userinfo:
get:
tags:
- auth
operationId: userinfo
responses:
200:
description: Returns the user information
schema:
$ref: "#/definitions/userinfo"
401:
$ref: '#/responses/unauthorized'
default:
$ref: '#/responses/default'
/v1/user:
get:
tags:
- user-management
operationId: user-list
responses:
200:
description: |
List the users
schema:
type: array
items:
$ref: "#/definitions/userinfo"
401:
$ref: '#/responses/unauthorized'
default:
$ref: '#/responses/default'
post:
tags:
- user-management
operationId: user-add
parameters:
- in: body
name: user
schema:
$ref: '#/definitions/userinfo'
responses:
201:
description: |
The created user
schema:
$ref: "#/definitions/userinfo"
401:
$ref: '#/responses/unauthorized'
default:
$ref: '#/responses/default'
/v1/user/{username}:
type: string
in: path
required: true
get:
tags:
- user-management
operationId: user-get
responses:
200:
description: |
The user information
schema:
$ref: "#/definitions/userinfo"
401:
$ref: '#/responses/unauthorized'
404:
description: the user does not exist
default:
$ref: '#/responses/default'
put:
tags:
- user-management
operationId: user-update
parameters:
- in: body
name: user
schema:
$ref: '#/definitions/userinfo'
responses:
200:
description: |
The user information
schema:
$ref: "#/definitions/userinfo"
401:
$ref: '#/responses/unauthorized'
404:
description: the user does not exist
default:
$ref: '#/responses/default'
delete:
tags:
- user-management
operationId: user-delete
responses:
204:
description: The user was successfully deleted
401:
$ref: '#/responses/unauthorized'
404:
description: the user does not exist
default:
$ref: '#/responses/default'
/v1/user/{username}/password:
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
type: string
in: path
required: true
post:
tags:
- user-management
operationId: user-password-set
parameters:
- in: body
name: body
schema:
type: object
properties:
password:
type: string
description: The user new password
responses:
204:
description: The password was successfully set
401:
$ref: '#/responses/unauthorized'
404:
description: the user does not exist
default:
$ref: '#/responses/default'
delete:
tags:
- user-management
operationId: user-password-delete
responses:
204:
description: The password was successfully deleted
401:
$ref: '#/responses/unauthorized'
404:
description: the user does not exist
default:
$ref: '#/responses/default'
/v1/user/{username}/apikey:
type: string
in: path
required: true
get:
tags:
- user-management
operationId: user-apikey-list
description: List the user api keys. Only the 'admin' user can manipulate the API keys.
responses:
200:
description: The user api keys
schema:
type: array
items:
$ref: '#/definitions/apikey'
401:
$ref: '#/responses/unauthorized'
404:
description: the user does not exist
default:
$ref: '#/responses/default'
post:
tags:
- user-management
operationId: user-apikey-add
description: Create a new api key for the user. Only the 'admin' user can manipulate the API keys.
parameters:
- in: body
name: apikey
schema:
$ref: '#/definitions/apikey'
responses:
201:
description: The api key was successfully created
schema:
$ref: '#/definitions/apikey'
401:
$ref: '#/responses/unauthorized'
404:
description: the user does not exist
default:
$ref: '#/responses/default'
/v1/user/{username}/apikey/{name}:
type: string
in: path
required: true
- name: name
type: string
in: path
required: true
delete:
tags:
- user-management
operationId: user-apikey-delete
description: Remove a API key. Only the 'admin' user can manipulate the API keys.
responses:
204:
description: The api key was successfully deleted
401:
$ref: '#/responses/unauthorized'
404:
description: the user or key does not exist
default:
$ref: '#/responses/default'
/v1/template:
get:
tags:
- template-management
operationId: template-list
responses:
200:
description: |
List the user templates and the shared templates it has access to
schema:
type: array
items:
$ref: "#/definitions/template"
401:
$ref: '#/responses/unauthorized'
default:
$ref: '#/responses/default'
type: string
in: path
required: true
get:
tags:
- template-management
operationId: account-template-list
responses:
200:
description: |
List the user templates and the shared templates it has access to
schema:
type: array
items:
$ref: "#/definitions/template"
401:
$ref: '#/responses/unauthorized'
default:
$ref: '#/responses/default'
post:
tags:
- template-management
operationId: account-template-add
parameters:
- in: body
name: template
schema:
$ref: "#/definitions/template"
responses:
201:
description: Successfully added the new template
schema:
$ref: "#/definitions/template"
401:
$ref: '#/responses/unauthorized'
default:
$ref: '#/responses/default'
type: string
in: path
required: true
type: string
in: path
required: true
get:
tags:
- template-management
responses:
200:
description: The requested template
schema:
$ref: "#/definitions/template"
401:
$ref: '#/responses/unauthorized'
default:
$ref: '#/responses/default'
put:
tags:
- template-management
parameters:
- in: body
name: template
schema:
$ref: "#/definitions/template"
responses:
description: Successfully updated the template
schema:
$ref: "#/definitions/template"
401:
$ref: '#/responses/unauthorized'
default:
$ref: '#/responses/default'
delete:
tags:
- template-management
operationId: account-template-delete
responses:
204:
description: Successfully deleted the template
schema:
$ref: "#/definitions/template"
401:
$ref: '#/responses/unauthorized'
default:
$ref: '#/responses/default'
/v1/varlist:
post:
description: |
Extract the list of variables present in the template. The list is not
quaranteed to be accurate depending on the template language.
tags:
- template-management
operationId: template-varlist
parameters:
- name: request
in: body
schema:
$ref: "#/definitions/template"
responses:
200:
description: The list of variables found in the template
schema:
type: array
items:
type: string
401:
$ref: '#/responses/unauthorized'
default:
$ref: '#/responses/default'
description: |
Render a template.
If provided, the template can be a complete definition (without a "account"
and a "name"), or only a "account" and a "name" corresponding to a template
previously created with the template management API. In both case the
data must be provided.
Alternatively, a single document can be provided that will be renderer into
another type, without processing any template. In this case the "data" must
not be provided.
parameters:
- name: request
in: body
schema:
$ref: "#/definitions/render-request"
responses:
200:
description: The rendered documents
schema:
type: array
items:
$ref: "#/definitions/document"
401:
$ref: '#/responses/unauthorized'
default:
$ref: '#/responses/default'
type: string
in: path
required: true
- name: id
type: string
in: path
required: true
post:
description: Render an existing template into a list of documents
tags:
- rendering
parameters:
- name: request
in: body
schema:
$ref: "#/definitions/render-template-request"
responses:
200:
description: The rendered documents
schema:
type: array
items:
$ref: "#/definitions/document"
401:
$ref: '#/responses/unauthorized'
default:
$ref: '#/responses/default'
get:
description: Render an existing template into a single document
tags:
- rendering
operationId: render-one
parameters:
- name: data
type: string
in: query
description: |
A JSON object containing the variables to inject into the template.
description: |
The mimetype expected after a rendering.
- name: meta
type: array
items:
type: string
in: query
description: |
A list of metadata in the form "Name: Value"
responses:
200:
description: The rendered document
schema: {}
401:
$ref: '#/responses/unauthorized'
default:
$ref: '#/responses/default'
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
responses:
unauthorized:
description: Unauthorized
schema:
$ref: '#/definitions/error'
default:
description: generic error response
schema:
$ref: "#/definitions/error"
definitions:
error:
type: object
description: Generic error type
properties:
message:
type: string
credentials:
type: object
description: Credentials for authentication
properties:
username:
type: string
password:
type: string
set-cookie:
type: boolean
description: "if true, the response will set a cookie containing the web token"
userinfo:
type: object
description: Current user information
properties:
username:
type: string
apikey:
type: object
description: A user APIkey
properties:
name:
type: string
x-go-custom-tag: db:"name"
description:
type: string
x-go-custom-tag: db:"description"
value:
type: string
x-go-custom-tag: db:"value"
metadata:
type: object
additionalProperties:
type: string
description: |
A template or document metadata. Some values are interpreted by the
various engines. For more information about those values,
see <a href="/docs/engines">Rednerd Engines</a>.
example:
{ "print-paper-size": "A4 landscape" }
description: |
A template definition. At rendering time, the "body" and "metadata"
fields will be processed by the rendering engine corresponding to the
template "language" to produce a new document.
If you need to add metadata that should not be be processed, use
"static-metadata"
description: |
The template name, must be unique in an account namespace,
and should remain simple as it is used as a slug.
description: |
The template version. Can be any string, the consistency of version
numbers is the responsibility of the client.
locale:
type: string
description: |
The template default locale, in the i18n standard codification.
example: "fr_FR"
description: |
The templating language used. See
<a href="/docs/engines">Rednerd Engines</a> for a list of possible
values.
example: mustache
description: |
The mimetype of the data produced by the template. If the mimetype
is known by any engine, it can be rendered to other types.
example: text/html
description: |
The json-schema that can validate the input data. Currently ignored.
additionalProperties: true
static-metadata:
$ref: "#/definitions/metadata"
metadata:
$ref: "#/definitions/metadata"
body-format:
type: string
description: The body attribute format. Can be 'text' or 'base64'. Default 'base64'
x-go-custom-tag: db:"-"
description: Content
x-go-custom-tag: db:"-"
accept:
type: string
description: |
The mimetype expected after a rendering.
render-request:
type: object
properties:
template:
$ref: "#/definitions/template"
data:
$ref: "#/definitions/dataset"
document:
description: Document to render. Incompatible with the 'template' and 'data' properties
$ref: "#/definitions/document"
metadata:
$ref: "#/definitions/metadata"
render-template-request:
type: object
properties:
data:
$ref: "#/definitions/dataset"
metadata:
$ref: "#/definitions/metadata"
description:
A list of records to render a template
$ref: "#/definitions/record"
record:
type: object
additionalProperties: true
description:
A record is a set of variables meant to be injected into a template
render-error:
type: object
description: An error that occured during rendering
x-isnullable: false
properties:
engine:
type: string
description: The engine that produced the error
line:
type: integer
description: The line number on which the error occured
message:
type: string
description: The error message
extra:
type: object
additionalProperties:
type: string
description: |
Extra context or data about the error, specific to the rendering engine
description: |
A final document. Can be returned by a rendering, but also send to render
for a type conversion without rendering a template.
description: The document mimetype
example: text/html
metadata:
$ref: "#/definitions/metadata"
body-format:
type: string
description: The body attribute format. Can be 'text' or 'base64'. Default 'base64'
description: Content
render-errors:
type: array
items:
$ref: "#/definitions/render-error"
description: A list of non-blocking errors that occured during rendering