Weeek is a multi-service platform that helps you make work more productive.
This package implements API that you can learn more about at developers.weeek.net
This package can be installed through Composer.
composer require weeek/weeek-client-phpYou will also need to install packages that "provide"
psr/http-client-implementation
and psr/http-factory-implementation.
More info at php-http.org.
For example, you can use Guzzle
composer guzzlehttp/guzzle http-interop/http-factory-guzzle:^1.0<?php
require_once __DIR__ . '/vendor/autoload.php';
use Weeek\Client;
$accessToken = "<your-access-token>";
$client = new Client($accessToken);# Get workspace info
$response = $client->workspace->info();
$workspaceInfo = $response->info;
# Get workspace members
$response = $client->workspace->members();
$workspaceMembers = $response->members;# Create a task
$response = $client->taskManager->tasks->create(['title' => 'My task']);
$createdTask = $response->task;
# Delete the task
$client->taskManager->tasks->destroy($createdTask->id);$statusId = '<funnel-status-id>';
# Create a deal
$response = $client->crm->deals->create($statusId, [
'title' => 'My deal',
'amount' => 100.01
]);
$createdDeal = $response->deal;
# Create a subtask
$response = $client->crm->deals->createSubtask($createdDeal->id, ['title' => 'Deal subtask']);
$createdSubtask = $response->task;