Creating a new timeslip fails with "task must be specified"

Am I missing something obvious here? Admittedly I have been at this many
hours.
I seem to be sending the correct information as per the documentation
https://dev.freeagent.com/docs/timeslips.

Post (json encoded):
[“user”]=> string(46) “https://api.sandbox.freeagent.com/v2/users/678
[“project”]=> string(50)
https://api.sandbox.freeagent.com/v2/projects/2598
[“task”]=> string(46) “https://api.sandbox.freeagent.com/v2/tasks/241
[“dated_on”]=> string(10) “2014-08-18”
[“hours”]=> string(3) “5.5”

Post Endpoint: api.sandbox.freeagent.com/v2/timeslips

Output:
[“errors”]=>
array(1) { [0]=> {
[“message”]=> string(22) “task must be specified”
}
}

Thank you for your help,

Pez

Hi J,

Yes, that’s the exact problem, I think the error message threw me off!

Thank you,

  • PezOn Monday, August 18, 2014 11:27:09 AM UTC+1, Jonathan Barrett wrote:

Hi Pez,

It looks like you’re submitting these params without wrapping them in a
“timeslip” object. Can you try constructing and submitting the following
JSON instead?

{ “timeslip”:
{ “user”:“https://api.sandbox.freeagent.com/v2/users/678”,
“project”:“https://api.sandbox.freeagent.com/v2/projects/2598”,
“task”:“https://api.sandbox.freeagent.com/v2/tasks/241”,
“dated_on”:“2014-08-18”,
“hours”:“5.5”
}}

Let me know if this still doesn’t help.

-J

On Monday, 18 August 2014 11:14:12 UTC+1, Pez Cuckow wrote:

Am I missing something obvious here? Admittedly I have been at this many
hours.
I seem to be sending the correct information as per the documentation
https://dev.freeagent.com/docs/timeslips.

Post (json encoded):
[“user”]=> string(46) “https://api.sandbox.freeagent.com/v2/users/678
[“project”]=> string(50) "
https://api.sandbox.freeagent.com/v2/projects/2598"
[“task”]=> string(46) “https://api.sandbox.freeagent.com/v2/tasks/241
[“dated_on”]=> string(10) “2014-08-18”
[“hours”]=> string(3) “5.5”

Post Endpoint: api.sandbox.freeagent.com/v2/timeslips

Output:
[“errors”]=>
array(1) { [0]=> {
[“message”]=> string(22) “task must be specified”
}
}

Thank you for your help,

Pez

Yeah, it’s not ideal — one of those messages that makes complete sense once
you already know what the problem is…

-JOn Mon, Aug 18, 2014 at 11:39 AM, Pez Cuckow pegpro@gmail.com wrote:

Hi J,

Yes, that’s the exact problem, I think the error message threw me off!

Thank you,

  • Pez

On Monday, August 18, 2014 11:27:09 AM UTC+1, Jonathan Barrett wrote:

Hi Pez,

It looks like you’re submitting these params without wrapping them in a
“timeslip” object. Can you try constructing and submitting the following
JSON instead?

{ “timeslip”:
{ “user”:“https://api.sandbox.freeagent.com/v2/users/678”,
“project”:“https://api.sandbox.freeagent.com/v2/projects/2598”,
“task”:“https://api.sandbox.freeagent.com/v2/tasks/241”,
“dated_on”:“2014-08-18”,
“hours”:“5.5”
}}

Let me know if this still doesn’t help.

-J

On Monday, 18 August 2014 11:14:12 UTC+1, Pez Cuckow wrote:

Am I missing something obvious here? Admittedly I have been at this many
hours.
I seem to be sending the correct information as per the documentation
https://dev.freeagent.com/docs/timeslips.

Post (json encoded):
[“user”]=> string(46) “https://api.sandbox.freeagent.com/v2/users/678
[“project”]=> string(50) “https://api.sandbox.
freeagent.com/v2/projects/2598
[“task”]=> string(46) “https://api.sandbox.freeagent.com/v2/tasks/241
[“dated_on”]=> string(10) “2014-08-18”
[“hours”]=> string(3) “5.5”

Post Endpoint: api.sandbox.freeagent.com/v2/timeslips

Output:
[“errors”]=>
array(1) { [0]=> {
[“message”]=> string(22) “task must be specified”
}
}

Thank you for your help,

Pez


You received this message because you are subscribed to the Google Groups
“FreeAgent API” group.
To unsubscribe from this group and stop receiving emails from it, send an
email to freeagent_api+unsubscribe@googlegroups.com.
To post to this group, send email to freeagent_api@googlegroups.com.
Visit this group at http://groups.google.com/group/freeagent_api.
For more options, visit https://groups.google.com/d/optout.

Jonathan Barrett, Senior Engineer

FreeAgent: Accounting software, simplified

+44 (0)131 447 0011

Follow us on Twitter: @freeagent https://twitter.com/freeagent

FreeAgent Central Ltd, 40 Torphichen Street, Edinburgh EH3 8JB
Registered in Scotland SC316774

Hi Pez,

It looks like you’re submitting these params without wrapping them in a
“timeslip” object. Can you try constructing and submitting the following
JSON instead?

{ “timeslip”:
{ “user”:“https://api.sandbox.freeagent.com/v2/users/678”,
“project”:“https://api.sandbox.freeagent.com/v2/projects/2598”,
“task”:“https://api.sandbox.freeagent.com/v2/tasks/241”,
“dated_on”:“2014-08-18”,
“hours”:“5.5”
}}

Let me know if this still doesn’t help.

-JOn Monday, 18 August 2014 11:14:12 UTC+1, Pez Cuckow wrote:

Am I missing something obvious here? Admittedly I have been at this many
hours.
I seem to be sending the correct information as per the documentation
https://dev.freeagent.com/docs/timeslips.

Post (json encoded):
[“user”]=> string(46) “https://api.sandbox.freeagent.com/v2/users/678
[“project”]=> string(50) "
https://api.sandbox.freeagent.com/v2/projects/2598"
[“task”]=> string(46) “https://api.sandbox.freeagent.com/v2/tasks/241
[“dated_on”]=> string(10) “2014-08-18”
[“hours”]=> string(3) “5.5”

Post Endpoint: api.sandbox.freeagent.com/v2/timeslips

Output:
[“errors”]=>
array(1) { [0]=> {
[“message”]=> string(22) “task must be specified”
}
}

Thank you for your help,

Pez