TemplateGroup

Moduł odpowiedzialny za zarządzanie grupami szablonów - listowanie, tworzenie, modyfikacja, usuwanie.

Endpointy obsługujące żądanie:

  • https://api.5ways.com

Pobieranie listy grup szablonów

GET /rest/template_group

Zwraca listę grup

Zwracane dane
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"
    }
}

Pobieranie listy grup złączonych z innymi tabelami

GET /rest/template_group/template

Zwraca listę grup złączoną z listą szablonów

Zwracane dane
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"
        }
    ]
}

Pobieranie wybranej grupy szablonów

GET /rest/template_group/{id}

Zwraca dane grupy szablonów na podstawie podanego ID

Zwracane dane
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"
    }
}

Tworzenie grupy szablonów

POST /rest/template_group

Tworzy nową grupę

Treść żądania
{
    "TemplateGroup": {
        "name": "Księgowe"
    }
}
Odpowiedź

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
}

Modyfikowanie grupy szablonów

PUT /rest/template_group/{id}

Modyfikuje dane grupy

Treść żądania
{
    "TemplateGroup": {
        "name": "Księgowość"
    }
}
Odpowiedź
HTTP/1.1 200 OK
{
    "status": "OK"
}

Usuwanie grupy szablonów

DELETE /rest/template_group/{id}

Trwale usuwa grupę

Odpowiedź
HTTP/1.1 200 OK
{
    "status": "OK"
}