Creates documents by importing data from external sources. Dialogflow supports up to 350 documents in each request. If you try to import more, Dialogflow will return an error.
This method is a long-running operation. The returned Operation
type has the following method-specific fields:
metadata
:KnowledgeOperationMetadata
response
:ImportDocumentsResponse
HTTP request
POST https://{endpoint}/v2/{parent=projects/*/locations/*/knowledgeBases/*}/documents:import
Where {endpoint}
is one of the supported service endpoints.
The URLs use gRPC Transcoding syntax.
Path parameters
Parameters | |
---|---|
parent |
Required. The knowledge base to import documents into. Format: Authorization requires the following IAM permission on the specified resource
|
Request body
The request body contains data with the following structure:
JSON representation |
---|
{ "documentTemplate": { object ( |
Fields | |
---|---|
document |
Required. Document template used for importing all the documents. |
import |
Whether to import custom metadata from Google Cloud Storage. Only valid when the document source is Google Cloud Storage URI. |
Union field If the source captures multiple objects, then multiple documents will be created, one corresponding to each object, and all of these documents will be created using the same document template. Dialogflow supports up to 350 documents in each request. If you try to import more, Dialogflow will return an error. |
|
gcs |
Optional. The Google Cloud Storage location for the documents. The path can include a wildcard. These URIs may have the forms |
Response body
If successful, the response body contains an instance of Operation
.
Authorization scopes
Requires one of the following OAuth scopes:
https://www.googleapis.com/auth/cloud-platform
https://www.googleapis.com/auth/dialogflow
For more information, see the Authentication Overview.