Creating a task

Hi there

I’m trying to create a task, but I get a 422 error back with every
combination I try.

{“errors”:[{“message”:“name can’t be blank”}]}

Except, name isn’t blank. I’m POSTING the following to this url:
/v2/tasks?project=11 (on the sandbox)

{“task”:{“project”:"/v2/projects/11",“name”:“Task
TEST”,“is_billable”:true,“billing_rate”:400,“billing_period”:“day”,“status”:“active”,“url”:"",“updated_at”:"",“created_at”:""}}

I’ve also tried:

{“tasks”:{“project”:"/v2/projects/11",“name”:“Task
TEST”,“is_billable”:true,“billing_rate”:400,“billing_period”:“day”,“status”:“active”,“url”:"",“updated_at”:"",“created_at”:""}}

and

{“project”:"/v2/projects/11",“name”:“Task
TEST”,“is_billable”:true,“billing_rate”:400,“billing_period”:“day”,“status”:“active”,“url”:"",“updated_at”:"",“created_at”:""}

All of them come back with the same error message. Or is this another
case of the url-bring-blank type thing??

So… how do you make a task?

Ta

Nic

Nic Wise
t. +44 7788 592 806 | @fastchicken | http://www.linkedin.com/in/nicwise
b. http://www.fastchicken.co.nz/

Earnest: Self-employed? Track your business expenses and income.


Nearest Bus: find when the next bus is coming to your stop. http://goo.gl/Vcz1p
mobileAgent (for FreeAgent): get your accounts in your pocket.
http://goo.gl/IuBU
Trip Wallet: Keep track of your budget on the go: http://goo.gl/ePhKa
London Bike App: Find the nearest Boris Bike, and get riding! http://goo.gl/Icp2

I can’t easily remove the project from the json payload (this is the
same problem as the “url”:null / “url”:"" issue on a bunch of the
other end points.), but just changeing the url to
project=/v2/projects/123 didn’t fix it.

I’ll try that tomorrow as part of doing the same for the url field on
a load of other end points. Basically, I need to write a custom
serializer, have it serialize as normal json, then use regular
expressions to remove bits of it.

Why the sudden departure on this one? Most of the others take a field
with a reference (eg project has a reference to a contact), this one
takes a parameter…

Is this likely to be fixed? eg, if there is one on the querystring,
use it. If not, look in the JSON… ?On Sun, Jul 1, 2012 at 8:38 PM, Olly H olly@freeagent.com wrote:

Hi Nic

Please can you try posting to:

https://api.freeagent.com/v2/tasks?project=/v2/projects/11

With:

{“task”:{“name”:“Task
TEST”,“is_billable”:true,“billing_rate”:400,“billing_period”:“day”,“status”:active",“url”:"",“updated_at”:"",“created_at”:""}}

i.e. using a path rather than an ID in the URL and removing the project from
the JSON

Olly


You received this message because you are subscribed to the Google Groups
“FreeAgent API” group.
To view this discussion on the web visit
https://groups.google.com/d/msg/freeagent_api/-/wFGbZytedLcJ.
To post to this group, send email to freeagent_api@googlegroups.com.
To unsubscribe from this group, send email to
freeagent_api+unsubscribe@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/freeagent_api?hl=en.

Nic Wise
t. +44 7788 592 806 | @fastchicken | http://www.linkedin.com/in/nicwise
b. http://www.fastchicken.co.nz/

Earnest: Self-employed? Track your business expenses and income.


Nearest Bus: find when the next bus is coming to your stop. http://goo.gl/Vcz1p
mobileAgent (for FreeAgent): get your accounts in your pocket.
http://goo.gl/IuBU
Trip Wallet: Keep track of your budget on the go: http://goo.gl/ePhKa
London Bike App: Find the nearest Boris Bike, and get riding! http://goo.gl/Icp2

Hi Nic

Please can you try posting to:

https://api.freeagent.com/v2/tasks?project=/v2/projects/11

With:

{“task”:{“name”:“Task TEST”,“is_billable”:true,“billing_rate”:400,“billing_period”:“day”,“status”:active",“url”:"",“updated_at”:"",“created_at”:""}}

i.e. using a path rather than an ID in the URL and removing the project
from the JSON

Olly