CommonFile

Moduł odpowiedzialny za zarządzanie plikami - listowanie, tworzenie, modyfikacja, usuwanie.

Endpointy obsługujące żądanie:

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

Pobieranie listy plików

GET /rest/common_file

Zwraca listę plików

Zwracane dane
HTTP/1.1 200 OK
{
    "CommonFile": {
        "id": "1",
        "customer_id": "1",
        "name": "screen_1.jpg",
        "filename": "screen_1.jpg",
        "mime": "image/jpeg",
        "size": "5090",
        "virus_scan_status": "ok",
        "virus_scan_error": null,
        "file_not_exists": "0",
        "compression": "none",
        "type": "normal",
        "created": "2018-05-17 11:31:32",
        "modified": "2018-05-18 08:09:13"
    }
},
{
    "CommonFile": {
        "id": "4",
        "customer_id": "1",
        "name": "screen_2.jpg",
        "filename": "screen_2.jpg",
        "mime": "image/jpeg",
        "size": "263254",
        "virus_scan_status": "pending",
        "virus_scan_error": null,
        "file_not_exists": "0",
        "compression": "none",
        "type": "normal",
        "created": "2018-05-18 13:31:40",
        "modified": "2018-05-18 13:31:40"
    }
}

Pobieranie listy plików złączonych z powiązaniami

GET /rest/common_file/common_file_object

Zwraca listę spraw złączoną z powiązaniami

Zwracane dane
HTTP/1.1 200 OK
{
    "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"
    },
    "CommonFileObject": {
        "id": "3",
        "customer_id": "82",
        "common_file_id": "10",
        "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"
    },
    "CommonFileObject": {
        "id": "4",
        "customer_id": "82",
        "common_file_id": "11",
        "object_name": "IssueSentence",
        "object_id": "10"
    }
}

Pobieranie wybranego pliku

GET /rest/common_file/{id}

Zwraca plik

Tworzenie pliku

POST /rest/common_file

Tworzy nowy plik

Treść żądania
content-type: multipart/form-data

$_FILES['file']
Odpowiedź

Zwraca obiekt z id nowo dodanego pliku

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

Usuwanie pliku

DELETE /rest/common_file/{id}

Trwale usuwa plik

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