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

multipart form-data

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/fotrm-data:

Name
Type
Required
Description
Remarks

file

Binary

Y

File tài liệu upload lên xFile

cmd

String

Y

Thông tin metadata theo file tải lên

(Định dạng JSON)

1.2.3 Mô tả chi tiết các tham số :

1.2.3.1 Tham số cmd :

1/ fileName : tên tài liệu upload

2/ objCode : Mã đối tượng upload (tùy chọn)

3/ objTypeCode : Mã loại đối tượng

4/ docTypeCode : Mã loại tài liệu

5/ props : 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": "document1.pdf", "objCode": "1407123", "objTypeCode": "0001", "docTypeCode": "ICL001","props": { "province_id": "125", "customer_name": "Nguyen Van A", "contract_no": "1407123" } }

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