ActiveCollab API Wrapper 3.0

Easier token issuing and authentication

· labs ·

WORK

We’re happy to announce that ActiveCollab API wrapper for PHP is hitting version 3.0, bringing easier token issuing and authentication.

Token issuing

There are now two authenticators that make the authentication a lot 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', 'you@acmeinc.com', 'hard to guess, easy to remember');

// Show all ActiveCollab 5 and up account that this user has access to 
print_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-hosted ActiveCollab 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', 'you@acmeinc.com', '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 issue or create a Stack Overflow question and tag it with activecollab tag, and we'll do our best to help you.

Related Articles
Try Active Collab

Make Real Work Happen! with ActiveCollab

Get two weeks of ActiveCollab absolutely free, without any limitations.

No credit card required · Unsubscribe at any time

Sending...

Great, your account has been created!

You will be redirected to your new account in couple of seconds.

Great, you're almost there!

We've succesfully created your trial, but there's already an account associated with this email. To enter, you first need to sign in and then you can access the account we just created.

Sorry, we could not create an account for you at this moment. Please try again with another email address.

If the issue still persists, please let us know by sending email to support@activecollab.com