GET /api/templates
<?xml version="1.0" encoding="UTF-8"?> <templates type="array" page="1" per_page="100" total="2"> <template> ... </template> <template> ... </template> </templates>
GET /api/templates?type=INVOICE
Shows all invoice templates. It doesn’t matter if you use upper– or lowercase.
The following parameters can be used:
Parameter | Description |
---|---|
type | Document type of the template (INVOICE, OFFER, CONFIRMATION, REMINDER, DELIVERY_NOTE, CREDIT_NOTE, LETTER). More than one types could be given as a comma separated list. Theses types will be logically OR-connected. |
template_type | Type of the template (DEFINED = configured template via editor, UPLOADED = uploaded template). |
is_default | Default template (1 = yes, 0 = no) |
GET /api/templates/{id}
<?xml version="1.0" encoding="UTF-8"?> <template> <id type="integer">1</id> <created type="datetime">2007-12-13T12:12:00+01:00</created> <type>INVOICE</type> <template_type>UPLOADED</template_type> <name>My frist template</name> <format>doc</format> <base64file>{base64 encoded file}</base64file> <is_default>1</is_default> </template>
Note: Due to performance issues, format und base64file are only available by showing a single template. Furthermore, this attributes are only returned if template_type is UPLOADED.
POST /api/templates
XML element | Description | Type | Default value | Mandatory |
---|---|---|---|---|
name | Name of the template | ALNUM | ||
type | Document type (INVOICE, OFFER, CONFIRMATION, REMINDER, DELIVERY_NOTE, CREDIT_NOTE, LETTER) | ENUM | yes | |
format | Format (doc, docx or rtf) | ENUM | ||
base64file | base64 coded template file | ALNUM | ||
is_default | Specifies whether this is the default template (1 = yes, 0 = no) | BOOL | 0 |
Note: template_type is allocated automatically. If format and base64file are transmitted, template_type gets the value UPLOADED, else it is DEFINED.
<template> <name>My first template</name> <type>INVOICE</type> <format>doc</format> <base64file>{base64 encoded file}</base64file> </template>
<?xml version="1.0" encoding="UTF-8"?> <template> <id type="integer">1234</id> <created type="datetime">2007-12-13T12:12:00+01:00</created> <type>INVOICE</type> <template_type>UPLOADED</template_type> <name>My first template</name> <format>doc</format> <base64file>{base64 encoded file}</base64file> <is_default>0</is_default> </template>
PUT /api/templates/{id}
<template> <name>Special template</name> </template>
DELETE /api/templates/{id}
Deletes a template.
GET /api/templates/{id}/thumb
Returns the first page of the template.
The desired image format can be specified via the parameter format.
Parameter | Description |
---|---|
format | Image format (png, gif or jpg). The default format is png. |