ActiveCollab Api Wrapper 3.0

It is easier to issue and authenticate tokens
We are happy to announce the release of ActiveCollab API wrapper PHP version 3.0. This will make it easier to issue tokens and authenticate. Token issuing
Two authenticators make authentication much easier. To grab a token for one of your ActiveCollab Cloud accounts, you should use Cloud authenticator:require_once ‘/path/to/vendor/autoload.php’;$authenticator = new \ActiveCollab\SDK\Authenticator\Cloud(‘ACME Inc’, ‘My Awesome Application’, ‘[email protected]’, ‘hard to guess, easy to remember’);// Show all ActiveCollab 5 and up account that this user has access toprint_r($authenticator->getAccounts());// Show user details (first name, last name and avatar URL)print_r($authenticator->getUser());// Issue a token for account #123456789$token = $authenticator->issueToken(123456789);There’s also an authenticator for self-hostedActiveCollab setups:require_once ‘/path/to/vendor/autoload.php’;// Construct a self-hosted authenticator. Last parameter is URL where your ActiveCollab is installed$authenticator = new \ActiveCollab\SDK\Authenticator \SelfHosted(‘ACME Inc’, ‘My Awesome Application’, ‘[email protected]’, ‘hard to guess, easy to remember’, ‘https://my.company.com/projects’);// Issue a token$token = $authenticator->issueToken();Making API requests
Once you get the token, you can create a client and make API requests:$client = new \ActiveCollab\SDK\Client($token);Note that `$token` here is not a string, but an object that has both API URL and the token in it, so you should store both values if you want to reuse it later on:// Create token using saved token and URL$token_from_settings = new \ActiveCollab\SDK\Token(‘…’, ‘…’);$client = new \ActiveCollab\SDK\Client($token_from_settings);Our development team hopes you’ll find these changes helpful and so you can create some interesting integrations and add-ons.If you have any questions about API SDK or how to use it, raise a GitHub issueor create a Stack Overflow question and tag it with activecollab tag, and we’ll do our best to help you.