Moduł odpowiedzialny za zarządzanie grupami szablonów - listowanie, tworzenie, modyfikacja, usuwanie.
Endpointy obsługujące żądanie:
https://api.5ways.comGET /rest/template_group
Zwraca listę grup
HTTP/1.1 200 OK
{
"TemplateGroup": {
"id": "1",
"customer_id": "82",
"name": "Księgowe",
"sequence": "0",
"created": "2018-03-21 09:18:35",
"modified": "2018-03-21 09:18:35"
}
},
{
"TemplateGroup": {
"id": "43",
"customer_id": "82",
"name": "Techniczne",
"sequence": "0",
"created": "2018-05-08 08:56:58",
"modified": "2018-05-08 08:56:58"
}
}
GET /rest/template_group/template
Zwraca listę grup złączoną z listą szablonów
HTTP/1.1 200 OK
{
"TemplateGroup": {
"id": "5",
"customer_id": "82",
"name": "Template Group 1",
"sequence": "0",
"created": "2018-07-05 09:50:42",
"modified": "2018-07-05 09:50:42"
},
"Template": [
{
"id": "5",
"customer_id": "82",
"template_group_id": "5",
"name": "Szablon 1",
"body": "Treść szablonu 1.",
"keywords": "",
"sequence": "0",
"created": "2018-07-05 09:58:22",
"modified": "2018-07-05 09:58:22"
},
{
"id": "6",
"customer_id": "82",
"template_group_id": "5",
"name": "Księgowanie faktury za paliwo",
"body": "Lorem ipsum dolor sit amet, consectetur adipiscing elit.",
"keywords": "",
"sequence": "0",
"created": "2018-09-14 12:35:00",
"modified": "2018-09-14 12:35:00"
}
]
},
{
"TemplateGroup": {
"id": "7",
"customer_id": "82",
"name": "Księgowe",
"sequence": "0",
"created": "2018-09-24 09:11:45",
"modified": "2018-09-24 09:11:45"
},
"Template": [
{
"id": "9",
"customer_id": "82",
"template_group_id": "7",
"name": "Księgowanie faktury za paliwo",
"body": "Aby zaksięgować fakturę za paliwo...",
"keywords": "",
"sequence": "0",
"created": "2018-09-24 09:11:54",
"modified": "2018-09-24 09:11:54"
}
]
}
GET /rest/template_group/{id}
Zwraca dane grupy szablonów na podstawie podanego ID
HTTP/1.1 200 OK
{
"TemplateGroup": {
"id": "43",
"customer_id": "82",
"name": "Techniczne",
"sequence": "0",
"created": "2018-05-08 08:56:58",
"modified": "2018-05-08 08:56:58"
}
}
POST /rest/template_group
Tworzy nową grupę
{
"TemplateGroup": {
"name": "Księgowe"
}
}
Zwraca obiekt z id nowo utworzonej grupy szablonów
HTTP/1.1 201 Created
location: https://api.5ways.com/rest/template_group/{id}
{
"id": 115
}
PUT /rest/template_group/{id}
Modyfikuje dane grupy
{
"TemplateGroup": {
"name": "Księgowość"
}
}
HTTP/1.1 200 OK
{
"status": "OK"
}
DELETE /rest/template_group/{id}
Trwale usuwa grupę
HTTP/1.1 200 OK
{
"status": "OK"
}