### Composer Installation Source: https://github.com/activecollab/activecollab-feather-sdk/blob/master/README.md Add this to your composer.json file to install the SDK. Run 'composer update' to complete the installation. ```json { "require": { "activecollab/activecollab-feather-sdk": "^3.0" } } ``` -------------------------------- ### Connect to Self-Hosted ActiveCollab Accounts Source: https://github.com/activecollab/activecollab-feather-sdk/blob/master/README.md Use this to authenticate with self-hosted ActiveCollab instances. It requires the installation URL and issues an API token. ```php require_once '/path/to/vendor/autoload.php'; // Provide name of your company, name of the app that you are developing, your email address and password. 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(); // Did we get what we asked for? if ($token instanceof ActiveCollab SDK TokenInterface) { print $token->getUrl() . "\n"; print $token->getToken() . "\n"; } else { print "Invalid response\n"; die(); } ``` -------------------------------- ### List Tasks in a Project Source: https://github.com/activecollab/activecollab-feather-sdk/blob/master/README.md Retrieve a list of all tasks within a specific project by making a GET request to the projects/{project_id}/tasks API endpoint. ```php $client->get('projects/65/tasks'); ``` -------------------------------- ### Create a Task Source: https://github.com/activecollab/activecollab-feather-sdk/blob/master/README.md Create a new task within a project by sending a POST request with task details like name and assignee ID. Handles potential application exceptions. ```php try { $client->post('projects/65/tasks', [ 'name' => 'This is a task name', 'assignee_id' => 48 ]); } catch(AppException $e) { print $e->getMessage() . '

'; // var_dump($e->getServerResponse()); (need more info?) } ``` -------------------------------- ### Construct ActiveCollab Client Instance Source: https://github.com/activecollab/activecollab-feather-sdk/blob/master/README.md Create a client instance using an issued API token to interact with the ActiveCollab API. ```php $client = new ActiveCollab SDK Client($token); ``` -------------------------------- ### Connect to ActiveCollab Cloud Accounts Source: https://github.com/activecollab/activecollab-feather-sdk/blob/master/README.md Use this to authenticate with ActiveCollab Cloud. It retrieves account details and issues an API token. ```php 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); // Did we get it? if ($token instanceof ActiveCollab SDK TokenInterface) { print $token->getUrl() . "\n"; print $token->getToken() . "\n"; } else { print "Invalid response\n"; die(); } ``` -------------------------------- ### Update a Task Source: https://github.com/activecollab/activecollab-feather-sdk/blob/master/README.md Modify an existing task by sending a PUT request with the task ID and updated fields. Catches and displays application exceptions. ```php try { $client->put('projects/65/tasks/123', [ 'name' => 'Updated named' ]); } catch(AppException $e) { print $e->getMessage() . '

'; // var_dump($e->getServerResponse()); (need more info?) } ``` -------------------------------- ### Delete a Task Source: https://github.com/activecollab/activecollab-feather-sdk/blob/master/README.md Remove a task by its ID using a DELETE request. This method only requires the command argument and handles potential application exceptions. ```php try { $client->delete('projects/65/tasks/123'); } catch(AppException $e) { print $e->getMessage() . '

'; // var_dump($e->getServerResponse()); (need more info?) } ``` -------------------------------- ### Disable SSL Peer Verification Source: https://github.com/activecollab/activecollab-feather-sdk/blob/master/README.md If cURL encounters SSL peer verification errors, you can disable this check for Cloud, Self-Hosted, or Client instances. This option is available from SDK version 3.1. ```php // Cloud $authenticator = new ActiveCollab SDK Authenticator Cloud('ACME Inc', 'My Awesome Application', 'you@acmeinc.com', 'hard to guess, easy to remember', false); $authenticator->setSslVerifyPeer(false); // Self-hosted $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', false); $authenticator->setSslVerifyPeer(false); // Client $client = new ActiveCollab SDK Client($token); $client->setSslVerifyPeer(false); ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.