Skip to content

Instantly share code, notes, and snippets.

@keranm
Last active January 2, 2016 13:39
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 keranm/8311095 to your computer and use it in GitHub Desktop.
Save keranm/8311095 to your computer and use it in GitHub Desktop.
Rough example using the getURL to get from MYOB AccountRight Live API in local mode
$urlToCall = 'http://localhost:8080/accountright/'.$companyFileID.'/GeneralLedger/GeneralJournal';
// because we are now making a call to a company file we must ALSO include the username and password
// I'm using the hardcoded variables in the functions file
$generalJournal = getURL( $urlToCall, $companyFileUsername, $companyFilePassword );
// it returns as JSON so lets decode it into a PHP object
$generalJournal = json_decode( $generalJournal );
echo '<h1>General Journal - JSON</h1>';
echo '<p>We got the JSON below by calling THIS url '.$urlToCall.'</p>';
echo '<pre>'; // simple html tag to roughly render the HTML
var_dump($generalJournal);
echo '</pre>'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment