Import data asynchronously
Imports data into an existing table from a CSV file or from a workspace. The source is selected by the request body.
From a CSV file
The actual data must be provided in dataFileId. An imported file can be sliced into multiple chunks; the conditions described in File Uploads must be satisfied. The CSV file can be raw or gzipped. Gzipped files must have the extension .gz. A typical asynchronous import negotiation consists of these steps:
- Upload a CSV file using File Upload.
- Submit an asynchronous import request with dataFileId set to the File ID returned in the previous step.
- Poll job resource returned in the previous step until the status is success or error.
Specific behavior of BigQuery: if the treatValuesAsNull parameter is an empty array in the request, no values will be converted to NULL.
From a workspace
The actual data must be provided in dataWorkspaceId and dataObject (older dataTableName is deprecated). Import from table and file workspace is supported.
- For table workspace use dataWorkspaceId and set dataObject with name of source table.
- For file workspace use dataWorkspaceId and dataObject can be a single file file.csv, a folder folder/ (mind the trailing slash) or a manifest file.csvmanifest.
- For file workspace always use columns[] attribute with list of imported columns.
Further information can be found in the Developers Documentation.
Request
- Base URLhttps://connection.keboola.com
- Auth
- API key in header X-StorageApi-Token
- or API key in header X-KBC-ManageApiToken
- or HTTP bearer
- TypeScriptA function with typed inputs. Its response is checked against the schema.
Path parameters
Target table ID.
Headers
Request body
Example request
{
"dataFileId": 12345,
"treatValuesAsNull": [
""
],
"columns": [
"id",
"name"
],
"enclosure": "\"",
"delimiter": ","
}Response
Import job accepted; returns job details.
Example response
{
"id": "22077337",
"status": "waiting",
"url": "https://connection.keboola.com/v2/storage/jobs/22077337",
"tableId": null,
"operationName": "workspaceLoad",
"operationParams": {
"workspaceId": "78423",
"preserve": false,
"input": [
{
"source": "in.c-application-testing.cashier-data",
"destination": "my-table"
}
],
"queue": "main_fast"
},
"createdTime": "2017-02-13T16:41:18+0100",
"startTime": null,
"endTime": null,
"runId": null,
"results": null,
"creatorToken": {
"id": "27978",
"description": "john.doe@keboola.com"
},
"actor": {
"type": "token",
"id": "27978",
"name": "john.doe@keboola.com",
"adminId": 1234
},
"metrics": {
"inCompressed": false,
"inBytes": 0,
"inBytesUncompressed": 0,
"outCompressed": false,
"outBytes": 0,
"outBytesUncompressed": 0
}
}Changes
No recorded changes to this operation across all 1 revision of this API.