Get Messages from the Heap CRM WebHook (and HeapCL)
TweetYou can now retrieve messages using the Heap CRM webhook. If I set the variable (JSON, POST or GET) “list” to “messages John Doe” I will get a JSON payload containing messages associated to the prospect John Doe.
Sense HeapCL is just a client to the WebHook, you can now retrieve this information directly from the terminal. If I type:
./heapCL --list "messages John Doe" --save "messages.csv"
I'll get a CSV containing messages associated to John Doe. If I type:
./heapCL --list "messages John Doe" --save "messages.txt"
I'll get a plain text file containing each message.
HeapCL has been updated, so all users should download the latest version.
January 6th, 2012 at 12:12 pm
Code examples please?
January 6th, 2012 at 12:15 pm
Ben to be clear I would like to see example of pulling John Doe data and displaying info on the website or better yet doing this with opportunity
January 6th, 2012 at 12:51 pm
Hi Paul -
Using CL is as easy as it appears above. Also the CL doc here has been updated to reflect this information:
http://heap.wbpsystems.com/cl.php#Extracting
As for a JSON example, the WebHook doc has been updated (near bottom):
http://knowledgebase.wbpsystems.com/content/Heap_POST_JSON_WebHook
February 24th, 2012 at 5:05 pm
Ben - can you provide simple PHP code to demonstrate above?
March 1st, 2012 at 6:59 am
Hi Paul -
PHP already has built in methods to convert JSON into arrays and back again. Assuming you know how to send data over the internat (if you don't look here: http://knowledgebase.wbpsystems.com/content/Create_Lead_and_Follow_up_Events), you just need to look at two commands:
json_encode
json_decode
So if you wanted to request the messages for John Doe you would do something like:
$myarray = array();
$myarray['list'] = "messages John Doe";
/*
Other values you might want to set, please look at webhooks docs
*/
$payload = json_encode($myarray);
/*
Send the payload to the webhook and save the response to resultpayload
*/
$resultarray = json_decode($resultpayload,true);
/*
Loop over the array, print part of it, whatever.
*/