IssueSentence

Moduł odpowiedzialny za zarządzanie postami spraw - listowanie, tworzenie, modyfikacja.

Endpointy obsługujące żądanie:

  • https://api.5ways.com
  • https://api.client.5ways.com

Pobieranie listy postów

GET /rest/issue_sentence

Zwraca listę postów oraz listę załączników do danego posta

Zwracane dane
HTTP/1.1 200 OK
{
    "IssueSentence": {
        "id": "1",
        "customer_id": "82",
        "issue_id": "1",
        "speaker": "initiator",
        "speaker_id": "104",
        "template_id": "5",
        "object_name": null,
        "object_id": null,
        "body": "test edycji",
        "status": "sent",
        "rejected": "0",
        "corrected": "0",
        "waiting_since": "2018-09-11 09:00:00",
        "waiting_time": null,
        "created": "2018-09-11 08:45:34",
        "modified": "2018-10-02 10:28:30"
    },
    "CommonFileObject": []
},
{
    "IssueSentence": {
        "id": "2",
        "customer_id": "82",
        "issue_id": "1",
        "speaker": "initiator",
        "speaker_id": "104",
        "template_id": "5",
        "object_name": null,
        "object_id": null,
        "body": "lorem ipsum",
        "status": "sent",
        "rejected": "0",
        "corrected": "0",
        "waiting_since": "2018-09-11 09:00:00",
        "waiting_time": null,
        "created": "2018-09-11 08:45:34",
        "modified": "2018-10-02 10:28:30"
    },
    "CommonFileObject": [
        {
            "id": "3",
            "customer_id": "82",
            "common_file_id": "10",
            "object_name": "IssueSentence",
            "object_id": "10",
            "CommonFile": {
                "id": "10",
                "customer_id": "82",
                "name": "Nowy dokument tekstowy.txt",
                "filename": "Nowy dokument tekstowy.txt",
                "mime": "text/plain",
                "size": "130",
                "virus_scan_status": "ok",
                "virus_scan_error": null,
                "file_not_exists": "0",
                "compression": "none",
                "type": "normal",
                "created": "2018-07-13 14:28:08",
                "modified": "2018-07-13 14:29:13"
            }
        },
        {
            "id": "4",
            "customer_id": "82",
            "common_file_id": "11",
            "object_name": "IssueSentence",
            "object_id": "10",
            "CommonFile": {
                "id": "11",
                "customer_id": "82",
                "name": "Screenshot_20180713-081027.png",
                "filename": "Screenshot_20180713-081027.png",
                "mime": "image/png",
                "size": "128918",
                "virus_scan_status": "ok",
                "virus_scan_error": null,
                "file_not_exists": "0",
                "compression": "none",
                "type": "normal",
                "created": "2018-07-13 14:28:09",
                "modified": "2018-07-13 14:29:25"
            }
        }
    ]
}

Pobieranie listy postów złączonych z innymi tabelami

GET /rest/issue_sentence/issue_initiator

Zwraca listę postów złączoną z listą klientów

Zwracane dane
HTTP/1.1 200 OK
{
    "IssueSentence": {
        "id": "1",
        "customer_id": "82",
        "issue_id": "1",
        "speaker": "initiator",
        "speaker_id": "104",
        "body": "test edycji",
        "status": "draft",
        "rejected": "0",
        "corrected": "0",
        "created": "2018-09-11 08:45:34",
        "modified": "2018-10-02 10:28:30"
    },
    "IssueInitiator": {
        "id": "104",
        "customer_id": "82",
        "external_user_id": "1322",
        "email": "jan.nowak@respondo.pl",
        "first_name": "Jan",
        "last_name": "",
        "name": "Jan",
        "phone": "",
        "created": "2018-11-12 21:12:11",
        "modified": "2018-11-12 21:12:11"
    },
    "CommonFileObject": []
},
{
    "IssueSentence": {
        "id": "2",
        "customer_id": "82",
        "issue_id": "2",
        "speaker": "initiator",
        "speaker_id": "1",
        "body": "Lorem ipsum dolor sit amet, consectetur adipiscing elit.",
        "status": "draft",
        "rejected": "0",
        "corrected": "0",
        "created": "2018-09-11 08:47:16",
        "modified": "2018-09-11 08:47:16"
    },
    "IssueInitiator": {
        "id": "1",
        "customer_id": "82",
        "external_user_id": "70115",
        "email": "jan.nowicki@respondo.pl",
        "first_name": "Jan",
        "last_name": "Nowicki",
        "name": "Jan Nowicki",
        "phone": "",
        "created": "2018-09-10 14:51:17",
        "modified": "2018-09-11 12:39:12"
    },
    "CommonFileObject": []
}

