2017 © Pedro Peláez
 

library toggl-api

A complete native php wrapper for the Toggl API

image

morningtrain/toggl-api

A complete native php wrapper for the Toggl API

  • Monday, October 2, 2017
  • by morningtrain
  • Repository
  • 4 Watchers
  • 11 Stars
  • 943 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 9 Forks
  • 3 Open issues
  • 5 Versions
  • 6 % Grown

The README.md

About

PHP class to connect with the Toggl API., (*1)

This was coded on an early http://morningtrain.dk, (*2)

Installation

It can be installed with composer, (*3)

composer require morningtrain/toggl-api

Dependencies

It depends on guzzlehttp/guzzle ver.6., (*4)

Guzzle can be added with the following composer snippet: (or automatically when installing through composer), (*5)

{
    "require": {
        "guzzlehttp/guzzle": "^6.0"
    }
}

Changelog

14/06/2021

  • Added methods for some of the undocumented project_group endpoints. This will make it possible to assign, update or remove groups from private projects.

30/06/17

  • Changed function name from getDashboadForWorkspace to getDashboardForWorkspace, if your system is using getDashboadForWorkspace please change it to getDashboardForWorkspace.

Examples

For details about the different objects required in the Toggl Api, take a look at their documentation: https://github.com/toggl/toggl_api_docs, (*6)

Toggl API

Initialization

$toggl = new MorningTrain\TogglApi\TogglApi('my-api-token');

Get available endpoints

$toggl->getAvailableEndpoints();

Clients

https://github.com/toggl/toggl_api_docs/blob/master/chapters/clients.md, (*7)

Creating a client

$toggl->createClient($clientObject);

Updating a client

$toggl->updateClient($clientId, $clientObject);

Deleting a client

$toggl->deleteClient($clientId);

Get all clients

$toggl->getClients();

Get all projects for a client

$toggl->getClientProjects($clientId);

Get all active projects for a client

$toggl->getActiveClientProjects($clientId);

Get all inactive projects for a client

$toggl->getInactiveClientProjects($clientId);

Get both active and inactive projects for a client

$toggl->getAllClientProjects($clientId);

Get client by id

$toggl->getClientById($clientId);

Project users

https://github.com/toggl/toggl_api_docs/blob/master/chapters/project_users.md, (*8)

Create project user

$toggl->createProjectUser($projectUserObject);

Create project users

$toggl->createProjectUsers($projectUserObject);

Update project user

$toggl->updateProjectUser($projectUserId, $projectUserObject);

Update project users

$toggl->updateProjectUsers($projectUserIds, $projectUserObject);

Create project users

$toggl->deleteProjectUser($projectUserId);

Create project users

$toggl->deleteProjectUsers($projectUserIds);

Projects

https://github.com/toggl/toggl_api_docs/blob/master/chapters/projects.md, (*9)

Create project

$toggl->createProject($projectObject);

Update project

$toggl->updateProject($projectId, $projectObject);

Delete project

$toggl->deleteProject($projectId);

Delete projects

$toggl->deleteProjects($projectIds);

Get users for project

$toggl->getProjectUserRelations($projectId);

Get project tasks

$toggl->getProjectTasks($projectId);

Get project by ID

$toggl->getProject($projectId);

Dashboard

https://github.com/toggl/toggl_api_docs/blob/master/chapters/dashboard.md, (*10)

Get dashboard for workspace

$toggl->getDashboardForWorkspace($workspaceId);

Users

https://github.com/toggl/toggl_api_docs/blob/master/chapters/users.md, (*11)

Get me

$related defaults to false. Set it to true, to get related data, (*12)

$toggl->getMe($related);

Update me

$toggl->updateMe($userObject);

Sign up

$toggl->signup($userObject);

Reset API Token

$toggl->resetApiToken();

Workspaces

https://github.com/toggl/toggl_api_docs/blob/master/chapters/workspaces.md, (*13)

Get workspaces

$toggl->getWorkspaces();

Get workspace by ID

$toggl->getWorkspace($workspaceId);

Update workspace

$toggl->updateWorkspace($workspaceId, $workspaceObject);

Get workspace users

$toggl->getWorkspaceUsers($workspaceId);

Get workspace clients

$toggl->getWorkspaceClients($workspaceId);

Get workspace projects

$toggl->getWorkspaceProjects($workspaceId);

Get workspace tasks

$toggl->getWorkspaceTasks($workspaceId);

Get workspace tags

$toggl->getWorkspaceTags($workspaceId);

Workspace users

https://github.com/toggl/toggl_api_docs/blob/master/chapters/workspace_users.md, (*14)

Invite users to workspace

$toggl->inviteUsersToWorkspace($workspaceId, $emails);

Update workspace user

$toggl->updateWorkspaceUser($workspaceUserId, $userObject);

Delete workspace user

$toggl->deleteWorkspaceUser($workspaceUserId);

Get workspace users for workspace

$toggl->getWorkspaceUserRelations($workspaceId);

Tags

https://github.com/toggl/toggl_api_docs/blob/master/chapters/tags.md, (*15)

Create tag

$toggl->createTag($tagObject);

Update tag

$toggl->updateTag($tagId, $tagObject);

Delete tag

$toggl->deleteTag($tagId);

Tasks

https://github.com/toggl/toggl_api_docs/blob/master/chapters/tags.md, (*16)

Get task

$toggl->getTask($taskId);

Create task

$toggl->createTask($taskObject);

Update task

$toggl->updateTask($taskId, $taskObject);

Update tasks

$toggl->updateTasks($taskId, $taskObject);

Delete task

$toggl->deleteTask($taskId);

Delete tasks

$toggl->deleteTasks($taskIds);

Time entries

https://github.com/toggl/toggl_api_docs/blob/master/chapters/time_entries.md, (*17)

Create time entry

$toggl->createTimeEntry($timeEntryObject);

Start time entry

$toggl->startTimeEntry($timeEntryObject);

Stop time entry

$toggl->stopTimeEntry($timeEntryIds);

Get time entry

$toggl->getTimeEntry($timeEntryIds);

Get running time entry

$toggl->getRunningTimeEntry();

Get time entries

$toggl->getTimeEntries();

Get time entries in range

$toggl->getTimeEntriesInRange($start, $end);

Update tags for time entries

$toggl->updateTagsForTimeEntries($timeEntryIds, $timeEntryObject);

Update time entry

$toggl->updateTimeEntry($timeEntryIds, $timeEntryObject);

Delete time entry

$toggl->deleteTimeEntry($timeEntryIds);

Reports API

https://github.com/toggl/toggl_api_docs/blob/master/reports.md, (*18)

Initialization

$toggl = new MorningTrain\TogglApi\TogglReportsApi('my-api-token');

Get available endpoints

$toggl->getAvailableEndpoints();

Methods

Get project report

$toggl->getProjectReport($query);

Get summary report

$toggl->getSummaryReport($query);

Get details report

$toggl->getDetailsReport($query);

Get weekly report

$toggl->getWeeklyReport($query);

The Versions

02/10 2017

dev-master

9999999-dev http://morningtrain.dk/

A complete native php wrapper for the Toggl API

  Sources   Download

GNU General Public License v3.0

The Requires

 

The Development Requires

api php toggl

02/10 2017

v1.0.3

1.0.3.0 http://morningtrain.dk/

A complete native php wrapper for the Toggl API

  Sources   Download

GNU General Public License v3.0

The Requires

 

The Development Requires

api php toggl

18/01 2017

v1.0.2

1.0.2.0 http://morningtrain.dk/

A complete native php wrapper for the Toggl API

  Sources   Download

GNU General Public License v3.0

The Requires

 

api php toggl

24/11 2015

v1.0.1

1.0.1.0 http://morningtrain.dk/

A complete native php wrapper for the Toggl API

  Sources   Download

GNU General Public License v3.0

The Requires

 

api php toggl

20/11 2015

v1.0.0

1.0.0.0 http://morningtrain.dk/

A complete native php wrapper for the Toggl API

  Sources   Download

GNU General Public License v3.0

The Requires

 

api php toggl