weeek / weeek-client-php
Weeek PHP Library
v1.0.0
2023-07-21 18:33 UTC
Requires
- php: ^7.1 || ^8.0
- ext-json: *
- php-http/client-common: ^2.0
- php-http/discovery: ^1.7
- php-http/httplug: ^2.1
Requires (Dev)
Suggests
- guzzlehttp/guzzle: Use Guzzle ^7 as HTTP client
- http-interop/http-factory-guzzle: Factory for guzzlehttp/guzzle
README
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
Installation
This package can be installed through Composer.
composer require weeek/weeek-client-php
You 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
Getting started
<?php require_once __DIR__ . '/vendor/autoload.php'; use Weeek\Client; $accessToken = "<your-access-token>"; $client = new Client($accessToken);
Examples
Get workspace info
# Get workspace info $response = $client->workspace->info(); $workspaceInfo = $response->info; # Get workspace members $response = $client->workspace->members(); $workspaceMembers = $response->members;
Work with tasks
# Create a task $response = $client->taskManager->tasks->create(['title' => 'My task']); $createdTask = $response->task; # Delete the task $client->taskManager->tasks->destroy($createdTask->id);
Work with deals
$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;