Thank you for getting back to me about this @kolaente!
I tried fetching, modifying, and sending the full task but I’m still not having success.
Here is my python script and output:
# get
data = requests.get(conf.todolist_uri+"api/v1/tasks/"+str(task['id']), headers=headers).json()
# modify
data['done'] = True
# I also tried data['done'] = 'True' and data['done'] = 1
print("Modified task data")
print(data)
# send
response = requests.post(conf.todolist_uri+"api/v1/tasks/"+str(task['id']), data=data, headers=headers)
print('\nresponse.url')
print(response.url)
print('\nresponse.status_code')
print(response.status_code)
print('\nrequest.body')
print(response.request.body)
print('\nresponse')
print(response.json())
And output is as follows:
Modified task data
{'id': 250, 'title': 'Test Task', 'description': '', 'done': True, 'done_at': '0001-01-01T00:00:00Z', 'due_date': '0001-01-01T00:00:00Z', 'reminders': None, 'project_id': 30, 'repeat_after': 0, 'repeat_mode': 0, 'priority': 0, 'start_date': '0001-01-01T00:00:00Z', 'end_date': '0001-01-01T00:00:00Z', 'assignees': None, 'labels': None, 'hex_color': '', 'percent_done': 0, 'identifier': '#14', 'index': 14, 'related_tasks': {}, 'attachments': None, 'cover_image_attachment_id': 0, 'is_favorite': True, 'created': '2024-06-02T03:47:04Z', 'updated': '2024-06-05T18:34:55Z', 'bucket_id': 48, 'position': 148102320.55172414, 'kanban_position': 148102320.55172414, 'created_by': {'id': 1, 'name': 'FM', 'username': 'FM', 'created': '2023-01-24T20:33:58Z', 'updated': '2024-02-21T22:24:34Z'}}
response.url
http://localhost:3456/api/v1/tasks/250
response.status_code
200
request.body
id=250&title=Test+Task&description=&done=True&done_at=0001-01-01T00%3A00%3A00Z&due_date=0001-01-01T00%3A00%3A00Z&project_id=30&repeat_after=0&repeat_mode=0&priority=0&start_date=0001-01-01T00%3A00%3A00Z&end_date=0001-01-01T00%3A00%3A00Z&hex_color=&percent_done=0&identifier=%2314&index=14&cover_image_attachment_id=0&is_favorite=True&created=2024-06-02T03%3A47%3A04Z&updated=2024-06-05T18%3A34%3A55Z&bucket_id=48&position=148102320.55172414&kanban_position=148102320.55172414&created_by=id&created_by=name&created_by=username&created_by=created&created_by=updated
response
{'id': 250, 'title': 'Test Task', 'description': '', 'done': False, 'done_at': '0001-01-01T00:00:00Z', 'due_date': '0001-01-01T00:00:00Z', 'reminders': None, 'project_id': 30, 'repeat_after': 0, 'repeat_mode': 0, 'priority': 0, 'start_date': '0001-01-01T00:00:00Z', 'end_date': '0001-01-01T00:00:00Z', 'assignees': [], 'labels': None, 'hex_color': '', 'percent_done': 0, 'identifier': '', 'index': 14, 'related_tasks': None, 'attachments': None, 'cover_image_attachment_id': 0, 'is_favorite': False, 'created': '0001-01-01T00:00:00Z', 'updated': '2024-06-05T18:35:04Z', 'bucket_id': 48, 'position': 148102320.55172414, 'kanban_position': 148102320.55172414, 'created_by': None}
Any insight about what I’m doing wrong or how to diagnose the issue further?
Thanks!