Hi
I am implementing a Python script to create items in a Monday.com table using the V2 API. I have followed the API documentation but I am still having problems with creating elements.
Here is my code:
import requests
import json
api_key = 'TU_API_KEY'
url = 'https://api.monday.com/v2/'
query = '''
mutation {
create_item(
board_id: "BOARD_ID",
item_name: "NOMBRE_TAREA",
column_values: "{\"column_id\": \"COLUMN_VALUE\"}"
) {
id
}
}
'''
headers = {
'Content-Type': 'application/json',
'Authorization': api_key
}
response = requests.post(url=url, json={'query': query}, headers=headers)
print(response.json())
However, when I run this code, I get the following error:
{'errors': [{'message': 'Parse error on ": " (STRING) at [6, 40]', 'locations': [{'line': 6, 'column': 40}]}], 'account_id': 16382470}
I have verified that the table ID, API key and column_values are correct, but still I can’t fix the problem.
I would be very grateful if someone could help me to solve this problem. Thank you very much in advance.