Skip to content

weeekcom/weeek-client-php

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

Weeek API Client Library for PHP

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;

About

Weeek Client PHP Library

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages