随着Flash的结束,传统文件类型将在2020年12月消失。为避免中断,请开始将文件过渡到下一代。 学到更多

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

请先登录再写评论。