Error on parse query when Text or bad request

Hi Community,
I’m trying to create a new pulse, the query works fine but, if the item_name have a long text with spacebar it give me a 400 response or parse

I’m working with Java.

Request working:
String query = “{"query":"mutation{create_item(board_id: 88486632, group_id: topics, item_name: apiTest){id}}"}”

Request doesn’t work:
Try double quote text with scaped quotes
String query = “{"query":"mutation{create_item(board_id: 88486632, group_id: topics, item_name: "api Test"){id}}"}”
Error: 400 Bad Request

Try with simple quote without scape it:
String query = “{"query":"mutation{create_item(board_id: 88486632, group_id: topics, item_name: ‘api Test’){id}}"}”
Error : {“errors”:[{“message”:“Parse error on "'" (error) at [1, 71]”,“locations”:[{“line”:1,“column”:71}]}],“account_id”:XXXXXXX}

Try with simple quote scaping it:
String query = “{"query":"mutation{create_item(board_id: 88486632, group_id: topics, item_name: 'api Test'){id}}"}”
Error: {“errors”:[{“message”:“Parse error on "'" (error) at [1, 71]”,“locations”:[{“line”:1,“column”:71}]}],“account_id”:XXXXXXX}

I tryed some more examples but all with same responses 400 or parse error.

If anyone can help me with how i have to send the text on mutation.
Thank you Community

3 Likes

Solution:
String query =
“{“query”:“mutation{create_item(board_id: 88486632, group_id: topics, item_name: \ \ \ " api espacios Prueba \ \ \ "){id}}”}”
-Espaced escapes to you can see it.

** You have to send the escape characters escapeds : ** Escape slash \ and escape quotes ".

Hope this help someone.
Thank you!

4 Likes

Thanks for posting your problem AND solution Borja!

1 Like

Hi Team,

I think I’m having a similar issue, except when trying to create an update (through a Python based Application). I’m currently using a workaround so no stress, but I thought I’d bring it up for my own learning/in case it is a separate issue.

My query string is as follows:

‘{“query”: “mutation { create_update (body:\“Repairs Processed: ['iPad Pro 9.7\” Original Front Screen Repair Black ']\nRegister: End User\”, item_id:724303189) { id, body } }"}’

And the response I receive is:

{‘message’: ‘Parse error on “Front” (IDENTIFIER) at [1, 76]’, ‘locations’: [{‘line’: 1, ‘column’: 76}]}

I guess the reason I’m so intrigued is that the issue appears to be with the word ‘Front’ rather than the absurd number of quotation marks in the query string. I’d also love to know what “IDENTIFIER” refers to!

Any or all insights would be appreciated as always, but as I’ve said, there’s no rush at all :grin:

:call_me_hand:

Gabe

I think you have to add an operation name to the mutation

instead of mutation { create_update(... would be mutation xyz { create_update(...

I’m having a similar issue but instead of ' it is flagging Parse error on \xC2
not sure what to do …
I have a similar issue in another query but figured that new line chars \n were being passed with an extra slash \\n

but now I have the same parse error message but I don’t have \n this time…
this column_values being stringified always gets me in trouble

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.