GET /rest/issue_sentence/user

Zwraca listę postów złączoną z listą użytkowników

Zwracane dane
HTTP/1.1 200 OK
{
    "IssueSentence": {
        "id": "1",
        "customer_id": "82",
        "issue_id": "1",
        "speaker": "initiator",
        "speaker_id": "104",
        "body": "test edycji",
        "status": "draft",
        "rejected": "0",
        "corrected": "0",
        "created": "2018-09-11 08:45:34",
        "modified": "2018-10-02 10:28:30"
    },
    "User": {
        "id": "122",
        "customer_id": "82",
        "user_role_id": "38",
        "mentor_id": "0",
        "email": "jan.kowalski@wfirma.pl",
        "firstname": "Jan",
        "lastname": "Kowalski",
        "active": "1",
        "banned": "0",
        "phone": "",
        "password": "v3:fdf02c2530c4944943794f5de30bad70:a2c12b788faf76193e54c88b4593b4f7",
        "description": "",
        "ip": "",
        "referer": "",
        "user_created_id": "",
        "created": "2018-07-20 07:44:13",
        "modified": "2018-09-17 14:35:22"
    },
    "CommonFileObject": []
},
{
    "IssueSentence": {
        "id": "2",
        "customer_id": "82",
        "issue_id": "2",
        "speaker": "initiator",
        "speaker_id": "1",
        "body": "Lorem ipsum dolor sit amet, consectetur adipiscing elit.",
        "status": "draft",
        "rejected": "0",
        "corrected": "0",
        "created": "2018-09-11 08:47:16",
        "modified": "2018-09-11 08:47:16"
    },
    "User": {
        "id": "122",
        "customer_id": "82",
        "user_role_id": "38",
        "mentor_id": "0",
        "email": "jan.kowalski@wfirma.pl",
        "firstname": "Jan",
        "lastname": "Kowalski",
        "active": "1",
        "banned": "0",
        "phone": "",
        "password": "v3:fdf02c2530c4944943794f5de30bad70:a2c12b788faf76193e54c88b4593b4f7",
        "description": "",
        "ip": "",
        "referer": "",
        "user_created_id": "",
        "created": "2018-07-20 07:44:13",
        "modified": "2018-09-17 14:35:22"
    },
    "CommonFileObject": []
}

Pobieranie wybranego posta

GET /rest/issue_sentence/{id}

Zwraca dane posta na podstawie podanego ID

Zwracane dane
HTTP/1.1 200 OK
{
    "IssueSentence": {
        "id": "1",
        "customer_id": "82",
        "issue_id": "1",
        "speaker": "initiator",
        "speaker_id": "104",
        "template_id": "5",
        "object_name": null,
        "object_id": null,
        "body": "test edycji",
        "status": "sent",
        "rejected": "0",
        "corrected": "0",
        "waiting_since": "2018-09-11 09:00:00",
        "waiting_time": null,
        "created": "2018-09-11 08:45:34",
        "modified": "2018-10-02 10:28:30"
    }
}

Tworzenie posta

POST /rest/issue_sentence

Tworzy nowy post w sprawie

Treść żądania
{
  "IssueSentence": {
      "speaker": "initiator",
      "speaker_id": "4",
      "status": "draft",
      "body": "test",
      "issue_id": 13
  }
}
Odpowiedź

Zwraca obiekt z id nowo utworzonego posta

HTTP/1.1 201 Created
location: https://api.5ways.com/rest/issue_sentence/{id}
{
    "id": 115
}

Modyfikowanie posta

PUT /rest/issue_sentence/{id}

Modyfikuje post

Treść żądania
{
    "IssueSentence": {
        "speaker": "initiator",
        "speaker_id": "4",
        "status": "draft",
        "body": "test",
        "issue_id": 13
    }
}
Odpowiedź
HTTP/1.1 200 OK
{
    "status": "OK"
}

Usuwanie posta

DELETE /rest/issue_sentence/{id}

Trwale usuwa post

Odpowiedź

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