API Reference

Create a new table

Description

Creates a table in the database with the specified schema. For type, specify either a dimension or data table. In the interface, data tables appear as fact tables.

POST /api/v1/table

🚧

Required OAuth Scopes:

No OAuth scopes are required to use this endpoint.

Parameters

ParameterInTypeRequiredDescription
bodybodyTableDtotrueThe representation of the table to create

Body parameter example

{
  "datasetUpdated": "2019-08-24T14:15:22Z",
  "description": "string",
  "isShared": false,
  "name": "string",
  "tableSchema": {
    "columns": [
      {
        "alias": "string",
        "description": "string",
        "metadata": {
          "property1": {},
          "property2": {}
        },
        "mode": "nullable",
        "name": "string",
        "type": "string"
      }
    ]
  },
  "type": "data",
  "uniqueTableConstraints": [
    {
      "description": "string",
      "id": "string",
      "name": "key_columns",
      "tableId": "string",
      "values": [
        "string"
      ]
    }
  ]
}

Code Samples

curl -X POST https://h.app.wdesk.com/s/wdata/prep/api/v1/table  \ 
-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  \ 
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" \
 --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', headers = headers)

print(r.json())

Returns

201 - Created

Returns a JSON object with a body property, which contains a TableDto object for the created table.

Example Responses


{
  "body": {
    "created": "string",
    "databaseId": "string",
    "datasetUpdated": "string",
    "deleted": "boolean",
    "description": "string",
    "id": "string",
    "isShared": "boolean",
    "lastUploaded": "string",
    "name": "string",
    "parentId": "string",
    "readOnly": "boolean",
    "tableSchema": {
      "columns": [
        {
          "alias": "string",
          "description": "string",
          "metadata": {},
          "mode": "string",
          "name": "string",
          "type": "string"
        }
      ]
    },
    "type": "string",
    "uniqueTableConstraints": [
      {
        "description": "string",
        "id": "string",
        "name": "string",
        "tableId": "string",
        "values": [
          "string"
        ]
      }
    ],
    "updated": "string",
    "userId": "string",
    "version": "integer"
  },
  "code": "integer"
}