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
- Host: GitHub
- URL: https://github.com/ghidinelli/batchbook-api-coldfusion
- Owner: ghidinelli
- Created: 2012-12-14T19:04:57.000Z (over 13 years ago)
- Default Branch: master
- Last Pushed: 2012-12-14T19:45:50.000Z (over 13 years ago)
- Last Synced: 2023-04-04T14:13:16.869Z (about 3 years ago)
- Language: ColdFusion
- Size: 113 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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: