PHP code example of brandlabs / productiveio

1. Go to this page and download the library: Download brandlabs/productiveio library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

brandlabs / productiveio example snippets



		...

		use Brandlabs\Productiveio\ApiClient;
		use Brandlabs\Productiveio\Resources\TaskLists;

		$authToken = '[Productive.io API auth token]';
		$organisationId = '[productiveio organisation id]';
		$timeout = 60.0; // optional, defaults to 60.0 seconds

		$apiClient = new ApiClient($company, $baseApiUrl, $username, $password, $timeout);

		$taskListResource = new TaskLists($apiClient);

		// gets a Task List resource item
		$id = '{set to task list id}';
		$taskListResource->get($id);

		//updates Task List item
		$taskListPayload = [
			// fill in Task List item properties
		];
		$taskListResource->update($id, $taskListPayload);

		//creates task list item
		$taskListPayload = [
			// fill in Task List item properties
		];
		$taskListResource->create($taskListPayload);

		// deletes Task List item
		$taskListResource->delete($id);

		// get list
		$requestParams = [
			'page[number]' => 1
		]
		$taskListResource->getList($requestParams);

		// get aggregate
		$aggregate = true;
		$taskListResource->getList($requestParams, $aggregate);