Highrise php api interface

Published : February 28th, 2011
Reading time : 2 minutes , 21 seconds
highrise_php

With Push2Highrise.php as a building block, I’ve added functionality I recently needed to the open source Highrise API PHP class.

Push2Highrise.php is a simple PHP wrapper which adds form submitted data from your webpage directly to Highrise CRM system. Using the Highrise API, the wrapper supports the creation of contacts, notes, tasks and deals.

I’ve made changes to the following areas:

  1. Added The ability to attach new info to existing contacts.
  2. Added The ability to attach background info to contacts.
  3. Updated the search to look for people by email address, rather then first & last name (how many James Smith’s do you know?)
  4. Corrected problems I was having with the “add notes” function.

Examples

This is my basic example of usage, I know it’s pretty minimal, but you can see how to add tags, notes, background info, update users, add tasks. Im posting this because when I started, I couldn’t find any examples of how to use this script. I’m sure if more time was spent with it we could get a bunch more out of it, Highrise is awesome.


[php]
<!–?php include (‘StefanCrains_Push2Highrise.php’); $Push = New Push_Highrise(); /// tags for highrise $tag1 = "New Contact on ".date("M Y"); $tag2 = "Added again on ".date("M Y"); // array for the contats info // staff_comment = the background info $INFO = array(‘sSubject’ =–> ”, ‘sEmail’ => $BillingEmail, ‘sFirstName’ => ‘first name’, ‘sLastName’ => ‘last name’, ‘sCompany’ => ”, ‘sPhone’ => ‘phone #’, ‘sZip’ => ‘zip #’, ‘sCity’ => ‘city’, ‘sStreet’ => ‘street 1′.’, ‘.’street 2′, ‘sState’ => ‘state’, ‘sCountry’ => ‘country’, ‘sNotes’ => ‘added via API’, ‘staff_comment’=> ‘added on ‘.date("M dS, Y @ H:i"));

// the first query to see if person is in highrise
$xml = ($Push->person_in_highrise($INFO));

if (($xml) < 1){ // add new customer to highrise $Push->pushContact($INFO);

// get the id of the person added
$subject = ($Push->person_in_highrise($INFO));

// add tag1 to the person
$Push->pushTag($type, $subject, $tag1);

// compose the note
$Note = array(‘sPre’ => ‘first part of message’, ‘sSubject’ => ‘ middle part ‘, ‘sNotes’ => ‘ last part’, ‘id’=> $subject);

// add the note to the person
$Push->pushNote($Note);

} else { // if id >1 we have returned the id of a person

// we return a person
$subject = $xml;

// existing customer that has been added again to highrise
$Push->updateContact($INFO, $subject);

// add tag1 to the person
$Push->pushTag($type, $subject, $tag2);

// compose the note
$Note = array(‘sPre’ => ‘first part of message’, ‘sSubject’ => ‘ middle part ‘, ‘sNotes’ => ‘ last part’, ‘id’=> $subject);

// add the note to the person
$Push->pushNote($Note);
};

?>
[/php]

EDIT:

here’s the download link