Getting error 500 when trying to create a table using an API
RespondidaI am using API endpoint https://h.eu.wdesk.com/s/wdata/prep/api/v1/table
Where I am trying to create a new table.
My SCOPES in Workiva are:
data_tables|w,task:read,task:write,file:read,file:write,activity:read,data_tables|r
All I get back is the following error:
HTTPError: 500 Server Error: Internal Server Error for url: https://h.eu.wdesk.com/s/wdata/prep/api/v1/table
Could someone please advise what could be wrong?
-
Hi Juraj Kuceravy,
It appears your request is malformed which is the cause of the 500 error. When creating a data table, the TableDto payload at minimum needs to have a name, tableSchema property, and type. For example:
{
"name": "string",
"tableSchema": {
"columns": [
{
"description": "string",
"mode": "nullable",
"name": "string",
"type": "string"
}
]
},
"type": "data"
}Below is an example request in Python:
import requests
url = "https://h.eu.wdesk.com/s/wdata/prep/api/v1/table"
payload = {
"name": "string",
"tableSchema": { "columns": [
{
"description": "string",
"mode": "nullable",
"name": "string",
"type": "string"
}
] },
"type": "data"
}
headers = {
"content-type": "application/json",
"accept": "application/json",
"authorization": "Bearer <valid_token>"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())For more information, please see https://developers.workiva.com/wdata-v1/wdata-createtable.html
Thanks,
Jeff0Iniciar sesión para dejar un comentario.
Comentarios
1 comentario