自 2021 年 1 月起,经典文件类型不再可用。您可以转换经典文件或下载 PDF 文件。了解更多

Create a table API JSON Body

已回答
0

评论

1 条评论

  • Jeff Hickey

    Hi Jase the Ace, please see TableDto type for more information about the body parameter of the Create a new table endpoint.

    At minimum, you must include "name", "tableScehma", and "type." "datasetUpdated", "hierarchyMetadata", and "uniqueTableConstraints" can be omitted. Below is sample Python request that uses the minimum body payload to create a new Data table called "Table Name" with the column "columnName" of type string (update values in italics).

    import requests
    import json

    url = "https://h.<location>.wdesk.com/s/wdata/prep/api/v1/table"

    payload = json.dumps({
    "name": "Table Name",
    "tableSchema": {
      "columns": [
        {
          "name": "columnName",
          "type": "string"
        }
      ]
    },
    "type": "data"
    })

    headers = {
    'Content-Type': 'application/json',
    'Accept': 'application/json',
    'Authorization': '<valid token>'
    }

    response = requests.request("POST", url, headers=headers, data=payload)
    print(response.text)
    0

请先登录再写评论。