I've read through the monday.com API documentation, but have been unsuccessful of creating a new board within a given workspace. The code runs and gives a status_code == 200, however there is no new board created within that workspace. Is this because no data has been added to it?
import requests
import json
start = timeit.default_timer()
apiKey = 'xxx'
apiUrl = "https://api.monday.com/v2"
headers = {"Authorization" : apiKey,
"Content-Type" : 'application/json',
"API-Version" : '2023-10'}
board_kind = 'private'
board_name = 'Baulder Gate 3'
description = 'My Campaign'
workspace_id = 'xxx'
payload = f"""
mutation {{
create_board (
board_kind: {board_kind},
board_name: {board_name},
description: {description},
workspace_id: {workspace_id}) {{
id
}}
}}
"""
data = {'query' : payload}
r_boards = requests.post(url=apiUrl, headers=headers, data=json.dumps(data)) # make request
if r_boards.status_code == 200:
print("board was created")
I was able to find my mistake. After printing out
r_boards.json()I was receiving similar error messages:Some of my datatypes were incorrect. Here is what I changed: