Hi,
I’m trying to use change_multiple_column_values using Javascript:
let query5 =
'mutation ($boardId: Int!, $columnVals: JSON!, $itemId: Int!) { change_multiple_column_values (board_id: $boardId, item_id: $itemId, column_values: $columnVals) { id } }';
let vars = {
boardId: boardId,
itemId: itemId,
columnVals: JSON.stringify(body),
};
console.log(
JSON.stringify({
query: query5,
variables: JSON.stringify(vars),
})
);
fetch('https://api.monday.com/v2', {
method: 'post',
headers: {
'Content-Type': 'application/json',
Authorization: MONDAY_API_KEY,
},
body: JSON.stringify({
query: query5,
variables: JSON.stringify(vars),
}),
})
.then((res) => res.json())
.then((res) => {
});....
When I’m using the MONDAY_API_KEY from my developer user, it ends with success.
But when I’m using the following token:
monday.get(‘sessionToken’).then((res) => {
setSessionId(res.data);
});
and send the sessionId instead of MONDAY_API_KEY, It ends up with an error message
Access to fetch at ‘https://api.monday.com/v2’ from origin ‘https://a053439f76c9.ngrok.io’ has been blocked by CORS policy: No ‘Access-Control-Allow-Origin’ header is present on the requested resource.
Any suggestion of how to perform such an update?
The problem is that when I’m using the MONDAY_API_KEY, all the activities are being saved under my user.