附件與檔案

建立新附件 (整合)

POST /api/attachments-upload/

程式碼範例

# 呼叫 API 示例 (Shell)
curl -X POST "https://api.maiagent.ai/api/attachments-upload/" \
  -H "Authorization: Api-Key YOUR_API_KEY" \
  -F "file=@example_file.pdf"

# 請確認在執行前替換 YOUR_API_KEY 並核對請求資料。

回應內容

狀態碼
說明

200

No response body


取得檔案上傳用的預簽署 URL (建立/取得)

POST /api/upload-presigned-url/

參數

參數名稱
必填
類型
說明

fieldName

string

欄位名稱

filename

string

檔案名稱

modelName

string

模型名稱

請求內容

請求參數

欄位
類型
必填
說明

fileSize

integer

請求結構範例

請求範例值

程式碼範例

回應內容

狀態碼: 200

回應結構範例

回應範例值


Presigned 上傳附件

POST /api/attachments/

請求內容

請求參數

欄位
類型
必填
說明

type

object

filename

string

file

string (uri)

請求結構範例

請求範例值

程式碼範例

回應內容

狀態碼: 201

回應結構範例

回應範例值


建立對話附件

POST /api/conversations/{conversationPk}/attachments/

參數

參數名稱
必填
類型
說明

conversationPk

string

請求內容

請求參數

欄位
類型
必填
說明

type

object

filename

string

file

string (uri)

conversation

string (uuid)

請求結構範例

請求範例值

程式碼範例

回應內容

狀態碼: 201

回應結構範例

回應範例值


Last updated

Was this helpful?