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.

If you’re looking for more code examples, check out our quickstart tutorials.

Getting the ID of an item with a specific name:

curl -X POST -H "Content-Type:application/json" -H "Authorization:XXXXXXX" '' \
-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" '' \
-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" '' \
-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" '' \
-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" '' \
-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" '' \
-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" '' \
-d '{"query":"mutation{change_column_value(item_id:279187304, board_id:162169280, column_id: \"link\", value:\"{\\\"url\\\" : \\\"\\\", \\\"text\\\": \\\"Hello\\\"}\"){name}}"}'

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

curl -X POST -H "Content-Type:application/json" -H "Authorization:XXXXXX" '' \
-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:

4 Likes 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!

I am new here. I tried to use the CURL example of modifying a column in my board.

My Code:

curl -X POST -H “Content-Type:application/json” -H “Authorization:XXXXXXX” “” -d ‘{“query”:“mutation{change_column_value(item_id:323796391, board_id:321744566, column_id: “Customer”, value:”\“Hello world\”"){name}}"}’

I am receiving the below error message:

Response Header

HTTP/1.1 401 Unauthorized Date: Sun, 15 Sep 2019 16:20:59 GMT Content-Type: application/json; charset=utf-8 Transfer-Encoding: chunked Connection: keep-alive Set-Cookie: __cfduid=dac7d794b02f898fa3de2443fee6aefc21568564459; expires=Mon, 14-Sep-20 16:20:59 GMT; path=/;; HttpOnly; Secure Status: 401 Unauthorized Vary: Origin Cache-Control: no-cache X-Request-Id: 58c52b37-c4cc-4b1f-a47f-c0de6481a57a X-Runtime: 0.012797 Expect-CT: max-age=604800, report-uri=“” Server: cloudflare CF-RAY: 516bee5fd94ae0ce-IAD

Response Body

{“errors”:[“Not Authenticated”]}

This doesn’t seem to be widely documented, but the auth header needs leading text "Bearer " added like so;

Authorization:Bearer XXXXXXX

Is there anything like this for creating an item?

1 Like is there a way with API v2 to update a linked column with one or many PulseID?

For instance, I would like to add an item in my “Link to release plan” column through an API call. Do you see any way of doing so?

1 Like

Hey @nohrad – it’s not possible at the moment, but we have a feature request for it open on this thread: Link to Item Column Update

Hey y’all! I know a lot of you are looking for basic tutorials for interacting with our API.

We just released quickstart tutorials for PHP, Python and Javascript. I hope you find them helpful!

I also updated the original post to include a link to them.