Hey ya’ll. I’m feeling quite confused here. So, I’m currently working on a node.js server to interact with a monday.com board. Everything has been going smoothly so far and I’ve written several queries to both get and write data.
I didn’t touch the project for about a week and then when I came back to it, today, one of my get queries is failing with a 400 status and code ‘ERR_BAD_REQUEST’. However, my write queries are all still working flawlessly. No code has been changed on my end.
Here is my query in string version:
const query = ` query {
items_page_by_column_values (board_id: ${BOARD_ID}, columns: [{column_id: "${EMAIL_COL_ID}", column_values: ["${email}"]}]) {
items {
id
name
column_values {
id
value
}
}
}
}`;
Here is what is being logged after passing in the variables:
query: query { items_page_by_column_values (board_id: 7412528409, columns: [{column_id: "text1__1", column_values: ["fakeEmail@email.com"]}]) { items { id name column_values { id value }}}}
Here is the javascript code to make the request:
const response = await axios.get(`${process.env.MONDAY_API_URL}`, {
headers: {
Authorization: `Bearer ${process.env.MONDAY_API_TOKEN}`,
},
data: {
query: query,
},
});
And here is what is being logged after the error response:
AxiosError: Request failed with status code 400
code: 'ERR_BAD_REQUEST',
headers: Object [AxiosHeaders] {
Accept: 'application/json, text/plain, */*',
'Content-Type': 'application/json',
Authorization: 'Bearer redactedToken',
'User-Agent': 'axios/1.7.7',
'Content-Length': '203',
'Accept-Encoding': 'gzip, compress, deflate, br'
},
data: '{"query":"query { items_page_by_column_values (board_id: 7412528409, columns: [{column_id: \\"text1__1\\", column_values: [\\"fakeEmail@email.com\\"]}]) { items { id name column_values { id value }}}}"}',
method: 'get',
url: 'https://api.monday.com/v2'
},
Any guidance would be much appreciated. Again, my other queries are working and this one has broken without me touching it or any code related to it.