Hi Tim,
You definitely need to wrap the json hash in an outer “contact” hash and
it’s not necessary to specify all parameters - just the ones you want to
change e.g:
PUT /v2/contacts/xxx
User-Agent: useragent
Host: api.freeagent.com
Accept: application/json
Content-type: application/json
Authorization: OAuth MY_TOKEN
{
“contact”: {
“organisation_name”: “Acme”,
“country”: “United Kingdom”
}
}
Kind regards,
GraemeOn 23 March 2014 10:04, Tim Ballard tim@tim-ballard.co.uk wrote:
Hello,
We are planning on using the FreeAgent API to allow our customers to check
and update their billing details through our website when signed in.So far, I have been able to read contact information but I am finding it
impossible to update existing contact information. I seem to be able to
submit an update request without receiving an error but nothing gets
updated.Here are my request headers, any ideas why this is not working?
PUT /v2/contacts/597884 HTTP/1.1
User-Agent: Lawford Education Ltd
Host: api.freeagent.com
Accept: application/json
Content-type: application/json
Authorization: OAuth MY_TOKEN{“organisation_name”:“My
Organisation”,“first_name”:“Joe”,“last_name”:“Bloggs”,“email”:"
joe@bloggs.com",“phone_number”:“01234567890”,“address1”:“The
House”,“town”:“Manningtree”,“region”:“Essex”,“postcode”:“AB12CD”,“country”:“United
Kingdom”}I have tried wrapping the array in a “contact” tag as well but still
nothing. Do I need to include all the input parameters, or just those that
need to be updated?Many thanks in advance,
Tim–
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.
Graeme Boyd
Engineering Manager
Web. freeagent.com http://www.freeagent.com/ Blog. The FreeAgent Blog - FreeAgent
Twitter. @freeagent https://twitter.com/#!/freeagent Facebook.
FreeAgent | Edinburgh
40 Torphichen Street, Edinburgh, EH3 8JB
FreeAgent Central Ltd. Registered in sunny Scotland SC316774