<?php

use HelpScout\ApiClient;
$client = ApiClient::getInstance();
$client->setKey('example-key');
$customer = new \HelpScout\model\Customer();
$customer->setFirstName('John');
$customer->setLastName('Appleseed');
$customer->setOrganization('Acme, Inc');
$customer->setJobTitle('CEO and Co-Founder');
$customer->setLocation('San Francisco, CA');
$customer->setBackground("I've worked with John before and he's really great.");
// Address
// ~~~~~
$address = new \HelpScout\model\customer\Address();
$address->setLines(array('500 Main St', 'Suite 23'));
$address->setCity('San Francisco');
$address->setState('CA');
$address->setPostalCode('94103');
$address->setCountry('US');
$customer->setAddress($address);
// Phones
// ~~~~~
$phoneWork = new \HelpScout\model\customer\PhoneEntry();
$phoneWork->setValue('800-555-1212');
$phoneWork->setLocation('work');
$phoneHome = new \HelpScout\model\customer\PhoneEntry();
$phoneHome->setValue('800-123-1234');
$phoneHome->setLocation('home');
$customer->setPhones(array($phoneWork, $phoneHome));
// Emails: at least one email is required
Пример #2
0
<?php

use HelpScout\ApiClient;
try {
    $client = ApiClient::getInstance();
    $client->setKey('example-key');
    $customer = new \HelpScout\model\Customer();
    $customer->setFirstName("John");
    $customer->setLastName("Appleseed");
    $customer->setOrganization("Acme, Inc");
    $customer->setJobTitle("CEO and Co-Founder");
    $customer->setLocation("San Francisco, CA");
    $customer->setBackground("I've worked with John before and he's really great.");
    // Address
    // ~~~~~
    $address = new \HelpScout\model\customer\Address();
    $address->setLines(array("500 Main St", "Suite 23"));
    $address->setCity("San Francisco");
    $address->setState("CA");
    $address->setPostalCode("94103");
    $address->setCountry("US");
    $customer->setAddress($address);
    // Phones
    // ~~~~~
    $phoneWork = new \HelpScout\model\customer\PhoneEntry();
    $phoneWork->setValue("800-555-1212");
    $phoneWork->setLocation("work");
    $phoneHome = new \HelpScout\model\customer\PhoneEntry();
    $phoneHome->setValue("800-123-1234");
    $phoneHome->setLocation("home");
    $customer->setPhones(array($phoneWork, $phoneHome));