|
Klassiska filtyper är inte längre tillgängliga för användning från och med januari 2021. Du kan överföra dina klassiska filer eller ladda ner en PDF. Läs mer

Getting error 500 when trying to create a table using an API

Besvarat
0

Kommentarer

1 kommentar

  • Jeff Hickey

    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,
    Jeff

    0

Du måste logga in om du vill lämna en kommentar.