FlexibleLatexTemplate
Everything the template editor needs: data types for the class dropdown, the id rules, the AI marker syntax and which AI features are available on this server.
GET/api/templates/flexible_latex_template_tools/editor_meta
Responses
200Editor meta data of flexible templates
curl --request GET \
--url https://your-instance.iw-erp.de/api/templates/flexible_latex_template_tools/editor_meta \
--header 'x-iw-jwt-token: <TOKEN>'const options = {method: 'GET', headers: {'x-iw-jwt-token': '<TOKEN>'}};
fetch('https://your-instance.iw-erp.de/api/templates/flexible_latex_template_tools/editor_meta', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://your-instance.iw-erp.de/api/templates/flexible_latex_template_tools/editor_meta"
headers = {"x-iw-jwt-token": "<TOKEN>"}
response = requests.get(url, headers=headers)
print(response.text)<?php
require_once('vendor/autoload.php');
$client = new \GuzzleHttp\Client();
$response = $client->request('GET', 'https://your-instance.iw-erp.de/api/templates/flexible_latex_template_tools/editor_meta', [
'headers' => [
'x-iw-jwt-token' => '<TOKEN>',
],
]);
echo $response->getBody();using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("https://your-instance.iw-erp.de/api/templates/flexible_latex_template_tools/editor_meta"),
Headers =
{
{ "x-iw-jwt-token", "<TOKEN>" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("https://your-instance.iw-erp.de/api/templates/flexible_latex_template_tools/editor_meta")
.get()
.addHeader("x-iw-jwt-token", "<TOKEN>")
.build();
Response response = client.newCall(request).execute();package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://your-instance.iw-erp.de/api/templates/flexible_latex_template_tools/editor_meta"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-iw-jwt-token", "<TOKEN>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}Dart with the iw_erp_api package
import 'package:iw_erp_api/clients/flexible_latex_template_controller.dart';
import 'package:iw_erp_api/logic/iw_api_state.dart';
IwApiState().host = 'your-instance.iw-erp.de';
IwApiState().currentJwtApiToken = '<TOKEN>';
final result = await FlexibleLatexTemplateController.getEditorMeta();
if (result.success) {
print(result.data);
}Validates an id for a new template and suggests a free id (from the name or the duplicated template).
GET/api/templates/flexible_latex_template_tools/id_check
Query parameters
idstring | ID to validate |
namestring | Template name the suggestion is built from |
base_idstring | ID of the duplicated template |
Responses
200Validation result and suggestion
curl --request GET \
--url https://your-instance.iw-erp.de/api/templates/flexible_latex_template_tools/id_check \
--header 'x-iw-jwt-token: <TOKEN>'const options = {method: 'GET', headers: {'x-iw-jwt-token': '<TOKEN>'}};
fetch('https://your-instance.iw-erp.de/api/templates/flexible_latex_template_tools/id_check', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://your-instance.iw-erp.de/api/templates/flexible_latex_template_tools/id_check"
headers = {"x-iw-jwt-token": "<TOKEN>"}
response = requests.get(url, headers=headers)
print(response.text)<?php
require_once('vendor/autoload.php');
$client = new \GuzzleHttp\Client();
$response = $client->request('GET', 'https://your-instance.iw-erp.de/api/templates/flexible_latex_template_tools/id_check', [
'headers' => [
'x-iw-jwt-token' => '<TOKEN>',
],
]);
echo $response->getBody();using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("https://your-instance.iw-erp.de/api/templates/flexible_latex_template_tools/id_check"),
Headers =
{
{ "x-iw-jwt-token", "<TOKEN>" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("https://your-instance.iw-erp.de/api/templates/flexible_latex_template_tools/id_check")
.get()
.addHeader("x-iw-jwt-token", "<TOKEN>")
.build();
Response response = client.newCall(request).execute();package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://your-instance.iw-erp.de/api/templates/flexible_latex_template_tools/id_check"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-iw-jwt-token", "<TOKEN>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}Dart with the iw_erp_api package
import 'package:iw_erp_api/clients/flexible_latex_template_controller.dart';
import 'package:iw_erp_api/logic/iw_api_state.dart';
IwApiState().host = 'your-instance.iw-erp.de';
IwApiState().currentJwtApiToken = '<TOKEN>';
final result = await FlexibleLatexTemplateController.getIdCheck();
if (result.success) {
print(result.data);
}Runs the template check ("Prüflauf") for the posted, not yet saved template state: Twig syntax, rendering with a minimal and a maximal data set of the data type and the PDF rendering.
POST/api/templates/flexible_latex_template_tools/check
Fields that are not posted are taken from the saved template with the same id.
Query parameters
render_pdfboolean | false skips the PDF rendering (default true) |
Responses
200Check report
curl --request POST \
--url https://your-instance.iw-erp.de/api/templates/flexible_latex_template_tools/check \
--header 'x-iw-jwt-token: <TOKEN>'const options = {method: 'POST', headers: {'x-iw-jwt-token': '<TOKEN>'}};
fetch('https://your-instance.iw-erp.de/api/templates/flexible_latex_template_tools/check', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://your-instance.iw-erp.de/api/templates/flexible_latex_template_tools/check"
headers = {"x-iw-jwt-token": "<TOKEN>"}
response = requests.post(url, headers=headers)
print(response.text)<?php
require_once('vendor/autoload.php');
$client = new \GuzzleHttp\Client();
$response = $client->request('POST', 'https://your-instance.iw-erp.de/api/templates/flexible_latex_template_tools/check', [
'headers' => [
'x-iw-jwt-token' => '<TOKEN>',
],
]);
echo $response->getBody();using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("https://your-instance.iw-erp.de/api/templates/flexible_latex_template_tools/check"),
Headers =
{
{ "x-iw-jwt-token", "<TOKEN>" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("https://your-instance.iw-erp.de/api/templates/flexible_latex_template_tools/check")
.post(null)
.addHeader("x-iw-jwt-token", "<TOKEN>")
.build();
Response response = client.newCall(request).execute();package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://your-instance.iw-erp.de/api/templates/flexible_latex_template_tools/check"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("x-iw-jwt-token", "<TOKEN>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}Dart with the iw_erp_api package
import 'package:iw_erp_api/clients/flexible_latex_template_controller.dart';
import 'package:iw_erp_api/logic/iw_api_state.dart';
import 'package:iw_erp_api/model/flexible_latex_template.dart';
IwApiState().host = 'your-instance.iw-erp.de';
IwApiState().currentJwtApiToken = '<TOKEN>';
final result = await FlexibleLatexTemplateController.postCheck(FlexibleLatexTemplate.fromJson({}));
if (result.success) {
print(result.data);
}Creates a template proposal from a PDF / image upload or a web page via OCR + AI. The result is not saved, the editor opens it like a duplicated template.
POST/api/templates/flexible_latex_template_tools/ai_import
Request body multipart/form-data
filestring (binary)PDF or image (PNG / JPG)
urlstringWeb page to convert instead of a file
render_typestringlatex or html
tagstringData type of the template (reference class key)
namestringName of the new template
hintstringAdditional instructions for the AI
Responses
200Template proposal with check report
curl --request POST \
--url https://your-instance.iw-erp.de/api/templates/flexible_latex_template_tools/ai_import \
--header 'content-type: multipart/form-data' \
--header 'x-iw-jwt-token: <TOKEN>' \
--form file='@datei.pdf'const form = new FormData();
form.append('file', 'datei.pdf');
const options = {method: 'POST', headers: {'x-iw-jwt-token': '<TOKEN>'}};
options.body = form;
fetch('https://your-instance.iw-erp.de/api/templates/flexible_latex_template_tools/ai_import', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://your-instance.iw-erp.de/api/templates/flexible_latex_template_tools/ai_import"
files = { "file": ("datei.pdf", open("datei.pdf", "rb"), "application/pdf") }
headers = {"x-iw-jwt-token": "<TOKEN>"}
response = requests.post(url, files=files, headers=headers)
print(response.text)<?php
require_once('vendor/autoload.php');
$client = new \GuzzleHttp\Client();
$response = $client->request('POST', 'https://your-instance.iw-erp.de/api/templates/flexible_latex_template_tools/ai_import', [
'multipart' => [
[
'name' => 'file',
'filename' => 'datei.pdf',
'contents' => null,
'headers' => [
'Content-Type' => 'application/pdf'
]
]
]
'headers' => [
'x-iw-jwt-token' => '<TOKEN>',
],
]);
echo $response->getBody();using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("https://your-instance.iw-erp.de/api/templates/flexible_latex_template_tools/ai_import"),
Headers =
{
{ "x-iw-jwt-token", "<TOKEN>" },
},
Content = new MultipartFormDataContent
{
new StringContent("")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/pdf"),
ContentDisposition = new ContentDispositionHeaderValue("form-data")
{
Name = "file",
FileName = "datei.pdf",
}
}
},
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("multipart/form-data; boundary=---011000010111000001101001");
RequestBody body = RequestBody.create(mediaType, "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"datei.pdf\"\r\nContent-Type: application/pdf\r\n\r\n\r\n-----011000010111000001101001--");
Request request = new Request.Builder()
.url("https://your-instance.iw-erp.de/api/templates/flexible_latex_template_tools/ai_import")
.post(body)
.addHeader("x-iw-jwt-token", "<TOKEN>")
.build();
Response response = client.newCall(request).execute();package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://your-instance.iw-erp.de/api/templates/flexible_latex_template_tools/ai_import"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"datei.pdf\"\r\nContent-Type: application/pdf\r\n\r\n\r\n-----011000010111000001101001--")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-iw-jwt-token", "<TOKEN>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}Dart with package:http (no controller in the iw_erp_api package)
import 'package:http/http.dart' as http;
final request = http.MultipartRequest('POST', Uri.parse('https://your-instance.iw-erp.de/api/templates/flexible_latex_template_tools/ai_import'));
request.headers['x-iw-jwt-token'] = '<TOKEN>';
request.files.add(await http.MultipartFile.fromPath('file', 'datei.pdf'));
final response = await request.send();
print(await response.stream.bytesToString());