|
Klassieke bestandstypen zijn vanaf januari 2021 niet meer beschikbaar voor gebruik. U kunt uw klassieke bestanden omzetten of een PDF downloaden. Meer informatie

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

Beantwoord
0

Opmerkingen

1 opmerking

  • 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

U moet u aanmelden om een opmerking te plaatsen.