Update a single table#
Description#
Updates an existing table with the provided information. Include all user-defined table columns with the request. For type, specify either a dimension or data table. In the interface, data tables appear as fact tables.
If the table has no imported data, user-defined columns not included with the request are deleted, and columns are sorted according to their order in the request.
If the table has imported data, any columns with names not already in the table are considered new. This equality check is case-insensitive. Any new columns appear after other user-defined columns, but before any meta columns, which start with
_.
PUT /api/v1/table/{tableId}
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 |
true |
The representation of the table to update |
Body parameter example#
{
"datasetUpdated": "2019-08-24T14:15:22Z",
"description": "string",
"hierarchyMetadata": {
"childColumnId": "string",
"parentColumnId": "string"
},
"name": "string",
"tableSchema": {
"columns": [
{
"alias": "string",
"description": "string",
"metadata": {
"property1": null,
"property2": null
},
"mode": "nullable",
"name": "string",
"type": "string"
}
]
},
"type": "data",
"uniqueTableConstraints": [
{
"description": "string",
"id": "string",
"name": "key_columns",
"tableId": "string",
"values": [
"string"
]
}
]
}
Code Samples#
curl -X PUT https://h.app.wdesk.com/s/wdata/prep/api/v1/table/{tableId} \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
http PUT https://h.app.wdesk.com/s/wdata/prep/api/v1/table/{tableId} \
Content-Type:application/json \
Accept:application/json \
Authorization:"Bearer {access-token}"
wget --method=PUT "https://h.app.wdesk.com/s/wdata/prep/api/v1/table/{tableId}" \
--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.put('https://h.app.wdesk.com/s/wdata/prep/api/v1/table/{tableId}', headers = headers)
print(r.json())
Returns#
200 - OK#
Returns a JSON object with a body property, which contains a TableDto object for the updated table.
Example Responses#
{
"body": {
"created": "string",
"databaseId": "string",
"datasetUpdated": "string",
"deleted": "boolean",
"description": "string",
"hierarchyMetadata": {
"childColumnId": "string",
"parentColumnId": "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"
}