Your question may already have an answer on the community forum. Please search for related topics, and then read through the guidelines before creating a new topic.
Hereโs an outline with best practices for making your inquiry.
My question:
How to put graphql Query into the Unirest request body when you change it to Code snippet using Unirest.
- How to parse special character?
- How to handle escaping characters?
Details (like screenshots):
[ My mutation query ]
mutation {
create_item (board_id: ${boardId}, group_id: "topics", item_name: "๊ธ์ก ๋ฌธ์", column_values: "{\"___9\" : \"business.BOARD.contents(๋ฌธ์ ๋ด์ฉ)\", \"date4\" : \"business.BOARD.crt_date(๋ฌธ์์ผ์)\", \"___\" : \"business.USER.name(์ฌ์ฉ์ ์ด๋ฆ)\", \"___8\" : \"business.BOARD.user_id(๋ฌธ์์ ์์ด๋)\", \"____\" : \"business.BOARD.call_no(๋ฌธ์์ ํธ๋ํฐ๋ฒํธ)\", \"___2\" : \"business.BOARD.email(๋ฌธ์์ ์ด๋ฉ์ผ)\", \"___5\" : \"business.BOARD.company_name(๋ฌธ์์ ํ์ฌ๋ช
)\", \"__\" : \"business.BOARD.Attach_id(๋ฌธ์๋ด์ฉ ์ฒจ๋ถํ์ผ)\"}") {
id
}
}
[ Code snippet - Java(Unirest) ]
Unirest.setTimeouts(0, 0);
HttpResponse<String> response = Unirest.post("https://api.monday.com/v2")
.header("Content-Type", "application/json")
.body("{\"query\":\"mutation {\\n create_item (board_id: ${boardId}, group_id: \\\"topics\\\", item_name: \\\"๊ธ์ก ๋ฌธ์\\\", column_values: \\\"{\\\\\\\"___9\\\\\\\" : \\\\\\\"business.BOARD.contents(๋ฌธ์ ๋ด์ฉ)\\\\\\\", \\\\\\\"date4\\\\\\\" : \\\\\\\"business.BOARD.crt_date(๋ฌธ์์ผ์)\\\\\\\", \\\\\\\"___\\\\\\\" : \\\\\\\"business.USER.name(์ฌ์ฉ์ ์ด๋ฆ)\\\\\\\", \\\\\\\"___8\\\\\\\" : \\\\\\\"business.BOARD.user_id(๋ฌธ์์ ์์ด๋)\\\\\\\", \\\\\\\"____\\\\\\\" : \\\\\\\"business.BOARD.call_no(๋ฌธ์์ ํธ๋ํฐ๋ฒํธ)\\\\\\\", \\\\\\\"___2\\\\\\\" : \\\\\\\"business.BOARD.email(๋ฌธ์์ ์ด๋ฉ์ผ)\\\\\\\", \\\\\\\"___5\\\\\\\" : \\\\\\\"business.BOARD.company_name(๋ฌธ์์ ํ์ฌ๋ช
)\\\\\\\", \\\\\\\"__\\\\\\\" : \\\\\\\"business.BOARD.Attach_id(๋ฌธ์๋ด์ฉ ์ฒจ๋ถํ์ผ)\\\\\\\"}\\\") {\\n id\\n }\\n}\",\"variables\":{}}")
.asString();
How I found the problem:
I had a question while using the API of monday.com .