henzard
2/19/2015 - 6:28 PM

gistfile1.txt

$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;
        }
    }