|
Los tipos de archivo clásicos dejarán de estar disponibles a partir de enero de 2021. Puedes migrar tus archivos clásicos o descargar un PDF. Más información

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

Respondida
0

Comentarios

1 comentario

  • 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

Iniciar sesión para dejar un comentario.