I have found an API class (https://github.com/eddieharrison/sageone-api-php) in PHP for the SageOne Accounts Cloud Software.
I used the code found in auth.php
with my apps CLIENT_ID and CLIENT_SECRET to gain an access code.
I then tried this code (/examples/get-ledger-accounts.php):
define('SAGE_CLIENT_ID', 'my client id');
define('SAGE_CLIENT_SECRET', 'my client secret');
// If you do not already have an access token please see:
// /examples/auth.php
define('SAGE_ACCESS_TOKEN', 'access code from auth.php');
$client = new SageOne(SAGE_CLIENT_ID, SAGE_CLIENT_SECRET);
$client->setAccessToken(SAGE_ACCESS_TOKEN);
$result = $client->getLedgerAccounts();
echo '<pre>';
print_r($result);
echo '</pre>';
however when testing this code, i get the following:
string(26) "{"error":"invalid_token"} " int(0)
Array
(
[error] => invalid_token
)
Does anyone know what this means and how i can fix it to gain access to our accounts data from SageOne?