Ejemplo n.º 1
0
$hr = new HighriseAPI();
$hr->debug = false;
$hr->setAccount($argv[1]);
$hr->setToken($argv[2]);
$people = $hr->findAllPeople();
print_r($people);
foreach ($people as $person) {
    foreach ($person->phone_numbers as $number) {
        print $number . "\n";
    }
}
// Add a new person
// TODO: Add Address
$new_person = new HighrisePerson($hr);
$new_person->setFirstName("John Test");
$new_person->setLastName("Doe");
$new_person->setTitle("Nowhere Man");
$new_person->setBackground("Some background here");
$new_person->setCompanyName("Test Corp");
$new_person->addEmailAddress("*****@*****.**");
$new_person->addEmailAddress("*****@*****.**", "work");
$new_person->addPhoneNumber("+1 555-555-5555", "Work");
$new_person->addPhoneNumber("+1 555-555-1111", "Home");
$new_person->addTwitterAccount("johndoe");
$new_person->addTwitterAccount("johndoework", "Business");
$new_person->addWebAddress("http://john.wordpress.com", "Personal");
$new_person->addWebAddress("http://corporation.com/~john");
$new_person->addInstantMessenger("MSN", "*****@*****.**");
$new_person->addInstantMessenger("AIM", "*****@*****.**", "Work");
$new_person->save();
$new_person = null;
Ejemplo n.º 2
0
require_once "../lib/HighriseAPI.class.php";
if (count($argv) != 3) {
    die("Usage: php tags.test.php [account-name] [access-token]\n");
}
$hr = new HighriseAPI();
$hr->debug = false;
$hr->setAccount($argv[1]);
$hr->setToken($argv[2]);
$people = $hr->findPeopleBySearchTerm("Tag Tagger");
foreach ($people as $p) {
    $p->delete();
}
print "Adding a new person...\n";
$person = new HighrisePerson($hr);
$person->setFirstName("Tag");
$person->setLastName("Tagger");
$person->setVisibleTo("Owner");
$person->addTag("tag-1");
$person->addTag("tag-2");
$person->addTag("tag-300");
$person->save();
print "Saved Person:\n";
print_r($person);
print "Adding another tag...\n";
$person->addTag("tag-444");
$person->save();
print "Find People named Tag Tagger:\n";
$people = $hr->findPeopleBySearchTerm("Tag Tagger");
print_r($people);
print "Remove tag-1 from all people named Tag Tagger...\n";
foreach ($people as $p) {
Ejemplo n.º 3
0
<?php

require_once "../lib/HighriseAPI.class.php";
if (count($argv) != 3) {
    die("Usage: php tags.test.php [account-name] [access-token]\n");
}
$highrise = new HighriseAPI();
$highrise->debug = false;
$highrise->setAccount($argv[1]);
$highrise->setToken($argv[2]);
$people = $highrise->findPeopleBySearchTerm("Personality Changer");
foreach ($people as $p) {
    $p->delete();
}
$person = new HighrisePerson($highrise);
$person->setFirstName("Personality");
$person->setLastName("Changer");
$person->addEmailAddress("*****@*****.**");
$person->save();
print "Person ID is: " . $person->getId() . "\n";
$person->addEmailAddress("*****@*****.**");
$person->save();
print "Person ID after save is: " . $person->getId() . "\n";
print_r($person);
$people = $highrise->findPeopleBySearchTerm("Personality Changer");
print_r($people);
$person->delete();