Templates

List all templates

GET /api/templates
<?xml version="1.0" encoding="UTF-8"?>
<templates type="array">
    <template>
        ...
    </template>
    <template>
        ...
    </template>
</templates>

The list can be fil­te­red with parameters:

GET /api/template?type=INVOICE

Shows all invoice tem­pla­tes. It doesn’t mat­ter if you use upper– or lowercase.

The fol­lo­wing para­me­ters can be used:

Para­me­ter Descrip­tion
type Type of the tem­plate (INVOICE, OFFER, CONFIRMATION, REMINDER, DELIVERY_NOTE, CREDIT_NOTE)

Show a spe­ci­fic template

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>
    <name>My frist template</name>
    <format>doc</format>
    <base64file>{base64 file}</base64file>
</template>

Create tem­plate

POST /api/templates
XML ele­ment Descrip­tion Type Default value Man­datory
name Name of the template ALNUM yes
type Type (INVOICE, OFFER, CONFIRMATION, REMINDER, DELIVERY_NOTE, CREDIT_NOTE) Type of the template yes
for­mat For­mat (doc, docx or rtf) File for­mat yes
base64file base64 coded tem­plate file yes
<template>
    <name>My first template</name>
    <type>INVOICE</type>
    <format>doc</format>
    <base64file>{base64 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>
    <name>My first template</name>
    <format>doc</format>
    <base64file>{b{base64 file}</base64file>
</template>

Edit tem­plate

PUT /api/templates/{id}
<template>
    <name>Special template</name>
</template>

Delete tem­plate

DELETE /api/templates/{id}

Dele­tes a template.


Pre­view of a template

GET /api/templates/{id}/thumb

Returns the first page of the tem­plate,
The desi­red image for­mat can be spe­ci­fied via the para­me­ter for­mat.

Para­me­ter Descrip­tion
for­mat Image for­mat (png, gif or jpg). The default for­mat is png.