Problems posting to a project

Hi there

I’m trying to make a new project. The JSON is:

POST /v2/projects

{“project”:{“contact”:"/v2/contacts/167",“name”:“project
TEST”,“starts_on”:null,“ends_on”:null,“budget”:0,“is_ir35”:false,“contract_po_reference”:null,“status”:“Active”,“budget_units”:“Days”,“normal_billing_rate”:0,“hours_per_day”:0,“uses_project_invoice_sequence”:false,“currency”:“GBP”,“billing_period”:null,“url”:null,“updated_at”:"",“created_at”:""}}

(I’ve also tried “url”:"")

I get the following back:

{“errors”:{“error”:{“message”:“unknown attribute: url”}}}

What am I missing here? Is there a Ruby (or something else) sample I
can compare the over-the-wire stuff which is known to work, vrs the
docs?

I can post to /v2/contacts just fine:

{“contact”:{“locale”:“en”,“account_balance”:0,“organisation_name”:"",“first_name”:“Nic
TEST”,“last_name”:“Wise”,“email”:null,“phone_number”:null,“address1”:“17:04:10”,“town”:null,“region”:null,“postcode”:null,“address2”:null,“address3”:null,“contact_name_on_invoices”:false,“country”:null,“sales_tax_registration_number”:null,“uses_contact_invoice_sequence”:false,“url”:"",“updated_at”:"",“created_at”:""}}

response:

{“contact”:{“url”:“https://api.sandbox.freeagent.com/v2/contacts/248",“first_name”:"Nic
TEST”,“last_name”:“Wise”,“address1”:“17:04:10”,“contact_name_on_invoices”:false,“country”:“United
Kingdom”,“locale”:“en”,“account_balance”:“0.0”,“uses_contact_invoice_sequence”:false,“created_at”:“2012-05-27T16:04:04Z”,“updated_at”:“2012-05-27T16:04:04Z”}}

(on thing to keep in mind: they want that all (most?) .NET JSON
parsers work is that if I have a field, it will serialize it as
field:"" or field:null - NOT omit the field if it’s null or blank!!)

Also, shouldn’t the resulting url in both cases be /v2/contacts/248
not https://api.sandbox.freeagent.com/v2/contacts/248??

Any ideas?

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

Hi again Graeme

Just wondering what the state of this is.

I’ve tried posting a blank (“url”:“”) as well as null (“url”:null) and
neither work - message=unknown attribute: url

Is this still the expected result? Would I have to totally omit the
url field to POST? Is there an ETA for fixing this?

Thanks!

NicOn Tue, May 29, 2012 at 5:16 PM, Graeme Boyd graeme.boyd@freeagent.com wrote:

Hi Nic,

I’ve changed things so that the POSTed URL field is now sanitised. However
other invalid parameters aren’t sanitised so FreeAgent will still complain
if there are other parameters it doesn’t recognise. Some resources are more
permissive than others - /projects will complain if you POST anything it
doesn’t recognise while /contacts won’t.

The behaviour with XML is exactly the same unless your XML serialiser omits
null fields.

I may have confused the issue by saying that serialising to null or “”
shouldn’t cause problems. The issue here is that parameters are sent to
FreeAgent which it’s not expecting. It doesn’t matter whether those
parameters are null, “” or text; some resources will still complain.

Kind regards,

Graeme

On 28 May 2012 18:38, Nic Wise nicw@fastchicken.co.nz wrote:

Also, is it just a JSON thing? I can switch to XML pretty quickly.

On Mon, May 28, 2012 at 4:47 PM, Graeme Boyd graeme.boyd@freeagent.com wrote:

Hi Nic,

The project resource here is complaining about the fact that url is not
a
valid parameter where it should be ignoring the invalid parameter. The
contact resource is ignoring the invalid url parameter. This is a bug
which
unfortunately will have to be worked around in the short term. The
solution
is to remove the url parameter from the project creation json.

As far as I’m aware the .NET parsers serialising to null or “” should
not
cause any problems.

The API is happy to accept

either https://api.sandbox.freeagent.com/v2/contacts/248 or /v2/contacts/248.
I made the API return the full URL as it means the link to the contact
can
be followed without any further processing by the client.

Cheers,

Graeme

On 27 May 2012 17:07, Nic Wise nicw@fastchicken.co.nz wrote:

Hi there

