Scenario Expired Access Token:
- Make sure to have a valid developer admin account access in hubstaff to have access to all organization members. (User account type only allow's own data to be received).
- Create an access token by going to the hubstaff linked apps using this link: https://account.hubstaff.com/account/linked_apps.
Note: In case their process have changed, use this link on how to refresh the token. https://developer.hubstaff.com/
- In the hubstaff.php controller. Change the
$_CLIENT_IDand$_CLIENT_SECRETaccording to the provided credentials by the hubstaff API
class Hubstaff extends CI_Controller {
// ! ============== DO NOT DELETE THIS STATIC VARIABLES (only replace them if app "Hubstaff API" fails). ==============
static private $_CLIENT_ID = "";
static private $_CLIENT_SECRET = "";
static private $_CODE = "";
/**
* ... more code here
* ... that should not be replaced as it already uses AMTI credentials
*/
- Once the
$_CLIENT_IDand$_CLIENT_SECREThas been provided run the following function.refreshAccessToken()
You can access this via the
https://<AMTI domain>/hubstaff/refreshAccessToken.
- This will echo the new access tokens if successful. else error will be displayed.
You don't have to do anything if the access token is successfull as it is already cached by the system.