Tải Lên Tài Liệu
1.1 Mục đích sử dụng :
Dùng để tải 1 tài liệu lên hệ thống xFile theo các thông số bên dưới
1.1. URI :
Name | Description |
---|---|
URI | {{gateway}}/v1/api/doc/upload |
Content-Type | application/json |
Method | POST |
1.2. Request :
1.2.1 Request Headers
Name | Required | Description | Remarks |
---|---|---|---|
X-API-Key | Y | API Key AWS | |
Authorization | Y | [xFile cấp cho đối tác] |
|
1.2.2 Request Body - multipart/form-data:
Name | Type | Required | Description | Remarks |
---|---|---|---|---|
file | Binary | Y | File tài liệu upload lên xFile |
|
cmd | JSON | Y | Thông tin metadata theo file tải lên |
1.2.3 Mô tả chi tiết các tham số :
1.2.3.1 Tham số cmd :
Name | Type | Required | Description | Remarks |
---|---|---|---|---|
fileName | String | Y | File tài liệu upload lên xFile |
|
docTypeCode | String | Y | Thông tin metadata theo file tải lên | |
folderRefCode | String | Y | Mã thư mục để upload tài liệu | |
props | Object | OPTION | các thuộc tính bổ sung (tùy chọn) |
1.2.4 Request Sample :
Request URI :
{{gateway}}/v1/api/doc/upload
Request Body form-data :
Name | Value |
---|---|
file | /Doc/document1.pdf |
cmd | {"fileName": "a.pdf", "docTypeCode": "DT-0006", "folderRefCode":"778fdd8077daf933fd5c943577620c04ed5368af5bc69124e1b4c68702aaa55aa70a03341f0645e5c850885e0c9a81c9fd179c2903b9874be135a6ecc658e834" ,"props": { } } |
1.3. Response :
1.3.1 Response Body JSON:
Name | Type | Description | Remarks |
---|---|---|---|
status | Long | Trạng thái kết quả api trả về | 0 : Thành công 1 : Thất bại |
data | Object | Kết quả api trả về | RefCode của tài liệu đã upload : Upload file thành công Null : Upload tài liệu Thất bại |
1.3.2 Response Sample:
Response Success data |
---|
{ "status": 0, "data": "0221dc12-0fb6-4980-a01c-fd8b93a65f0e" }
|
Response- Not Found data |
---|
{ "status": 0, "data": null } |
Last updated