An open API service indexing awesome lists of open source software.

https://github.com/ghidinelli/batchbook-api-coldfusion

ColdFusion client for Batchbook v2 API at https://github.com/batchblue/batchbook-api
https://github.com/ghidinelli/batchbook-api-coldfusion

Last synced: about 11 hours ago
JSON representation

ColdFusion client for Batchbook v2 API at https://github.com/batchblue/batchbook-api

Awesome Lists containing this project

README

          

batchbook-api-coldfusion
========================

ColdFusion client for Batchbook v2 API at https://github.com/batchblue/batchbook-api

Usage
========================
I wrote a helper library for interfacing with REST APIs from ColdFusion. It's required and you can download it here:
https://github.com/ghidinelli/restconsumer

Initialize the client:

restconsumer = createObject("component", "restconsumer");
batchbook = createObject("component", "batchbook").init(RestConsumer = restconsumer, APIKey = 'Your-Key', Endpoint = 'https://yourHost.batchbook.com/api/v1');

Make some calls:

Check to see if it succeeds and has content:



If you have a contact ID, get the person or company record:


Create People (note, for CF8 compatibility which does not maintain case sensitivity in in-line structs/arrays, we use an argumentCollection hack represented as node()). One CF9+ I think you can just use inline syntax so long as case-sensitivity is maintained (which is required by the BB API):








savePeople() can also update records; it will look for the presence of an ID to determine if it is creating or updating.

Creating a record returns a Location header in the result struct with the URI to the new resource. You can easily fetch it like this:

Companies are created and updated the same way. This one includes a custom field set:









(again, in CF9 and above which has better inline array/struct creation, the use of node() is not required.

Get all of your custom field set definitions: