Skip to content

Instantly share code, notes, and snippets.

@tommoor
Created December 22, 2012 04:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tommoor/4357543 to your computer and use it in GitHub Desktop.
Save tommoor/4357543 to your computer and use it in GitHub Desktop.
500 Server error in HelpScout API.
<?php
try {
$hs = ApiClient::getInstance();
$hs->setKey('REMOVED');
$customers = $hs->getCustomers(1, null, null, null, 'user@domain.com');
// found a single customer for this email address
if ($customers->getCount() == 1)
{
$customer = reset($customers->getItems());
$customer->setBackground("Edited from the API");
$hs->updateCustomer($customer);
}
} catch (Exception $e) {
print_r($e->getMessage());
exit;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment