

A PHP library for Toggl API v8 built on the Guzzle HTTP client, allowing PHP applications to integrate with Toggl’s time-tracking features programmatically.
Завантаження......
Type: PHP library / Toggl API client
Category: others
Source: GitHub – arendjantetteroo/guzzle-toggl
A PHP client for the Toggl Track API, built on the Guzzle HTTP client. It allows PHP applications to integrate with Toggl’s time-tracking and reporting features programmatically.
TogglClient::factory([...])api_key parameterdebug => true flag to see HTTP-level details__call method for invoking API operations directly (with PHPDoc auto-complete)
$toggl_client->getWorkspaces([]);getCommand()
$command = $toggl_client->getCommand('GetWorkspaces', []);prepare() and execute() control$response['data']ArchiveClientRestoreClientworkspace_id (for example: CreateClient, GetClient, CreateProject, StartTimeEntry, UpdateTimeEntry, etc.)project_id (for example: CreateTask, GetTask, UpdateTask, DeleteTask, etc.)GetProjects now uses workspace_id instead of idGetProjectUsers now expects workspace_id instead of project_idInviteWorkspaceUser → InviteOrganizationUserGetWorkspaceWorkspaceUsersGetWorkspaceProjects (replaced by GetProjects)services.json describes available methods and parametersexamples directoryapikey.phpInstall via Composer:
composer require ajt/guzzle-toggl
<?php
require __DIR__.'/../vendor/autoload.php';
use AJT\Toggl\TogglClient;
$toggl_token = ''; // Fill in your API token
$toggl_client = TogglClient::factory(['api_key' => $toggl_token]);
Enable debug output:
$toggl_client = TogglClient::factory([
'api_key' => $toggl_token,
'debug' => true,
]);
__calluse AJT\Toggl\TogglClient;
$toggl_client = TogglClient::factory(['api_key' => $toggl_token]);
$workspaces = $toggl_client->getWorkspaces([]);
foreach ($workspaces as $workspace) {
$id = $workspace['id'];
echo $workspace['name']."\n";
}
getCommand directlyuse AJT\Toggl\TogglClient;
$toggl_client = TogglClient::factory(['api_key' => $toggl_token]);
$command = $toggl_client->getCommand('GetWorkspaces', []);
$command->prepare();
$response = $command->execute();
$workspaces = $response['data'];
foreach ($workspaces as $workspace) {
$id = $workspace['id'];
echo $workspace['name']."\n";
}
apikey-dist.php to apikey.php in the project root and add your Toggl API key.examples directory.services.json to see the complete list of available API methods and their parameters.Not specified in the project documentation. This is an open-source PHP client; licensing and costs, if any, should be verified on the GitHub repository.