500 Internal Server Error - API create_item

Hello,

I am trying to create a new item in one of my boards.

I will make the API call from JavaScript according to the documentation but I have tried multiple ways using Postman and I keep getting error “500 Internal Server Error”. Now i don’t know what mistake I am doing as no explanation is given…

Any help is appreciated. Thank you!

Hi @sergiuwaxmann

Welcome to the community! It looks like the JSON columnValues is not correct. You need to supply a stringified version of an object and the object should contain (as an example for date):

columnmnValues: {date: { date: "2022-12-06}}

Where the first occurrence of 'date" refers to the columnId and the second occurence is the content required for that column. See Column Types Reference for a description which values each column type requires.

Hello there @sergiuwaxmann and welcome to the community!

I hope you like it here :muscle:

Thank you @basdebruin!

Also, please provide a valid boardId, since the mutation will not work with an inexistent ID.

I hope this helps :slightly_smiling_face:

Cheers,
Matias

Hi @basdebruin!

First of all, thanks for your reply!

I tried you approach but it still doesn’t work - same 500 Internal Server Error…
This is how the variables looks like (they are sent stringified):

{
    "boardId": 1234567890,
    "columnValues": {
        "name": "John Doe",
        "email": {
            "text": "john.doe@company.com",
            "email": "john.doe@company.comm"
        },
        "job_title": "Web Developer",
        "website": "https://www.company.com",
        "long_text": {
            "text": "Some long text"
        },
        "date": {
            "date": "2022-12-20",
            "time": "00:00:00"
        },
        "startup": {
            "checked": "false"
        }
    }
}
  • The field with the ID name has the type name (the first column) - I also tried not sending name in the columnVariables as I am sending the item_name in create_item but I have the same result…
  • The field with the ID email has the type email.
  • The field with the ID job_title has the type text.
  • The field with the ID website has the type text.
  • The field with the ID long_text has the type long-text.
  • The field with the ID date has the type date.
  • The field with the ID startup has the type boolean - didn’t see the type boolean in the Column Types Reference so I assumed it is Checkbox.

I obtained the group ID and the keys and types by running this query in API Playground:

query {
  boards(ids:[1234567890]) {
    name
    columns {
      id
      title
      type
    }
    groups {
      id
      title
    }
  }
}

Hi @Matias.Monday!

First of all, thanks for your reply!

The board ID I am using is valid but I am showing an example board ID in my post as I wasn’t sure if I should publicly post the real board ID.

hi @sergiuwaxmann

I would try to remove column by column (and start with the checkbox). I believe you can’t set a checkbox to false, you need to nullify it. See the postman examples here Postman

Hello again @sergiuwaxmann,

As an example, this works as GraphQL varialbes for Postman:

{
    "boardId": 1234567890,
    "columnValues": "{\"text\": \"Some text\"}"
}

If you follow the column types reference that @basdebruin sent with this syntax, you should be fine for your queries. Also be careful with line breakers for curly brackets since Postman doesn’t love that stuff :upside_down_face:

Cheers,
Matias