Method: projects.locations.dataStores.branches.documents.create

建立 Document。

HTTP 要求


POST https://discoveryengine.googleapis.com/v1/{parent=projects/*/locations/*/dataStores/*/branches/*}/documents

這些網址使用 gRPC 轉碼語法。

路徑參數

參數
parent

string

這是必要旗標,上層資源名稱,例如 projects/{project}/locations/{location}/collections/{collection}/dataStores/{dataStore}/branches/{branch}。

查詢參數

參數
documentId

string

這是必要旗標,要用於 Document 的 ID,這會成為 Document.name 的最終元件。

如果呼叫端沒有建立 Document 的權限 (無論該 是否存在),系統都會傳回 PERMISSION_DENIED 錯誤。

在具有相同 parent 的所有 Document 中,這個欄位不得重複。否則會傳回 ALREADY_EXISTS 錯誤。

這個欄位必須符合 RFC-1034 標準,長度上限為 128 個字元。否則會傳回 INVALID_ARGUMENT 錯誤。

要求主體

要求主體包含 Document 的執行個體。

回應主體

如果成功,回應主體會包含新建立的 Document 執行個體。

授權範圍

需要下列其中一種 OAuth 範圍:

  • https://www.googleapis.com/auth/cloud-platform
  • https://www.googleapis.com/auth/discoveryengine.readwrite
  • https://www.googleapis.com/auth/discoveryengine.serving.readwrite

詳情請參閱Authentication Overview。

IAM 權限

需要 parent 資源的下列 IAM 權限:

  • discoveryengine.documents.create

詳情請參閱 IAM 說明文件。