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
- 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/logout:
post:
tags:
- auth
operationId: logout
security: []
responses:
204:
description: Successfully logged out
default:
$ref: '#/responses/default'
/v1/auth/register:
post:
tags:
- auth
operationId: register
security: []
parameters:
in: body
schema:
$ref: "#/definitions/registration"
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
responses:
204:
description: Register is successfull, an email should be sent to the user
default:
$ref: '#/responses/default'
/v1/auth/forgot-password:
post:
tags:
- auth
operationId: forgot-password
security: []
parameters:
- name: info
in: body
schema:
type: object
properties:
username:
type: string
email:
type: string
responses:
204:
description: Success, an email should be sent to the user
default:
$ref: '#/responses/default'
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
/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/auth/reset-password:
post:
tags:
- auth
operationId: reset-password
security: []
parameters:
- name: newpassword
in: body
schema:
type: object
properties:
token:
type: string
password:
type: string
responses:
204:
description: Password is successfully reset
default:
$ref: '#/responses/default'
/v1/renderlogs/{period}:
get:
description: |
Returns the logs of a period in csv format. Period format must be
"AAAA-MM.csv" or "AAAA-MM--AAAA-MM.csv".
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
tags:
- admin
operationId: renderlogs
parameters:
- name: period
in: path
type: string
required: true
- name: format
in: query
type: string
description: output format, defaults to the url extension
responses:
200:
description: A list of rendering logs
headers:
Content-Type:
type: string
Content-Disposition:
type: string
schema:
type: file
401:
$ref: '#/responses/unauthorized'
404:
description: the period is invalid or its extension is not supported
schema:
$ref: "#/definitions/error"
/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:
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
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.
parameters:
- in: body
name: apikey
schema:
$ref: '#/definitions/apikey'
responses:
201:
description: The api key was successfully created
schema:
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'
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
/v1/template/{account}/{name}/preview.{format}:
parameters:
- name: account
type: string
in: path
required: true
- name: name
type: string
in: path
required: true
- name: format
type: string
in: path
required: true
get:
description: |
Return a preview of the template as an image.
Supported formats are: png
tags:
- template-management
operationId: account-template-preview
responses:
200:
description: The template preview
headers:
Content-Type:
type: string
Content-Disposition:
type: string
ETag:
type: string
304:
description: Not Modified
headers:
ETag:
type: string
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'
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
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"
registration:
type: object
description: User information for a registration
properties:
email:
type: string
x-go-custom-tag: db:"email"
firstname:
type: string
x-go-custom-tag: db:"firstname"
lastname:
type: string
x-go-custom-tag: db:"lastname"
description: |
Current user information
email:
type: string
x-go-custom-tag: db:"email"
firstname:
type: string
x-go-custom-tag: db:"firstname"
lastname:
type: string
x-go-custom-tag: db:"lastname"
enable-request-logging:
type: boolean
x-go-custom-tag: db:"enable_request_logging"
created-at:
type: string
format: datetime
x-go-custom-tag: db:"created_at"
activity:
$ref: "#/definitions/activity"
activity:
type: object
description: |
Current user activity.
properties:
render_stats:
$ref: "#/definitions/render_stats"
render_stats:
type: object
description: |
Current user rendering statistics.
properties:
total:
type: integer
current_month:
type: integer
last_month:
type: integer
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"
apikeyAndValue:
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'
description: Content
created-at:
type: string
format: datetime
x-go-custom-tag: db:"created_at"
activity:
$ref: "#/definitions/activity"
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