I’m trying to make a new project. The JSON is:

POST /v2/projects

{“project”:{“contact”:“/v2/contacts/167”,“name”:"project

TEST",“starts_on”:null,“ends_on”:null,“budget”:0,“is_ir35”:false,“contract_po_reference”:null,“status”:“Active”,“budget_units”:“Days”,“normal_billing_rate”:0,“hours_per_day”:0,“uses_project_invoice_sequence”:false,“currency”:“GBP”,“billing_period”:null,“url”:null,“updated_at”:“”,“created_at”:“”}}

(I’ve also tried “url”:“”)

I get the following back:

{“errors”:{“error”:{“message”:“unknown attribute: url”}}}

What am I missing here? Is there a Ruby (or something else) sample I
can compare the over-the-wire stuff which is known to work, vrs the
docs?

I can post to /v2/contacts just fine:

{“contact”:{“locale”:“en”,“account_balance”:0,“organisation_name”:“”,“first_name”:"Nic

TEST",“last_name”:“Wise”,“email”:null,“phone_number”:null,“address1”:“17:04:10”,“town”:null,“region”:null,“postcode”:null,“address2”:null,“address3”:null,“contact_name_on_invoices”:false,“country”:null,“sales_tax_registration_number”:null,“uses_contact_invoice_sequence”:false,“url”:“”,“updated_at”:“”,“created_at”:“”}}

response:

{“contact”:{“url”:"https://api.sandbox.freeagent.com/v2/contacts/248",“first_name”:"Nic

TEST",“last_name”:“Wise”,“address1”:“17:04:10”,“contact_name_on_invoices”:false,“country”:"United

Kingdom",“locale”:“en”,“account_balance”:“0.0”,“uses_contact_invoice_sequence”:false,“created_at”:“2012-05-27T16:04:04Z”,“updated_at”:“2012-05-27T16:04:04Z”}}

(on thing to keep in mind: they want that all (most?) .NET JSON
parsers work is that if I have a field, it will serialize it as
field:“” or field:null - NOT omit the field if it’s null or blank!!)

Also, shouldn’t the resulting url in both cases be /v2/contacts/248
not https://api.sandbox.freeagent.com/v2/contacts/248??

Any ideas?

Ta

Nic


Nic Wise
t. +44 7788 592 806 | @fastchicken |
Nic Wise - Tend Health Ltd | LinkedIn
b. http://www.fastchicken.co.nz/

Earnest: Self-employed? Track your business expenses and income.
http://earnestapp.com
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


You received this message because you are subscribed to the Google
Groups
“FreeAgent API” group.
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.


Graeme Boyd
Senior Software Engineer

Web. freeagent.com Blog. The FreeAgent Blog - FreeAgent
Twitter. @freeagent Facebook. FreeAgent | Edinburgh

SOFTWARE SATISFACTION AWARDS 2012 - Vote for us (We’d be super
stoked!)

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


You received this message because you are subscribed to the Google
Groups
“FreeAgent API” group.
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 | Nic Wise - Tend Health Ltd | LinkedIn
b. http://www.fastchicken.co.nz/

Earnest: Self-employed? Track your business expenses and income.
http://earnestapp.com
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


You received this message because you are subscribed to the Google Groups
“FreeAgent API” group.
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.


Graeme Boyd
Senior Software Engineer

Web. freeagent.com Blog. The FreeAgent Blog - FreeAgent
Twitter. @freeagent Facebook. FreeAgent | Edinburgh

SOFTWARE SATISFACTION AWARDS 2012 - Vote for us (We’d be super stoked!)

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


You received this message because you are subscribed to the Google Groups
“FreeAgent API” group.
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 | Nic Wise - Tend Health Ltd | LinkedIn
b. http://www.fastchicken.co.nz/

Earnest: Self-employed? Track your business expenses and income.
http://earnestapp.com
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,

I’ve changed things so that the POSTed URL field is now sanitised. However
other invalid parameters aren’t sanitised so FreeAgent will still complain
if there are other parameters it doesn’t recognise. Some resources are
more permissive than others - /projects will complain if you POST anything
it doesn’t recognise while /contacts won’t.

The behaviour with XML is exactly the same unless your XML serialiser omits
null fields.

I may have confused the issue by saying that serialising to null or “”
shouldn’t cause problems. The issue here is that parameters are sent to
FreeAgent which it’s not expecting. It doesn’t matter whether those
parameters are null, “” or text; some resources will still complain.

Kind regards,

GraemeOn 28 May 2012 18:38, Nic Wise nicw@fastchicken.co.nz wrote:

Also, is it just a JSON thing? I can switch to XML pretty quickly.

On Mon, May 28, 2012 at 4:47 PM, Graeme Boyd graeme.boyd@freeagent.com wrote:

Hi Nic,

The project resource here is complaining about the fact that url is not a
valid parameter where it should be ignoring the invalid parameter. The
contact resource is ignoring the invalid url parameter. This is a bug
which
unfortunately will have to be worked around in the short term. The
solution
is to remove the url parameter from the project creation json.

As far as I’m aware the .NET parsers serialising to null or “” should not
cause any problems.

The API is happy to accept
either https://api.sandbox.freeagent.com/v2/contacts/248
or /v2/contacts/248.
I made the API return the full URL as it means the link to the contact
can
be followed without any further processing by the client.

Cheers,

Graeme

On 27 May 2012 17:07, Nic Wise nicw@fastchicken.co.nz wrote:

Hi there

I’m trying to make a new project. The JSON is:

POST /v2/projects

{“project”:{“contact”:“/v2/contacts/167”,“name”:"project

TEST",“starts_on”:null,“ends_on”:null,“budget”:0,“is_ir35”:false,“contract_po_reference”:null,“status”:“Active”,“budget_units”:“Days”,“normal_billing_rate”:0,“hours_per_day”:0,“uses_project_invoice_sequence”:false,“currency”:“GBP”,“billing_period”:null,“url”:null,“updated_at”:“”,“created_at”:“”}}

(I’ve also tried “url”:“”)

I get the following back:

{“errors”:{“error”:{“message”:“unknown attribute: url”}}}

What am I missing here? Is there a Ruby (or something else) sample I
can compare the over-the-wire stuff which is known to work, vrs the
docs?

I can post to /v2/contacts just fine:

{“contact”:{“locale”:“en”,“account_balance”:0,“organisation_name”:“”,“first_name”:"Nic

TEST",“last_name”:“Wise”,“email”:null,“phone_number”:null,“address1”:“17:04:10”,“town”:null,“region”:null,“postcode”:null,“address2”:null,“address3”:null,“contact_name_on_invoices”:false,“country”:null,“sales_tax_registration_number”:null,“uses_contact_invoice_sequence”:false,“url”:“”,“updated_at”:“”,“created_at”:“”}}

response:

{“contact”:{“url”:"https://api.sandbox.freeagent.com/v2/contacts/248
",“first_name”:"Nic

TEST",“last_name”:“Wise”,“address1”:“17:04:10”,“contact_name_on_invoices”:false,“country”:"United

Kingdom",“locale”:“en”,“account_balance”:“0.0”,“uses_contact_invoice_sequence”:false,“created_at”:“2012-05-27T16:04:04Z”,“updated_at”:“2012-05-27T16:04:04Z”}}

(on thing to keep in mind: they want that all (most?) .NET JSON
parsers work is that if I have a field, it will serialize it as
field:“” or field:null - NOT omit the field if it’s null or blank!!)

Also, shouldn’t the resulting url in both cases be /v2/contacts/248
not https://api.sandbox.freeagent.com/v2/contacts/248??

Any ideas?

Ta

Nic


Nic Wise
t. +44 7788 592 806 | @fastchicken |
Nic Wise - Tend Health Ltd | LinkedIn
b. http://www.fastchicken.co.nz/

Earnest: Self-employed? Track your business expenses and income.
http://earnestapp.com
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


You received this message because you are subscribed to the Google
Groups
“FreeAgent API” group.
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.


Graeme Boyd
Senior Software Engineer

Web. freeagent.com Blog. The FreeAgent Blog - FreeAgent
Twitter. @freeagent Facebook. FreeAgent | Edinburgh

SOFTWARE SATISFACTION AWARDS 2012 - Vote for us (We’d be super
stoked!)

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


You received this message because you are subscribed to the Google Groups
“FreeAgent API” group.
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 | Nic Wise - Tend Health Ltd | LinkedIn
b. http://www.fastchicken.co.nz/

Earnest: Self-employed? Track your business expenses and income.
http://earnestapp.com
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


You received this message because you are subscribed to the Google Groups
“FreeAgent API” group.
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.

Graeme Boyd
Senior Software Engineer

Web. freeagent.com http://www.freeagent.com/ Blog. The FreeAgent Blog - FreeAgent
Twitter. @freeagent https://twitter.com/#!/freeagent Facebook.
FreeAgent | Edinburgh

SOFTWARE SATISFACTION AWARDS 2012* * - *Vote for
ushttp://www.clicktools.com/survey?iv=1c8dgs13zfxs7r&q1=FreeAgent%20Central%20Ltd&q2=FreeAgent&q3=Accounting%20and%20Finance
** * (We’d be super stoked!)

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

Hi Nic,

The project resource here is complaining about the fact that url is not a
valid parameter where it should be ignoring the invalid parameter. The
contact resource is ignoring the invalid url parameter. This is a bug
which unfortunately will have to be worked around in the short term. The
solution is to remove the url parameter from the project creation json.

As far as I’m aware the .NET parsers serialising to null or “” should not
cause any problems.

The API is happy to accept either
https://api.sandbox.freeagent.com/v2/contacts/248 or /v2/contacts/248. I
made the API return the full URL as it means the link to the contact can be
followed without any further processing by the client.

Cheers,

GraemeOn 27 May 2012 17:07, Nic Wise nicw@fastchicken.co.nz wrote:

Hi there

I’m trying to make a new project. The JSON is:

POST /v2/projects

{“project”:{“contact”:“/v2/contacts/167”,“name”:"project

TEST",“starts_on”:null,“ends_on”:null,“budget”:0,“is_ir35”:false,“contract_po_reference”:null,“status”:“Active”,“budget_units”:“Days”,“normal_billing_rate”:0,“hours_per_day”:0,“uses_project_invoice_sequence”:false,“currency”:“GBP”,“billing_period”:null,“url”:null,“updated_at”:“”,“created_at”:“”}}

(I’ve also tried “url”:“”)

I get the following back:

{“errors”:{“error”:{“message”:“unknown attribute: url”}}}

What am I missing here? Is there a Ruby (or something else) sample I
can compare the over-the-wire stuff which is known to work, vrs the
docs?

I can post to /v2/contacts just fine:

{“contact”:{“locale”:“en”,“account_balance”:0,“organisation_name”:“”,“first_name”:"Nic

TEST",“last_name”:“Wise”,“email”:null,“phone_number”:null,“address1”:“17:04:10”,“town”:null,“region”:null,“postcode”:null,“address2”:null,“address3”:null,“contact_name_on_invoices”:false,“country”:null,“sales_tax_registration_number”:null,“uses_contact_invoice_sequence”:false,“url”:“”,“updated_at”:“”,“created_at”:“”}}

response:

{“contact”:{“url”:"https://api.sandbox.freeagent.com/v2/contacts/248
",“first_name”:"Nic

TEST",“last_name”:“Wise”,“address1”:“17:04:10”,“contact_name_on_invoices”:false,“country”:"United

Kingdom",“locale”:“en”,“account_balance”:“0.0”,“uses_contact_invoice_sequence”:false,“created_at”:“2012-05-27T16:04:04Z”,“updated_at”:“2012-05-27T16:04:04Z”}}

(on thing to keep in mind: they want that all (most?) .NET JSON
parsers work is that if I have a field, it will serialize it as
field:“” or field:null - NOT omit the field if it’s null or blank!!)

Also, shouldn’t the resulting url in both cases be /v2/contacts/248
not https://api.sandbox.freeagent.com/v2/contacts/248??

Any ideas?

Ta

Nic


Nic Wise
t. +44 7788 592 806 | @fastchicken | Nic Wise - Tend Health Ltd | LinkedIn
b. http://www.fastchicken.co.nz/

Earnest: Self-employed? Track your business expenses and income.
http://earnestapp.com
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


You received this message because you are subscribed to the Google Groups
“FreeAgent API” group.
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.

Graeme Boyd
Senior Software Engineer

Web. freeagent.com http://www.freeagent.com/ Blog. The FreeAgent Blog - FreeAgent
Twitter. @freeagent https://twitter.com/#!/freeagent Facebook.
FreeAgent | Edinburgh

SOFTWARE SATISFACTION AWARDS 2012* * - *Vote for
ushttp://www.clicktools.com/survey?iv=1c8dgs13zfxs7r&q1=FreeAgent%20Central%20Ltd&q2=FreeAgent&q3=Accounting%20and%20Finance
** * (We’d be super stoked!)

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

Hi Nic,

The project resource here is complaining about the fact that url is not a
valid parameter where it should be ignoring the invalid parameter. The
contact resource is ignoring the invalid url parameter. This is a bug which
unfortunately will have to be worked around in the short term. The solution
is to remove the url parameter from the project creation json.

So, don’t post a url field at all?

Any idea on how long until this is fixed? I’d be changing the core
REST library I’m using (RestSharp), which I’d rather not do, as I dont
want to maintain my own branch.

As far as I’m aware the .NET parsers serialising to null or “” should not
cause any problems.

So… this should work:

“url”:“”

(and it does on the contacts), but doesn’t (the bug, above) and the
work around is to not post any url at all in the short term?

Does this happen on any other resources? Or just projects? I have
plenty of other resources to write the api for, so I might just move
onto those.

The API is happy to accept
either https://api.sandbox.freeagent.com/v2/contacts/248 or /v2/contacts/248.
I made the API return the full URL as it means the link to the contact can
be followed without any further processing by the client.

Cool - I’ll parse it thru a full URL parser to get the bits out. Ta

N> On 27 May 2012 17:07, Nic Wise nicw@fastchicken.co.nz wrote:

Hi there

I’m trying to make a new project. The JSON is:

POST /v2/projects

{“project”:{“contact”:“/v2/contacts/167”,“name”:"project

TEST",“starts_on”:null,“ends_on”:null,“budget”:0,“is_ir35”:false,“contract_po_reference”:null,“status”:“Active”,“budget_units”:“Days”,“normal_billing_rate”:0,“hours_per_day”:0,“uses_project_invoice_sequence”:false,“currency”:“GBP”,“billing_period”:null,“url”:null,“updated_at”:“”,“created_at”:“”}}

(I’ve also tried “url”:“”)

I get the following back:

{“errors”:{“error”:{“message”:“unknown attribute: url”}}}

What am I missing here? Is there a Ruby (or something else) sample I
can compare the over-the-wire stuff which is known to work, vrs the
docs?

I can post to /v2/contacts just fine:

{“contact”:{“locale”:“en”,“account_balance”:0,“organisation_name”:“”,“first_name”:"Nic

TEST",“last_name”:“Wise”,“email”:null,“phone_number”:null,“address1”:“17:04:10”,“town”:null,“region”:null,“postcode”:null,“address2”:null,“address3”:null,“contact_name_on_invoices”:false,“country”:null,“sales_tax_registration_number”:null,“uses_contact_invoice_sequence”:false,“url”:“”,“updated_at”:“”,“created_at”:“”}}

response:

{“contact”:{“url”:"https://api.sandbox.freeagent.com/v2/contacts/248",“first_name”:"Nic

TEST",“last_name”:“Wise”,“address1”:“17:04:10”,“contact_name_on_invoices”:false,“country”:"United

Kingdom",“locale”:“en”,“account_balance”:“0.0”,“uses_contact_invoice_sequence”:false,“created_at”:“2012-05-27T16:04:04Z”,“updated_at”:“2012-05-27T16:04:04Z”}}

(on thing to keep in mind: they want that all (most?) .NET JSON
parsers work is that if I have a field, it will serialize it as
field:“” or field:null - NOT omit the field if it’s null or blank!!)

Also, shouldn’t the resulting url in both cases be /v2/contacts/248
not https://api.sandbox.freeagent.com/v2/contacts/248??

Any ideas?

Ta

Nic


Nic Wise
t. +44 7788 592 806 | @fastchicken | Nic Wise - Tend Health Ltd | LinkedIn
b. http://www.fastchicken.co.nz/

Earnest: Self-employed? Track your business expenses and income.
http://earnestapp.com
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


You received this message because you are subscribed to the Google Groups
“FreeAgent API” group.
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.


Graeme Boyd
Senior Software Engineer

Web. freeagent.com Blog. The FreeAgent Blog - FreeAgent
Twitter. @freeagent Facebook. FreeAgent | Edinburgh

SOFTWARE SATISFACTION AWARDS 2012 - Vote for us (We’d be super stoked!)

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


You received this message because you are subscribed to the Google Groups
“FreeAgent API” group.
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 | Nic Wise - Tend Health Ltd | LinkedIn
b. http://www.fastchicken.co.nz/

Earnest: Self-employed? Track your business expenses and income.
http://earnestapp.com
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

Also, is it just a JSON thing? I can switch to XML pretty quickly.On Mon, May 28, 2012 at 4:47 PM, Graeme Boyd graeme.boyd@freeagent.com wrote:

Hi Nic,

The project resource here is complaining about the fact that url is not a
valid parameter where it should be ignoring the invalid parameter. The
contact resource is ignoring the invalid url parameter. This is a bug which
unfortunately will have to be worked around in the short term. The solution
is to remove the url parameter from the project creation json.

As far as I’m aware the .NET parsers serialising to null or “” should not
cause any problems.

The API is happy to accept
either https://api.sandbox.freeagent.com/v2/contacts/248 or /v2/contacts/248.
I made the API return the full URL as it means the link to the contact can
be followed without any further processing by the client.

Cheers,

Graeme

On 27 May 2012 17:07, Nic Wise nicw@fastchicken.co.nz wrote:

Hi there

I’m trying to make a new project. The JSON is:

POST /v2/projects

{“project”:{“contact”:“/v2/contacts/167”,“name”:"project

TEST",“starts_on”:null,“ends_on”:null,“budget”:0,“is_ir35”:false,“contract_po_reference”:null,“status”:“Active”,“budget_units”:“Days”,“normal_billing_rate”:0,“hours_per_day”:0,“uses_project_invoice_sequence”:false,“currency”:“GBP”,“billing_period”:null,“url”:null,“updated_at”:“”,“created_at”:“”}}

(I’ve also tried “url”:“”)

I get the following back:

{“errors”:{“error”:{“message”:“unknown attribute: url”}}}

What am I missing here? Is there a Ruby (or something else) sample I
can compare the over-the-wire stuff which is known to work, vrs the
docs?

I can post to /v2/contacts just fine:

{“contact”:{“locale”:“en”,“account_balance”:0,“organisation_name”:“”,“first_name”:"Nic

TEST",“last_name”:“Wise”,“email”:null,“phone_number”:null,“address1”:“17:04:10”,“town”:null,“region”:null,“postcode”:null,“address2”:null,“address3”:null,“contact_name_on_invoices”:false,“country”:null,“sales_tax_registration_number”:null,“uses_contact_invoice_sequence”:false,“url”:“”,“updated_at”:“”,“created_at”:“”}}

response:

{“contact”:{“url”:"https://api.sandbox.freeagent.com/v2/contacts/248",“first_name”:"Nic

TEST",“last_name”:“Wise”,“address1”:“17:04:10”,“contact_name_on_invoices”:false,“country”:"United

Kingdom",“locale”:“en”,“account_balance”:“0.0”,“uses_contact_invoice_sequence”:false,“created_at”:“2012-05-27T16:04:04Z”,“updated_at”:“2012-05-27T16:04:04Z”}}

(on thing to keep in mind: they want that all (most?) .NET JSON
parsers work is that if I have a field, it will serialize it as
field:“” or field:null - NOT omit the field if it’s null or blank!!)

Also, shouldn’t the resulting url in both cases be /v2/contacts/248
not https://api.sandbox.freeagent.com/v2/contacts/248??

Any ideas?

Ta

Nic


Nic Wise
t. +44 7788 592 806 | @fastchicken | Nic Wise - Tend Health Ltd | LinkedIn
b. http://www.fastchicken.co.nz/

Earnest: Self-employed? Track your business expenses and income.
http://earnestapp.com
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


You received this message because you are subscribed to the Google Groups
“FreeAgent API” group.
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.


Graeme Boyd
Senior Software Engineer

Web. freeagent.com Blog. The FreeAgent Blog - FreeAgent
Twitter. @freeagent Facebook. FreeAgent | Edinburgh

SOFTWARE SATISFACTION AWARDS 2012 - Vote for us (We’d be super stoked!)

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


You received this message because you are subscribed to the Google Groups
“FreeAgent API” group.
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 | Nic Wise - Tend Health Ltd | LinkedIn
b. http://www.fastchicken.co.nz/

Earnest: Self-employed? Track your business expenses and income.
http://earnestapp.com
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