Import a single file#

Description#

Imports the provided file into the associated table, and immediately returns a file meta object with an ID that can be used to poll the file controller for status.

POST /api/v1/table/{tableId}/import

Required OAuth Scopes

No OAuth scopes are required to use this endpoint.

Parameters#

Parameter

In

Type

Required

Description

tableId

path

string

true

The unique identifier of the table

body

body

ImportDto

true

The representation of the table to import

Body parameter example#

{
  "columnMappings": "{import column id:\"table column id\"}",
  "delimiter": "string",
  "fileId": "string",
  "metadata": {
    "property1": {
      "property1": null,
      "property2": null
    },
    "property2": {
      "property1": null,
      "property2": null
    }
  },
  "tags": {
    "key": "value"
  }
}

Code Samples#

curl -X POST https://h.app.wdesk.com/s/wdata/prep/api/v1/table/{tableId}/import \
    -H 'Content-Type: application/json' \
    -H 'Accept: application/json' \
    -H 'Authorization: Bearer {access-token}'
http POST https://h.app.wdesk.com/s/wdata/prep/api/v1/table/{tableId}/import \
    Content-Type:application/json \
    Accept:application/json \
    Authorization:"Bearer {access-token}"
wget --method=POST "https://h.app.wdesk.com/s/wdata/prep/api/v1/table/{tableId}/import" \
    --output-document -  \ 
    --header 'Content-Type: application/json' \ 
    --header 'Accept: application/json' \ 
    --header 'Authorization: Bearer {access-token}'
import requests

headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {access-token}'
}

r = requests.post('https://h.app.wdesk.com/s/wdata/prep/api/v1/table/{tableId}/import', headers = headers)

print(r.json())

Returns#

200 - OK#

Returns a JSON object with a body property, which contains a FileMetaDto object for the imported file.

Example Responses#

{
  "body": {
    "columnMappings": {},
    "created": "string",
    "delimiter": "string",
    "id": "string",
    "key": "string",
    "metadata": {},
    "name": "string",
    "numErrors": "integer",
    "numRecords": "integer",
    "originalFileSize": "integer",
    "source": "string",
    "status": "string",
    "tableId": "string",
    "tags": {},
    "updated": "string",
    "userId": "string",
    "version": "integer"
  },
  "code": "integer"
}