Hello! Thanks for the welcome and for responding!
Just in the meantime I’ve found this code:
{
items(ids: 5256361xxx) {
column_values {
id
value
... on TimeTrackingValue {
history {
status
ended_at
started_at
started_user_id
manually_entered_end_date
}
}
}
id
}
}
Which appears to give me what i am after on the playground (historical time logs)
but when i run it through python
import requests
import json
# Your Monday.com API key
api_key = 'xxx'
# The GraphQL query
query = '''
{
items(ids: 5256361524) {
column_values {
id
value
... on TimeTrackingValue {
history {
status
ended_at
started_at
started_user_id
manually_entered_end_date
}
}
}
id
}
}
'''
# The API endpoint
url = 'https://api.monday.com/v2'
# Headers for the request
headers = {
'Authorization': api_key,
'Content-Type': 'application/json'
}
# Send the request
response = requests.post(url, headers=headers, json={'query': query})
# Print the response
print(response.json())
I recieve the following error and I am struggling to find a work around. Do you or anyone else have any advice?
{'errors': [{'message': "Field 'on' doesn't exist on type 'ColumnValue'", 'locations': [{'line': 7, 'column': 7}], 'path': ['query', 'items', 'column_values', 'on'], 'extensions': {'code': 'undefinedField', 'typeName': 'ColumnValue', 'fieldName': 'on'}},
{'message': "Field 'TimeTrackingValue' doesn't exist on type 'ColumnValue'", 'locations': [{'line': 7, 'column': 10}], 'path': ['query', 'items', 'column_values', 'TimeTrackingValue'], 'extensions': {'code': 'undefinedField', 'typeName': 'ColumnValue', 'fieldName': 'TimeTrackingValue'}}], 'account_id': 10523xxx}