Skip to content

Instantly share code, notes, and snippets.

@henzard
Created February 19, 2015 18:28
Show Gist options
  • Save henzard/ced7e9c0764c1e060d39 to your computer and use it in GitHub Desktop.
Save henzard/ced7e9c0764c1e060d39 to your computer and use it in GitHub Desktop.
$Xero = new xeroActions(xeroFactory::Connection(XeroConnectionType::XeroPublic));
$accounts = $Xero->getAccounts("Code = \"200\"");
function getAccounts($filter) {
$response = $this->token->XeroOAuth->request('GET', $this->token->XeroOAuth->url('Accounts', 'core'), array('Where' => $filter));
if ($this->token->XeroOAuth->response['code'] == 200) {
$accounts = $this->token->XeroOAuth->parseResponse($this->token->XeroOAuth->response['response'], $this->token->XeroOAuth->response['format']);
return $accounts->Accounts;
} else {
$this->token->outputError($response);
return $response;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment