Hi,
I am trying to update a column on my board - it is a number. I am using the change_column_value endpoint in the API and Python.
Here is my code:
def updateColValue(self, boardId, itemId, colId, value, mondayToken):
dictHeader = {'Content-Type': 'application/json', "Authorization":self.mondayToken}
mondayURL = "https://api.monday.com/v2"
try:
mutation = f"{{ change_column_value(board_id: int(boardId), item_id: int(itemId), column_id: colId, value: value) {{ id }} }}"
payload = f"{{\\"query\\":\\"mutation: {mutation}}}"
response = requests.request("POST", mondayURL, headers=dictHeader, data=payload)
print(response.status_code)
print(response.reason)
except Exception as e:
print (f"{cm.WARNING}There was an error running a column update:\\nColumn: {colId}\\n{e}")
I keep getting a 500 error returned. I suspect it is because my query formatting is not correct. Would appreciate any help. I was using this Q&A as a guide: