batchblue / batchbook-api

Official API documentation for Batchbook
http://batchbook.com
12 stars 2 forks source link

Unable to POST to people #14

Closed ghost closed 10 years ago

ghost commented 10 years ago

Hi guys,

Getting 422 POSTing to this endpoint:

https://[ACCOUNT].batchbook.com/api/v1/people.json?auth_token=[TOKEN]

Sending this json:

{'person': {'first_name': 'Test', 'last_name': 'Name'}}

Same with XML

randerson commented 10 years ago

Hi Gordon. Even though we corresponded through our support@batchblue.com email address, I thought I'd post the answer here since it's such a common question. Heck, I've done it myself several times.

This is often caused by not setting the valid response payload types in the REST call from your REST client. For example, using linux curl from the command line:

curl -H "Content-Type: application/json" -d '{ json payload }' https://[ACCOUNT].batchbook.com/api/v1/people.json?auth_token=[TOKEN]