Sticky F.A.Q.

API Reference > Cards

  • 2 October 2023
  • 6 replies
  • 214 views
API Reference > Cards
Userlevel 7

Do you need help with your API queries and/or mutation?

Here are a few that might help you!😉


🔎Queries

 

📍LIST CARDS

{
 cards(pipe_id: XXXX, first: 10, search: {title: "XXXXX"}) {
 edges {
 node {
 id
 title
 assignees {
 id
 }
 comments {
 text
 }
 comments_count
 current_phase {
 name
 }
 done
 due_date
 fields {
 name
 value
 }
 labels {
 name
 }
 phases_history {
 phase {
 name
 }
 firstTimeIn
 lastTimeOut
 }
 url
 }
 }
 }
}

This query has a limit of 50 cards/records per page, so it is necessary to use pagination, you can find this information here
 

📍SHOW CARD

{
 card(id: XXXX) {
 title
 assignees {
 id
 }
 comments {
 text
 }
 comments_count
 current_phase {
 name
 }
 done
 due_date
 fields {
 name
 value
 }
 labels {
 name
 }
 phases_history {
 phase {
 name
 }
 firstTimeIn
 lastTimeOut
 }
 url
 }
}

 

🛠Mutations

 

📍CREATE CARD

mutation{
 createCard(
 input: {
 pipe_id: XXXX
 fields_attributes: [
 {field_id: "assignee", field_value:[00000, 00001]}
 {field_id: "checklist_vertical", field_value: ["a", "b"]}
 {field_id: "checklist_horizontal", field_value: ["b"]}
 {field_id: "cpf", field_value: "XXX.XXX.XXX-XX"}
 {field_id: "cnpj", field_value: "XX.XXX.XXX/XXXX-XX"}
 {field_id: "date", field_value: "1977-01-20"}
 {field_id: "date_time", field_value: "2017-07-20T21:00:00+00:00"}
 {field_id: "due_date", field_value: "2017-07-20T21:00:00+00:00"}
 {field_id: "currency", field_value: "9500.50"}
 {field_id: "label_select", field_value: [890073, 908006]}
 {field_id: "email", field_value: "rocky.balboa@email.com"}
 {field_id: "number", field_value: 9000}
 {field_id: "short_text", field_value: "Rocky Balboa"}
 {field_id: "long_text", field_value: " any text any text any text any text."}
 {field_id: "radio_vertical", field_value: "yes"}
 {field_id: "radio_horizontal", field_value: "no"}
 {field_id: "phone", field_value: "+55 11 1234-5678"}
 {field_id: "select", field_value: "B. Rocky Balboa II"}
 {field_id: "time", field_value: "17:25"}
 ]
 parent_ids: ["XXXXX"]
 }
 ) {
 card {
 id
 title
 }
 }
}

📍UPDATE CARD

mutation{
 updateCard(
 input: {
 id: XXXXX
 title: "New Title"
 due_date: "2017-08-20T21:00:00+00:00"
 assignee_ids: [00000]
 label_ids: [XXXXX]
 }
 ) {
 card {
 id
 title
 }
 }
}

📍DELETE CARD
mutation {
 deleteCard(input: {id: XXXXX}) {
 success
 }
}

📍MOVE CARD TO PHASE

mutation {
 moveCardToPhase(
 input: {
 card_id: XXXXX
 destination_phase_id: XXXXX
 }
 ) {
 card {
 id
 current_phase{
 name
 }
 }
 }
}

📍MOVE CARD TO PHASE

mutation {
 updateCardField(
 input: {
 card_id: XXXX
 field_id: "where_do_you_live"
 new_value: "Auckland"
 }
 ) {
 card {
 id
 }
 }
}

 

 

 


6 replies

Userlevel 7
Badge +18

👍👍👍

Userlevel 7
Badge +13

👍

Userlevel 7
Badge +12

Very nice compilation.

For people getting started with GraphQL: be careful using these, there are certain things you need to change depending on the pipe structure you have. In the queries above, change anything that is like “XXX”, the numbers after id: , as well as the things after field_id: , and field_value: .

Userlevel 7

Thanks for the tips @genietim! You're great!😃

Userlevel 2

How can i upload an attachment to an existing card?

Userlevel 7
Badge +12

@reinout there are plenty of other posts answering your question already; e.g. https://community.pipefy.com/api-76/graphql-add-card-attachment-1877 , https://community.pipefy.com/api%2D76/failed%2Dwhen%2Dtrying%2Dto%2Dupload%2Da%2Dfile%2Dfrom%2Dgraphql%2D1275 , https://community.pipefy.com/ask-the-community-43/how-do-i-use-an-api-uploaded-file-as-an-e-mail-attachment-using-the-api-983 or https://community.pipefy.com/ask-the-community-43/how-can-i-upload-or-remove-an-attachment-using-api-349 

 

But feel free to create a new topic with more details (what programming language etc.), I will gladly answer that one as well.

Reply