Updating timeslip project or task fields causes 404

Hi,

I’m experiencing an issue with the Timeslip PUT API which I am trying to use to update a timeslip. All GET requests are working and if I only include the ‘comment’ and ‘hours’ fields then it will update the comments and hours correctly. The trouble comes when trying to update the ‘project’ and/or ‘task’ fields.

The endpoint I am using is:

https://api.freeagent.com/v2/timeslips/xxxxx

This request body DOES work:

{
    "comment": "comment here",
    "hours": "0.75"
}

Both the following DO NOT work:

{
    "project": "https://api.freeagent.com/v2/projects/xxxxx",
    "task": "https://api.freeagent.com/v2/tasks/xxxxx"
}
{
    "project": "https://api.freeagent.com/v2/projects/xxxxx",
    "task": "https://api.freeagent.com/v2/tasks/xxxxx",
    "comment": "comment here",
    "hours": "0.75"
}

The response I’m getting is a 404 response code with…

{
    "errors": {
        "error": {
            "message": "Resource not found"
        }
    }
}

I would be very grateful if anyone could point me in the right direction or spot and glaringly obvious mistakes!

Thanks very much for any help!

I’ve now managed to find the issue myself. My request needed to be wrapper in a ‘timeslip’ object:

"timeslip": {
    "project": "https://api.freeagent.com/v2/projects/xxxxx",
    "task": "https://api.freeagent.com/v2/tasks/xxxxx",
    "comment": "comment here",
    "hours": "0.75"
}