|
2021년 1월부터 기존 파일 형식을 더 이상 사용할 수 없습니다. 기존 파일을 전환하거나 PDF를 다운로드할 수 있습니다. 자세히 알아보기

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

답변함
0

댓글

댓글 1개

  • 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

댓글을 남기려면 로그인하세요.