Clients
List
GET /clients.(json|xml)
Returns a list of clients associated with the authenticated user’s account. The results will be paginated. You can use the following optional parameters to traverse the results.
- per_page – Number of results per page (default: 10)
- page – Page in result-set
Sample JSON Response
Status: 200 OK [{ "client":{ "id": 6364, "name": "7Seven7 Insurance Inc", "email": "donna@7seven7ins.com", "currency": {"name":"United States of America, Dollars","symbol":"$"}, "address": "941 Elm Ave. #5 ", "city": "Long Beach", "province": "CA", "zip_code": "90813", "country": "United States", "full_address_with_comma": "941 Elm Ave. #5, Long Beach, CA, 90813, United States", "phone": "562-556-4035", "fax":"562-381-7500", "custom_field_name": "listed", "custom_field_value": "false", "created_at": "2010-07-18T00:08:10Z", "updated_at": "2010-07-21T11:04:58Z", } }, { "client":{ "id":6365, "name": "Affinity", "email":"CGregory@affinitygroup.com", "address":"2575 Vista Del Mar ", "city":"Ventura", "province":"California", "zip_code":"93001", "country":"United States", "full_address_with_comma":"2575 Vista Del Mar, Ventura, California, 93001, United States", "phone":"(270) 901-2913", "fax":null, "currency":{"name":"United States of America, Dollars","symbol":"$"}, "custom_field_name":null, "custom_field_value":null "created_at":"2010-07-18T00:08:10Z", "updated_at":"2010-07-18T00:08:10Z", } }]
Sample XML Response
Status: 200 OK <?xml version="1.0" encoding="UTF-8"?> <clients type="array"> <client> <id type="integer">6364</id> <name>7Seven7 Insurance Inc</name> <email>donna@7seven7ins.com</email> <currency> <name>United States of America, Dollars</name> <symbol>$</symbol> </currency> <address>941 Elm Ave. #5 </address> <city>Long Beach</city> <province>CA</province> <zip-code>90813</zip-code> <country>United States</country> <full-address-with-comma>941 Elm Ave. #5, Long Beach, CA, 90813</full-address-with-comma> <phone>562-556-4035</phone> <fax>562-381-7500</fax> <custom-field-name>listed</custom-field-name> <custom-field-value>false</custom-field-value> <created-at type="datetime">2010-07-18T00:08:10Z</created-at> <updated-at type="datetime">2010-07-21T11:04:58Z</updated-at> </client> <client> <id type="integer">6365</id> <name>Affinity</name> <email>CGregory@affinitygroup.com</email> <currency> <name>United States of America, Dollars</name> <symbol>$</symbol> </currency> <address>2575 Vista Del Mar </address> <city>Ventura</city> <province>California</province> <zip-code>93001</zip-code> <country>United States</country> <full-address-with-comma>2575 Vista Del Mar, Ventura, California, 93001, USA</full-address-with-comma> <phone>(270) 901-2913</phone> <fax nil="true"></fax> <custom-field-name nil="true"></custom-field-name> <custom-field-value nil="true"></custom-field-value> <created-at type="datetime">2010-07-18T00:08:10Z</created-at> <updated-at type="datetime">2010-07-18T00:08:10Z</updated-at> </client> </clients>
Show Top
GET /clients/#{id}.(json|xml)
Returns a specific client that is associated with the authenticated user’s account.
Sample JSON Response
Status: 200 OK { "client":{ "id": 6364, "name": "7Seven7 Insurance Inc", "email": "donna@7seven7ins.com", "currency": {"name":"United States of America, Dollars","symbol":"$"}, "address": "941 Elm Ave. #5 ", "city": "Long Beach", "province": "CA", "zip_code": "90813", "country": "United States", "full_address_with_comma": "941 Elm Ave. #5, Long Beach, CA, 90813, United States", "phone": "562-556-4035", "fax":"562-381-7500", "custom_field_name": "listed", "custom_field_value": "false", "created_at": "2010-07-18T00:08:10Z", "updated_at": "2010-07-21T11:04:58Z", } }
Sample XML Response
Status: 200 OK <?xml version="1.0" encoding="UTF-8"?> <client> <id type="integer">6364</id> <name>7Seven7 Insurance Inc</name> <email>donna@7seven7ins.com</email> <currency> <name>United States of America, Dollars</name> <symbol>$</symbol> </currency> <address>941 Elm Ave. #5 </address> <city>Long Beach</city> <province>CA</province> <zip-code>90813</zip-code> <country>United States</country> <full-address-with-comma>941 Elm Ave. #5, Long Beach, CA, 90813</full-address-with-comma> <phone>562-556-4035</phone> <fax>562-381-7500</fax> <custom-field-name>listed</custom-field-name> <custom-field-value>false</custom-field-value> <created-at type="datetime">2010-07-18T00:08:10Z</created-at> <updated-at type="datetime">2010-07-21T11:04:58Z</updated-at> </client>
Create Top
POST /clients.(json|xml)
Creates a new client in the authenticated user’s account. Only the Name of the client is required, all other parameters are optional. Returns the created client as the response.
Note
If you want to ignore the default currency set in the CurdBee user profile and instead use a different currency, you may pass the optional currency_id parameter. You can retrieve all available currencies and their IDs by sending a GET request to: http://example.curdbee.com/default_settings/currencies.(json|xml)
Sample JSON Request
{ "client": { "name": "Peter", "email": "peter@example.com", "currency_id": "150", "address": "No 39, Bakers St.", "city": "London", "province": "Southern", "zip_code": "1001", "country": "England", "phone": "+29933222", "fax": "+22299999", "custom_field_name": "Reg. No", "custom_field_value": "1112" } }
Sample JSON Response
Status: 201 Created Location: http://example.curdbee.com/clients/#{id} { "client": { "id": #{id}, "name": "Peter", ... } }
Sample XML Request
<client> <name>Peter</name> <email>peter@example.com</email> <currency-id>150</currency-id> <address>No 39, Bakers St.</address> <city>London</city> <province>Southern</province> <zip-code>1001</zip-code> <country>England</country> <fax>+22299999</fax> <phone>+29933222</phone> <custom-field-name>Reg. No</custom-field-name> <custom-field-value>1112</custom-field-value> </client>
Sample XML Response
Status: 201 Created
Location: http://example.curdbee.com/clients/#{id}
<client>
...
</client>Update Top
PUT /clients/#{id}.(json|xml)
Updates an existing client that is associated with the authenticated user’s account. Returns the updated client.
Sample JSON Request
{ "client": { "email": "peter_new@example.com", } }
Sample JSON Response
Status: 200 OK Location: http://example.curdbee.com/clients/#{id} { "client": { "id": #{id}, "name": "Peter", "email": "peter_new@example.com" ... } }
Sample XML Request
<client> <email>peter_new@example.com</email> </client>
Sample XML Response
Status: 200 OK
Location: http://example.curdbee.com/clients/#{id}
<client>
...
</client>Delete Top
DELETE /clients/#{id}.(json|xml)
Deletes an existing client that is associated with the authenticated user’s account.
Sample JSON/XML Response
Status: 200 OK








Clients
