Hey @hmbl4, welcome to the community!
While this isn’t an official Python library, it’s awesome that one of our users created it! In the meantime, here’s some code you can use to start doing what you’re trying to do.
Here is a snippet that I’ve found super helpful for sending generic queries over to our API:
# Function to make an API query using the string passed in "query"
def makeAPIQuery(query, variables, apiKey):
headers = {"Authorization" : apiKey} # set headers
URL = "https://api.monday.com/v2"
data = {"query" : query, "variables" : variables}
r = requests.post(url=URL, json=data, headers=headers) # make request
if r.status_code == 401:
print('Status: ', r.status_code)
raise PermissionError("Check your API key!")
if r.status_code != 200:
print('Status:', r.status_code)
raise ValueError("Check your query contents!")
if ("errors" in r.json().keys()):
print(r.json())
raise SyntaxError("Check your query syntax!")
else:
results = r.json()
return results
As for creating a group, you’ll want to use the “create_group” mutation:
mutation {
create_group (board_id: 20178755, group_name: "new group") {
id
}
}
And this mutation for creating an item:
mutation {
create_item (board_id: 20178755, group_id: "today", item_name: "Hello world") {
id
}
}
Finally, you can use the create_update mutation to add an update. I’d suggest putting the description and checklist inside an update:
mutation {
create_update (item_id: 20178755, body: "This update will be added to the item") {
id
}
}
I hope that helps! 🙂