Skip to main content
Solved

Error while creating card via API


I’m trying to create a card via API in a pipe that has many required fields in the form.

 

I already tried a lot of things, mapped all the ids and the formats i should build the payload. Even with the connector’s fields, that i’m using the record id to send the value that i want.

 

But, i still get an error and i can’t figure out what it says to me or what should i change.

 

My query looks like:

mutation MyQuery {
  createCard(
    input: {pipe_id: "12345678", fields_attributes: [

                 {field_id: “xxxxx”, field_value: “yyyy”}, 

                 {field_id: “xxxxx”, field_value: “yyyy”}

              ]

           }
        ) 
  {
    clientMutationId
  }
}

 

 

And the error: 

{
  "data": {
    "createCard": null
  },
  "errors": [
    {
      "message": "Something went wrong",
      "locations": [
        {
          "line": 2,
          "column": 3
        }
      ],
      "path": [
        "createCard"
      ]
    }
  ]
}

 

 

Pls, i need help on this

Best answer by genietim

Ususally, this error is what you get when e.g. there is a typo or unclosed bracket.

Try with this one:

 

mutation {
  createCard(
    input: {
            pipe_id: 12345678,
            fields_attributes: [
                 {field_id: "xxxxx", field_value: "yyyy"}, 
                 {field_id: "xxxxx", field_value: "yyyy"}
              ]
        }
  ) 
  {
    clientMutationId
    card { id }
  }
}

 

View original
Did this topic help you find an answer to your question?

2 replies

genietim
Forum|alt.badge.img+12
  • Pipefy Legend
  • 412 replies
  • Answer
  • July 17, 2023

Ususally, this error is what you get when e.g. there is a typo or unclosed bracket.

Try with this one:

 

mutation {
  createCard(
    input: {
            pipe_id: 12345678,
            fields_attributes: [
                 {field_id: "xxxxx", field_value: "yyyy"}, 
                 {field_id: "xxxxx", field_value: "yyyy"}
              ]
        }
  ) 
  {
    clientMutationId
    card { id }
  }
}

 


  • Author
  • New Member
  • 3 replies
  • July 17, 2023
genietim wrote:

Ususally, this error is what you get when e.g. there is a typo or unclosed bracket.

Try with this one:

 

mutation {
  createCard(
    input: {
            pipe_id: 12345678,
            fields_attributes: [
                 {field_id: "xxxxx", field_value: "yyyy"}, 
                 {field_id: "xxxxx", field_value: "yyyy"}
              ]
        }
  ) 
  {
    clientMutationId
    card { id }
  }
}

 

Ty for ur answer. Actually it was the field_value format that was raising the error. I followed the documentation and it worked.


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings