cURL Examples for API v2 :)

Ever wonder how to send requests to our API using cURL? Here you go :100:

:bangbang: A few notes:

  1. Executing cURL from the terminal removes backslashes and passes the escaped characters in the resulting string. As a result, if you want to pass \" to the server you need to include \\\". I ran these examples from the command line on my MacOS machine.
  2. Some Windows terminals don’t like single quotes, so you may need to replace them with " if you’re running these examples on a windows machine.

Getting the ID of an item with a specific name:

curl -X POST -H "Content-Type:application/json" -H "Authorization:XXXXXXX" 'https://api.monday.com/v2' \
-d '{"query":"{items_by_column_values(board_id:162169280, column_id:\"name\", column_value:\"This\"){id name}}"}'

Updating a text column on a board:

curl -X POST -H "Content-Type:application/json" -H "Authorization:XXXXX" 'https://api.monday.com/v2' \
-d '{"query":"mutation{change_column_value(item_id:279187304, board_id:162169280, column_id: \"text\", value:\"\\\"Hello world\\\"\"){name}}"}'

Updating a status column on a board:

curl -X POST -H "Content-Type:application/json" -H "Authorization:XXXXX" 'https://api.monday.com/v2' \
-d '{"query":"mutation{change_column_value(item_id:279187304, board_id:162169280, column_id:\"status\", value:\"{\\\"label\\\" : \\\"Done\\\"}\"){name}}"}'

Updating a date column on a board:

curl -X POST -H "Content-Type:application/json" -H "Authorization:XXXXXXX" 'https://api.monday.com/v2' \
-d '{"query":"mutation{change_column_value(item_id:279187304, board_id:162169280, column_id:\"date\", value:\"{\\\"date\\\" : \\\"2019-08-27\\\"}\"){name}}"}'

Updating a person column on a board:

curl -X POST -H "Content-Type:application/json" -H "Authorization:XXXXXX" 'https://api.monday.com/v2' \
-d '{"query":"mutation{change_column_value(item_id:279187304, board_id:162169280, column_id:\"person\", value:\"{\\\"id\\\" : 4012689}\"){name}}"}'

Updating a people column on a board:

curl -X POST -H "Content-Type:application/json" -H "Authorization:XXXXXX" 'https://api.monday.com/v2' \
-d '{"query" : "mutation{change_column_value(item_id:279187304, board_id:162169280, column_id: \"people\", value:\"{\\\"personsAndTeams\\\":[{\\\"id\\\":4012689,\\\"kind\\\":\\\"person\\\"}]}\"){name}}"}'

Updating a link column on a board:

curl -X POST -H "Content-Type:application/json" -H "Authorization:XXXXXXX" 'https://api.monday.com/v2' \
-d '{"query":"mutation{change_column_value(item_id:279187304, board_id:162169280, column_id: \"link\", value:\"{\\\"url\\\" : \\\"http://www.monday.com\\\", \\\"text\\\": \\\"Hello\\\"}\"){name}}"}'

Updating a date, status & text column in the same request:

curl -X POST -H "Content-Type:application/json" -H "Authorization:XXXXXX" 'https://api.monday.com/v2' \
-d '{"query":"mutation{change_multiple_column_values(item_id:279187304, board_id:162169280, column_values:\"{\\\"status\\\" : {\\\"label\\\" : \\\"Done\\\"}, \\\"text\\\":\\\"Hello world\\\", \\\"date\\\" : {\\\"date\\\" : \\\"2019-08-27\\\"}}\"){name}}"}'

Enjoy, and happy coding :slight_smile:

3 Likes

@dipro-monday.com thank you so much for these examples! I haven’t done much in the last week or so but I plan on getting back in during Aug and these will be very helpful with postman. :slight_smile:

You’re very welcome Kevin!