I can successfully place a very simple query in the interactive client, as well as using cURL:
query{account{id, name}}
But when I place the same query using Python, I get the following response:
'{"errors":[{"message":"No query string was present"}],"account_id":XXXXXXX}'
The API authentication works, because I am getting my account id back with the response. But every method I use returns “No query string was present”. Any ideas?
My relevant code snippet:
headers = {"Authorization" : creds.api_token}
request = requests.post(creds.monday_api_url,
json={"query" : "{account{id, name}}"},
headers=headers)
if request.status_code == 200:
return request.json()
else:
raise Exception(
"""
Query failed to run by returning code of {}. {}
""".format(request.status_code, query))