Solved

Error while creating card via API

  • 13 July 2023
  • 2 replies
  • 107 views

Userlevel 3

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

icon

Best answer by genietim 17 July 2023, 09:02

View original

2 replies

Userlevel 7
Badge +12

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 }
}
}

 

Userlevel 3

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.

Reply