500 - Internal Server Error Creating a Link Column

Hi All,

i am trying to mutate a board using the API, but a im getting a 500 - Internal Server Error when i try to set the value for a link column

here is the api code:

mutation {
	create_item (board_id: 659846591, group_id: "backlog", item_name: "Teste SCI", column_values: "{ \"texto0\": \"teste\" , \"texto4\":\"BIBI\",  \"link2\":\"{\"url\":\"http://monday.com\",\"text\":\"go to monday!\"}\"      }") {
id
}
}

if i remove the link column value, the it works…

Any Idea on what am i doing wrong?

Thank You

i noticed that i need to scape the inner \ in the value… but now i am getting another error:

i am using now:

mutation {
	create_item (board_id: 659846591, group_id: "backlog", item_name: "Teste SCI", column_values: "{ \"texto0\": \"fabio\" , \"texto4\":\"BIBI\",  \"link\":\"{\\\"url\\\":\\\"http://www.monday.com\\\",\\\"text\\\":\\\"Hello\\\"}\"}") {
id
} 
}

an now getting the error:

{
  "error_code": "ColumnValueException",
  "status_code": 200,
  "error_message": "invalid value, please check our API documentation for the correct data structure for this column. https://monday.com/developers/v2#column-values-section",
  "error_data": {
    "column_value": "{\"url\":\"http://www.monday.com\",\"text\":\"Hello\"}",
    "column_type": "LinkColumn"
  }
}

Hey there @fgmanfredini :wave:

Thanks for reaching out to our community and creating this opportunity to help :slight_smile: Congratulations on your first post with us and I hope you enjoy your stay.

I’ve just tried to test this on my end and it did seem like the first error you have received was related to your JSON formatting. As for the 200 error, I am not quite sure what might have caused it in your code specifically, but it seems like the value is being blocked because of the formatting again. Would you be able to try out the following instead?

mutation {
create_item (board_id: REPLACEWITHYOURID, group_id: “REPLACEWITHYOURID”, item_name: “Teste SCI”, column_values: “{""texto0": "taste", "texto4" : "BIBI", "link" : {"url":"http://monday.com","text":"go to monday!"}”)
{id}
}

This seems to have worked for me on my end after further testing :slight_smile:

-Alex

Hi Alex, thank you for the reply. I could not test your code, i am using the monday developers TryItYourself UI, and i need to scape the quotes and backslashes, i copied and pasted your code (replacing the IDs), but get lots of formatting errors… I think the problem with my code is exactly some issues regarding the scapes that i am using…

Could you please test it on the monday developers UI and paste the code that works using the pre formatted text option here in the forum editor?

Thank You Again!

@fgmanfredini

I’m sorry to hear that didn’t seem to work for you! I’ll do some further testing and setup on my end and get back to you as soon as I can with a working example :slight_smile:

-Alex

I got it to work using an update column after the insert… for some reason, when using it inside the column_values, it does not work, but when updating, it works…

here is the code that works:

mutation {
change_column_value (board_id: 659846591, item_id: 699278976, column_id: "link", value: "{\"url\":\"http://localhost:59266/sci/19644\",\"text\":\"19644\"}") {
id
}
}