├── .gitignore ├── LICENSE ├── README.md ├── apikey-dist.php ├── composer.json ├── composer.lock ├── examples ├── create-client.php ├── create-user.php ├── get-userinfo-by-emailpass.php ├── get-userinfo-by-token.php ├── get-workspaces.php └── report-weekly.php └── src └── AJT └── Toggl ├── AuthenticationDetailsMissingException.php ├── InvalidApiVersionException.php ├── ReportsClient.php ├── TogglClient.php ├── reporting_v2.json ├── services_v9.json └── tests ├── Toggl └── Tests │ └── TogglClientTest.php └── bootstrap.php /.gitignore: -------------------------------------------------------------------------------- 1 | # Bootstrap 2 | app/bootstrap* 3 | 4 | # Symfony directories 5 | vendor/* 6 | */logs/* 7 | */cache/* 8 | web/uploads/* 9 | web/bundles/* 10 | 11 | # Configuration files 12 | app/config/parameters.ini 13 | app/config/parameters.yml 14 | 15 | # Apikey 16 | apikey.php 17 | nbproject 18 | .project 19 | 20 | # phpstorm 21 | .idea* 22 | .idea** 23 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2013-2021 Arend-Jan Tetteroo 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is furnished 8 | to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all 11 | copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | guzzle-toggl 2 | ============ 3 | 4 | A Toggl API client based on Guzzle PHP 5 | 6 | ## Features 7 | 8 | * supports version 9 API with API Key authentication 9 | * supports Toggl Report Api v2 10 | * based on guzzle 7 11 | 12 | ## Installation 13 | 14 | The library is available through Composer, so it's easy to get it. 15 | Simply run this to install it: 16 | 17 | composer require ajt/guzzle-toggl 18 | 19 | ## Usage 20 | 21 | To use the Toggl API Client simply instantiate the client with the api key. 22 | More information on the key and authentication available at https://engineering.toggl.com/docs/authentication 23 | 24 | ```php 25 | $toggl_token]); 32 | 33 | // if you want to see what is happening, add debug => true to the factory call 34 | $toggl_client = TogglClient::factory(['api_key' => $toggl_token, 'debug' => true]); 35 | ``` 36 | 37 | Invoke Commands using our `__call` method (auto-complete phpDocs are included) 38 | 39 | ```php 40 | $toggl_token]); 43 | 44 | $workspaces = $toggl_client->getWorkspaces([]); 45 | 46 | foreach($workspaces as $workspace){ 47 | $id = $workspace['id']; 48 | print $workspace['name'] . "\n"; 49 | } 50 | ``` 51 | 52 | Or Use the `getCommand` method (in this case you need to work with the $response['data'] array: 53 | 54 | ```php 55 | $toggl_token]); 58 | 59 | //Retrieve the Command from Guzzle 60 | $command = $toggl_client->getCommand('GetWorkspaces', []); 61 | $command->prepare(); 62 | 63 | $response = $command->execute(); 64 | 65 | $workspaces = $response['data']; 66 | 67 | foreach($workspaces as $workspace){ 68 | $id = $workspace['id']; 69 | print $workspace['name'] . "\n"; 70 | } 71 | ``` 72 | 73 | ## Examples 74 | Copy the apikey-dist.php to apikey.php (in the root directory) and add your apikey. 75 | Afterwards you can execute the examples in the examples directory. 76 | 77 | You can look at the services.json for details on what methods are available and what parameters are available to call them 78 | 79 | ## Migrating to v9 80 | Almost all the methods retain the same naming, but some parameters have changed. 81 | 82 | The following endpoints now require a `workspace_id` to be passed in the parameters: 83 | - CreateClient 84 | - GetClient 85 | - UpdateClient 86 | - DeleteClient 87 | - CreateProject 88 | - GetProject 89 | - UpdateProject 90 | - CreateProjectUser 91 | - CreateProjectUsers 92 | - UpdateProjectUser 93 | - UpdateProjectUsers 94 | - DeleteProjectUser 95 | - DeleteProjectUsers 96 | - CreateTag 97 | - UpdateTag 98 | - DeleteTag 99 | - CreateTask (also requires a `project_id`) 100 | - GetTask (also requires a `project_id`) 101 | - UpdateTask (also requires a `project_id`) 102 | - UpdateTasks (also requires a `project_id`) 103 | - DeleteTask (also requires a `project_id`) 104 | - DeleteTasks (also requires a `project_id`) 105 | - StartTimeEntry 106 | - StopTimeEntry 107 | - UpdateTimeEntry 108 | - DeleteTimeEntry 109 | 110 | The following endpoints now require a `project_id` to be passed in the parameters: 111 | - CreateTask 112 | - GetTask 113 | - UpdateTask 114 | - UpdateTasks 115 | - DeleteTask 116 | - DeleteTasks 117 | 118 | The following endpoints are new: 119 | - ArchiveClient 120 | - RestoreClient 121 | 122 | The following endpoints have changed their parameters: 123 | - GetProjects (`id` is now `workspace_id`, for clarity) 124 | - GetProjectUsers no longer accepts a `project_id` parameter, but instead accepts a `workspace_id` parameter 125 | 126 | The following endpoints have had their name changed, to match the toggl docs more closely: 127 | - InviteWorkspaceUser -> InviteOrganizationUser 128 | 129 | The following endpoints have been removed: 130 | - GetWorkspaceWorkspaceUsers 131 | - GetWorkspaceProjects (use GetProjects instead) 132 | 133 | ## Todo 134 | 135 | - [ ] Add some more examples 136 | - [ ] Add tests 137 | - [ ] Add some Response models 138 | 139 | ## Contributions welcome 140 | 141 | Found a bug, open an issue, preferably with the debug output and what you did. 142 | Bugfix? Open a Pull Request and I'll look into it. 143 | 144 | ## Contributors: 145 | Thank you to several contributors over the years to keep this updated with toggl's api versions. 146 | See the contributor page for all of them https://github.com/arendjantetteroo/guzzle-toggl/graphs/contributors 147 | 148 | ## License 149 | 150 | The Toggl API client is available under an MIT License. 151 | -------------------------------------------------------------------------------- /apikey-dist.php: -------------------------------------------------------------------------------- 1 | =5.5.0", 25 | "symfony/config": "~3.0", 26 | "symfony/yaml": "~3.0" 27 | }, 28 | "type": "library", 29 | "autoload": { 30 | "psr-4": { 31 | "Guzzle\\Service\\Loader\\": "src/" 32 | } 33 | }, 34 | "notification-url": "https://packagist.org/downloads/", 35 | "license": [ 36 | "MIT" 37 | ], 38 | "authors": [ 39 | { 40 | "name": "Gordon Franke", 41 | "email": "info@nevalon.de" 42 | }, 43 | { 44 | "name": "Community", 45 | "homepage": "https://github.com/gimler/guzzle-description-loader/contributors" 46 | } 47 | ], 48 | "description": "Load guzzle service description from various file formats", 49 | "time": "2016-01-27T06:35:21+00:00" 50 | }, 51 | { 52 | "name": "guzzlehttp/command", 53 | "version": "1.1.0", 54 | "source": { 55 | "type": "git", 56 | "url": "https://github.com/guzzle/command.git", 57 | "reference": "713b58dc242a96eb4c463413d628b2df59f69595" 58 | }, 59 | "dist": { 60 | "type": "zip", 61 | "url": "https://api.github.com/repos/guzzle/command/zipball/713b58dc242a96eb4c463413d628b2df59f69595", 62 | "reference": "713b58dc242a96eb4c463413d628b2df59f69595", 63 | "shasum": "" 64 | }, 65 | "require": { 66 | "guzzlehttp/guzzle": "^7.0.1", 67 | "guzzlehttp/promises": "~1.3", 68 | "guzzlehttp/psr7": "~1.0", 69 | "php": ">=7.2.5" 70 | }, 71 | "require-dev": { 72 | "phpunit/phpunit": "^8.5.5" 73 | }, 74 | "type": "library", 75 | "extra": { 76 | "branch-alias": { 77 | "dev-master": "0.9-dev" 78 | } 79 | }, 80 | "autoload": { 81 | "psr-4": { 82 | "GuzzleHttp\\Command\\": "src/" 83 | } 84 | }, 85 | "notification-url": "https://packagist.org/downloads/", 86 | "license": [ 87 | "MIT" 88 | ], 89 | "authors": [ 90 | { 91 | "name": "Michael Dowling", 92 | "email": "mtdowling@gmail.com", 93 | "homepage": "https://github.com/mtdowling" 94 | }, 95 | { 96 | "name": "Jeremy Lindblom", 97 | "email": "jeremeamia@gmail.com", 98 | "homepage": "https://github.com/jeremeamia" 99 | } 100 | ], 101 | "description": "Provides the foundation for building command-based web service clients", 102 | "support": { 103 | "issues": "https://github.com/guzzle/command/issues", 104 | "source": "https://github.com/guzzle/command/tree/1.1.0" 105 | }, 106 | "time": "2020-09-28T21:43:57+00:00" 107 | }, 108 | { 109 | "name": "guzzlehttp/guzzle", 110 | "version": "7.4.5", 111 | "source": { 112 | "type": "git", 113 | "url": "https://github.com/guzzle/guzzle.git", 114 | "reference": "1dd98b0564cb3f6bd16ce683cb755f94c10fbd82" 115 | }, 116 | "dist": { 117 | "type": "zip", 118 | "url": "https://api.github.com/repos/guzzle/guzzle/zipball/1dd98b0564cb3f6bd16ce683cb755f94c10fbd82", 119 | "reference": "1dd98b0564cb3f6bd16ce683cb755f94c10fbd82", 120 | "shasum": "" 121 | }, 122 | "require": { 123 | "ext-json": "*", 124 | "guzzlehttp/promises": "^1.5", 125 | "guzzlehttp/psr7": "^1.9 || ^2.4", 126 | "php": "^7.2.5 || ^8.0", 127 | "psr/http-client": "^1.0", 128 | "symfony/deprecation-contracts": "^2.2 || ^3.0" 129 | }, 130 | "provide": { 131 | "psr/http-client-implementation": "1.0" 132 | }, 133 | "require-dev": { 134 | "bamarni/composer-bin-plugin": "^1.4.1", 135 | "ext-curl": "*", 136 | "php-http/client-integration-tests": "^3.0", 137 | "phpunit/phpunit": "^8.5.5 || ^9.3.5", 138 | "psr/log": "^1.1 || ^2.0 || ^3.0" 139 | }, 140 | "suggest": { 141 | "ext-curl": "Required for CURL handler support", 142 | "ext-intl": "Required for Internationalized Domain Name (IDN) support", 143 | "psr/log": "Required for using the Log middleware" 144 | }, 145 | "type": "library", 146 | "extra": { 147 | "branch-alias": { 148 | "dev-master": "7.4-dev" 149 | } 150 | }, 151 | "autoload": { 152 | "files": [ 153 | "src/functions_include.php" 154 | ], 155 | "psr-4": { 156 | "GuzzleHttp\\": "src/" 157 | } 158 | }, 159 | "notification-url": "https://packagist.org/downloads/", 160 | "license": [ 161 | "MIT" 162 | ], 163 | "authors": [ 164 | { 165 | "name": "Graham Campbell", 166 | "email": "hello@gjcampbell.co.uk", 167 | "homepage": "https://github.com/GrahamCampbell" 168 | }, 169 | { 170 | "name": "Michael Dowling", 171 | "email": "mtdowling@gmail.com", 172 | "homepage": "https://github.com/mtdowling" 173 | }, 174 | { 175 | "name": "Jeremy Lindblom", 176 | "email": "jeremeamia@gmail.com", 177 | "homepage": "https://github.com/jeremeamia" 178 | }, 179 | { 180 | "name": "George Mponos", 181 | "email": "gmponos@gmail.com", 182 | "homepage": "https://github.com/gmponos" 183 | }, 184 | { 185 | "name": "Tobias Nyholm", 186 | "email": "tobias.nyholm@gmail.com", 187 | "homepage": "https://github.com/Nyholm" 188 | }, 189 | { 190 | "name": "Márk Sági-Kazár", 191 | "email": "mark.sagikazar@gmail.com", 192 | "homepage": "https://github.com/sagikazarmark" 193 | }, 194 | { 195 | "name": "Tobias Schultze", 196 | "email": "webmaster@tubo-world.de", 197 | "homepage": "https://github.com/Tobion" 198 | } 199 | ], 200 | "description": "Guzzle is a PHP HTTP client library", 201 | "keywords": [ 202 | "client", 203 | "curl", 204 | "framework", 205 | "http", 206 | "http client", 207 | "psr-18", 208 | "psr-7", 209 | "rest", 210 | "web service" 211 | ], 212 | "support": { 213 | "issues": "https://github.com/guzzle/guzzle/issues", 214 | "source": "https://github.com/guzzle/guzzle/tree/7.4.5" 215 | }, 216 | "funding": [ 217 | { 218 | "url": "https://github.com/GrahamCampbell", 219 | "type": "github" 220 | }, 221 | { 222 | "url": "https://github.com/Nyholm", 223 | "type": "github" 224 | }, 225 | { 226 | "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/guzzle", 227 | "type": "tidelift" 228 | } 229 | ], 230 | "time": "2022-06-20T22:16:13+00:00" 231 | }, 232 | { 233 | "name": "guzzlehttp/guzzle-services", 234 | "version": "1.2.0", 235 | "source": { 236 | "type": "git", 237 | "url": "https://github.com/guzzle/guzzle-services.git", 238 | "reference": "21e931a4784a132fa78ea7c37abf0e806b053c23" 239 | }, 240 | "dist": { 241 | "type": "zip", 242 | "url": "https://api.github.com/repos/guzzle/guzzle-services/zipball/21e931a4784a132fa78ea7c37abf0e806b053c23", 243 | "reference": "21e931a4784a132fa78ea7c37abf0e806b053c23", 244 | "shasum": "" 245 | }, 246 | "require": { 247 | "guzzlehttp/command": "^1.1.0", 248 | "guzzlehttp/guzzle": "^7.0.1", 249 | "guzzlehttp/uri-template": "^0.2.0", 250 | "php": ">=7.3" 251 | }, 252 | "require-dev": { 253 | "phpunit/phpunit": "~9.0" 254 | }, 255 | "suggest": { 256 | "gimler/guzzle-description-loader": "^0.0.4" 257 | }, 258 | "type": "library", 259 | "extra": { 260 | "branch-alias": { 261 | "dev-master": "1.0.x-dev" 262 | } 263 | }, 264 | "autoload": { 265 | "psr-4": { 266 | "GuzzleHttp\\Command\\Guzzle\\": "src/" 267 | } 268 | }, 269 | "notification-url": "https://packagist.org/downloads/", 270 | "license": [ 271 | "MIT" 272 | ], 273 | "authors": [ 274 | { 275 | "name": "Michael Dowling", 276 | "email": "mtdowling@gmail.com", 277 | "homepage": "https://github.com/mtdowling" 278 | }, 279 | { 280 | "name": "Jeremy Lindblom", 281 | "email": "jeremeamia@gmail.com", 282 | "homepage": "https://github.com/jeremeamia" 283 | }, 284 | { 285 | "name": "Stefano Kowalke", 286 | "email": "blueduck@mail.org", 287 | "homepage": "https://github.com/konafets" 288 | } 289 | ], 290 | "description": "Provides an implementation of the Guzzle Command library that uses Guzzle service descriptions to describe web services, serialize requests, and parse responses into easy to use model structures.", 291 | "support": { 292 | "issues": "https://github.com/guzzle/guzzle-services/issues", 293 | "source": "https://github.com/guzzle/guzzle-services/tree/1.2.0" 294 | }, 295 | "time": "2020-11-13T22:17:22+00:00" 296 | }, 297 | { 298 | "name": "guzzlehttp/promises", 299 | "version": "1.5.1", 300 | "source": { 301 | "type": "git", 302 | "url": "https://github.com/guzzle/promises.git", 303 | "reference": "fe752aedc9fd8fcca3fe7ad05d419d32998a06da" 304 | }, 305 | "dist": { 306 | "type": "zip", 307 | "url": "https://api.github.com/repos/guzzle/promises/zipball/fe752aedc9fd8fcca3fe7ad05d419d32998a06da", 308 | "reference": "fe752aedc9fd8fcca3fe7ad05d419d32998a06da", 309 | "shasum": "" 310 | }, 311 | "require": { 312 | "php": ">=5.5" 313 | }, 314 | "require-dev": { 315 | "symfony/phpunit-bridge": "^4.4 || ^5.1" 316 | }, 317 | "type": "library", 318 | "extra": { 319 | "branch-alias": { 320 | "dev-master": "1.5-dev" 321 | } 322 | }, 323 | "autoload": { 324 | "files": [ 325 | "src/functions_include.php" 326 | ], 327 | "psr-4": { 328 | "GuzzleHttp\\Promise\\": "src/" 329 | } 330 | }, 331 | "notification-url": "https://packagist.org/downloads/", 332 | "license": [ 333 | "MIT" 334 | ], 335 | "authors": [ 336 | { 337 | "name": "Graham Campbell", 338 | "email": "hello@gjcampbell.co.uk", 339 | "homepage": "https://github.com/GrahamCampbell" 340 | }, 341 | { 342 | "name": "Michael Dowling", 343 | "email": "mtdowling@gmail.com", 344 | "homepage": "https://github.com/mtdowling" 345 | }, 346 | { 347 | "name": "Tobias Nyholm", 348 | "email": "tobias.nyholm@gmail.com", 349 | "homepage": "https://github.com/Nyholm" 350 | }, 351 | { 352 | "name": "Tobias Schultze", 353 | "email": "webmaster@tubo-world.de", 354 | "homepage": "https://github.com/Tobion" 355 | } 356 | ], 357 | "description": "Guzzle promises library", 358 | "keywords": [ 359 | "promise" 360 | ], 361 | "support": { 362 | "issues": "https://github.com/guzzle/promises/issues", 363 | "source": "https://github.com/guzzle/promises/tree/1.5.1" 364 | }, 365 | "funding": [ 366 | { 367 | "url": "https://github.com/GrahamCampbell", 368 | "type": "github" 369 | }, 370 | { 371 | "url": "https://github.com/Nyholm", 372 | "type": "github" 373 | }, 374 | { 375 | "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/promises", 376 | "type": "tidelift" 377 | } 378 | ], 379 | "time": "2021-10-22T20:56:57+00:00" 380 | }, 381 | { 382 | "name": "guzzlehttp/psr7", 383 | "version": "1.9.1", 384 | "source": { 385 | "type": "git", 386 | "url": "https://github.com/guzzle/psr7.git", 387 | "reference": "e4490cabc77465aaee90b20cfc9a770f8c04be6b" 388 | }, 389 | "dist": { 390 | "type": "zip", 391 | "url": "https://api.github.com/repos/guzzle/psr7/zipball/e4490cabc77465aaee90b20cfc9a770f8c04be6b", 392 | "reference": "e4490cabc77465aaee90b20cfc9a770f8c04be6b", 393 | "shasum": "" 394 | }, 395 | "require": { 396 | "php": ">=5.4.0", 397 | "psr/http-message": "~1.0", 398 | "ralouphie/getallheaders": "^2.0.5 || ^3.0.0" 399 | }, 400 | "provide": { 401 | "psr/http-message-implementation": "1.0" 402 | }, 403 | "require-dev": { 404 | "ext-zlib": "*", 405 | "phpunit/phpunit": "~4.8.36 || ^5.7.27 || ^6.5.14 || ^7.5.20 || ^8.5.8 || ^9.3.10" 406 | }, 407 | "suggest": { 408 | "laminas/laminas-httphandlerrunner": "Emit PSR-7 responses" 409 | }, 410 | "type": "library", 411 | "autoload": { 412 | "files": [ 413 | "src/functions_include.php" 414 | ], 415 | "psr-4": { 416 | "GuzzleHttp\\Psr7\\": "src/" 417 | } 418 | }, 419 | "notification-url": "https://packagist.org/downloads/", 420 | "license": [ 421 | "MIT" 422 | ], 423 | "authors": [ 424 | { 425 | "name": "Graham Campbell", 426 | "email": "hello@gjcampbell.co.uk", 427 | "homepage": "https://github.com/GrahamCampbell" 428 | }, 429 | { 430 | "name": "Michael Dowling", 431 | "email": "mtdowling@gmail.com", 432 | "homepage": "https://github.com/mtdowling" 433 | }, 434 | { 435 | "name": "George Mponos", 436 | "email": "gmponos@gmail.com", 437 | "homepage": "https://github.com/gmponos" 438 | }, 439 | { 440 | "name": "Tobias Nyholm", 441 | "email": "tobias.nyholm@gmail.com", 442 | "homepage": "https://github.com/Nyholm" 443 | }, 444 | { 445 | "name": "Márk Sági-Kazár", 446 | "email": "mark.sagikazar@gmail.com", 447 | "homepage": "https://github.com/sagikazarmark" 448 | }, 449 | { 450 | "name": "Tobias Schultze", 451 | "email": "webmaster@tubo-world.de", 452 | "homepage": "https://github.com/Tobion" 453 | } 454 | ], 455 | "description": "PSR-7 message implementation that also provides common utility methods", 456 | "keywords": [ 457 | "http", 458 | "message", 459 | "psr-7", 460 | "request", 461 | "response", 462 | "stream", 463 | "uri", 464 | "url" 465 | ], 466 | "support": { 467 | "issues": "https://github.com/guzzle/psr7/issues", 468 | "source": "https://github.com/guzzle/psr7/tree/1.9.1" 469 | }, 470 | "funding": [ 471 | { 472 | "url": "https://github.com/GrahamCampbell", 473 | "type": "github" 474 | }, 475 | { 476 | "url": "https://github.com/Nyholm", 477 | "type": "github" 478 | }, 479 | { 480 | "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/psr7", 481 | "type": "tidelift" 482 | } 483 | ], 484 | "time": "2023-04-17T16:00:37+00:00" 485 | }, 486 | { 487 | "name": "guzzlehttp/uri-template", 488 | "version": "v0.2.0", 489 | "source": { 490 | "type": "git", 491 | "url": "https://github.com/guzzle/uri-template.git", 492 | "reference": "db46525d6d8fee71033b73cc07160f3e5271a8ce" 493 | }, 494 | "dist": { 495 | "type": "zip", 496 | "url": "https://api.github.com/repos/guzzle/uri-template/zipball/db46525d6d8fee71033b73cc07160f3e5271a8ce", 497 | "reference": "db46525d6d8fee71033b73cc07160f3e5271a8ce", 498 | "shasum": "" 499 | }, 500 | "require": { 501 | "php": "^7.1 || ^8.0", 502 | "symfony/polyfill-php80": "^1.17" 503 | }, 504 | "require-dev": { 505 | "phpunit/phpunit": "^7.5.15 || ^8.5 || ^9.3", 506 | "uri-template/tests": "1.0.0" 507 | }, 508 | "type": "library", 509 | "extra": { 510 | "branch-alias": { 511 | "dev-master": "1.0-dev" 512 | } 513 | }, 514 | "autoload": { 515 | "psr-4": { 516 | "GuzzleHttp\\UriTemplate\\": "src" 517 | } 518 | }, 519 | "notification-url": "https://packagist.org/downloads/", 520 | "license": [ 521 | "MIT" 522 | ], 523 | "authors": [ 524 | { 525 | "name": "George Mponos", 526 | "email": "gmponos@gmail.com", 527 | "homepage": "https://github.com/gmponos", 528 | "role": "Developer" 529 | } 530 | ], 531 | "description": "A polyfill class for uri_template of PHP", 532 | "homepage": "https://github.com/guzzlehttp/uri-template", 533 | "keywords": [ 534 | "guzzlehttp", 535 | "uri-template" 536 | ], 537 | "support": { 538 | "issues": "https://github.com/guzzle/uri-template/issues", 539 | "source": "https://github.com/guzzle/uri-template/tree/master" 540 | }, 541 | "funding": [ 542 | { 543 | "url": "https://github.com/GrahamCampbell", 544 | "type": "github" 545 | }, 546 | { 547 | "url": "https://github.com/gmponos", 548 | "type": "github" 549 | } 550 | ], 551 | "time": "2020-07-21T13:45:09+00:00" 552 | }, 553 | { 554 | "name": "psr/http-client", 555 | "version": "1.0.1", 556 | "source": { 557 | "type": "git", 558 | "url": "https://github.com/php-fig/http-client.git", 559 | "reference": "2dfb5f6c5eff0e91e20e913f8c5452ed95b86621" 560 | }, 561 | "dist": { 562 | "type": "zip", 563 | "url": "https://api.github.com/repos/php-fig/http-client/zipball/2dfb5f6c5eff0e91e20e913f8c5452ed95b86621", 564 | "reference": "2dfb5f6c5eff0e91e20e913f8c5452ed95b86621", 565 | "shasum": "" 566 | }, 567 | "require": { 568 | "php": "^7.0 || ^8.0", 569 | "psr/http-message": "^1.0" 570 | }, 571 | "type": "library", 572 | "extra": { 573 | "branch-alias": { 574 | "dev-master": "1.0.x-dev" 575 | } 576 | }, 577 | "autoload": { 578 | "psr-4": { 579 | "Psr\\Http\\Client\\": "src/" 580 | } 581 | }, 582 | "notification-url": "https://packagist.org/downloads/", 583 | "license": [ 584 | "MIT" 585 | ], 586 | "authors": [ 587 | { 588 | "name": "PHP-FIG", 589 | "homepage": "http://www.php-fig.org/" 590 | } 591 | ], 592 | "description": "Common interface for HTTP clients", 593 | "homepage": "https://github.com/php-fig/http-client", 594 | "keywords": [ 595 | "http", 596 | "http-client", 597 | "psr", 598 | "psr-18" 599 | ], 600 | "support": { 601 | "source": "https://github.com/php-fig/http-client/tree/master" 602 | }, 603 | "time": "2020-06-29T06:28:15+00:00" 604 | }, 605 | { 606 | "name": "psr/http-message", 607 | "version": "1.1", 608 | "source": { 609 | "type": "git", 610 | "url": "https://github.com/php-fig/http-message.git", 611 | "reference": "cb6ce4845ce34a8ad9e68117c10ee90a29919eba" 612 | }, 613 | "dist": { 614 | "type": "zip", 615 | "url": "https://api.github.com/repos/php-fig/http-message/zipball/cb6ce4845ce34a8ad9e68117c10ee90a29919eba", 616 | "reference": "cb6ce4845ce34a8ad9e68117c10ee90a29919eba", 617 | "shasum": "" 618 | }, 619 | "require": { 620 | "php": "^7.2 || ^8.0" 621 | }, 622 | "type": "library", 623 | "extra": { 624 | "branch-alias": { 625 | "dev-master": "1.1.x-dev" 626 | } 627 | }, 628 | "autoload": { 629 | "psr-4": { 630 | "Psr\\Http\\Message\\": "src/" 631 | } 632 | }, 633 | "notification-url": "https://packagist.org/downloads/", 634 | "license": [ 635 | "MIT" 636 | ], 637 | "authors": [ 638 | { 639 | "name": "PHP-FIG", 640 | "homepage": "http://www.php-fig.org/" 641 | } 642 | ], 643 | "description": "Common interface for HTTP messages", 644 | "homepage": "https://github.com/php-fig/http-message", 645 | "keywords": [ 646 | "http", 647 | "http-message", 648 | "psr", 649 | "psr-7", 650 | "request", 651 | "response" 652 | ], 653 | "support": { 654 | "source": "https://github.com/php-fig/http-message/tree/1.1" 655 | }, 656 | "time": "2023-04-04T09:50:52+00:00" 657 | }, 658 | { 659 | "name": "ralouphie/getallheaders", 660 | "version": "3.0.3", 661 | "source": { 662 | "type": "git", 663 | "url": "https://github.com/ralouphie/getallheaders.git", 664 | "reference": "120b605dfeb996808c31b6477290a714d356e822" 665 | }, 666 | "dist": { 667 | "type": "zip", 668 | "url": "https://api.github.com/repos/ralouphie/getallheaders/zipball/120b605dfeb996808c31b6477290a714d356e822", 669 | "reference": "120b605dfeb996808c31b6477290a714d356e822", 670 | "shasum": "" 671 | }, 672 | "require": { 673 | "php": ">=5.6" 674 | }, 675 | "require-dev": { 676 | "php-coveralls/php-coveralls": "^2.1", 677 | "phpunit/phpunit": "^5 || ^6.5" 678 | }, 679 | "type": "library", 680 | "autoload": { 681 | "files": [ 682 | "src/getallheaders.php" 683 | ] 684 | }, 685 | "notification-url": "https://packagist.org/downloads/", 686 | "license": [ 687 | "MIT" 688 | ], 689 | "authors": [ 690 | { 691 | "name": "Ralph Khattar", 692 | "email": "ralph.khattar@gmail.com" 693 | } 694 | ], 695 | "description": "A polyfill for getallheaders.", 696 | "support": { 697 | "issues": "https://github.com/ralouphie/getallheaders/issues", 698 | "source": "https://github.com/ralouphie/getallheaders/tree/develop" 699 | }, 700 | "time": "2019-03-08T08:55:37+00:00" 701 | }, 702 | { 703 | "name": "symfony/config", 704 | "version": "v3.3.4", 705 | "source": { 706 | "type": "git", 707 | "url": "https://github.com/symfony/config.git", 708 | "reference": "a094618deb9a3fe1c3cf500a796e167d0495a274" 709 | }, 710 | "dist": { 711 | "type": "zip", 712 | "url": "https://api.github.com/repos/symfony/config/zipball/a094618deb9a3fe1c3cf500a796e167d0495a274", 713 | "reference": "a094618deb9a3fe1c3cf500a796e167d0495a274", 714 | "shasum": "" 715 | }, 716 | "require": { 717 | "php": ">=5.5.9", 718 | "symfony/filesystem": "~2.8|~3.0" 719 | }, 720 | "conflict": { 721 | "symfony/dependency-injection": "<3.3", 722 | "symfony/finder": "<3.3" 723 | }, 724 | "require-dev": { 725 | "symfony/dependency-injection": "~3.3", 726 | "symfony/finder": "~3.3", 727 | "symfony/yaml": "~3.0" 728 | }, 729 | "suggest": { 730 | "symfony/yaml": "To use the yaml reference dumper" 731 | }, 732 | "type": "library", 733 | "extra": { 734 | "branch-alias": { 735 | "dev-master": "3.3-dev" 736 | } 737 | }, 738 | "autoload": { 739 | "psr-4": { 740 | "Symfony\\Component\\Config\\": "" 741 | }, 742 | "exclude-from-classmap": [ 743 | "/Tests/" 744 | ] 745 | }, 746 | "notification-url": "https://packagist.org/downloads/", 747 | "license": [ 748 | "MIT" 749 | ], 750 | "authors": [ 751 | { 752 | "name": "Fabien Potencier", 753 | "email": "fabien@symfony.com" 754 | }, 755 | { 756 | "name": "Symfony Community", 757 | "homepage": "https://symfony.com/contributors" 758 | } 759 | ], 760 | "description": "Symfony Config Component", 761 | "homepage": "https://symfony.com", 762 | "time": "2017-06-16T12:40:34+00:00" 763 | }, 764 | { 765 | "name": "symfony/deprecation-contracts", 766 | "version": "v2.5.1", 767 | "source": { 768 | "type": "git", 769 | "url": "https://github.com/symfony/deprecation-contracts.git", 770 | "reference": "e8b495ea28c1d97b5e0c121748d6f9b53d075c66" 771 | }, 772 | "dist": { 773 | "type": "zip", 774 | "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/e8b495ea28c1d97b5e0c121748d6f9b53d075c66", 775 | "reference": "e8b495ea28c1d97b5e0c121748d6f9b53d075c66", 776 | "shasum": "" 777 | }, 778 | "require": { 779 | "php": ">=7.1" 780 | }, 781 | "type": "library", 782 | "extra": { 783 | "branch-alias": { 784 | "dev-main": "2.5-dev" 785 | }, 786 | "thanks": { 787 | "name": "symfony/contracts", 788 | "url": "https://github.com/symfony/contracts" 789 | } 790 | }, 791 | "autoload": { 792 | "files": [ 793 | "function.php" 794 | ] 795 | }, 796 | "notification-url": "https://packagist.org/downloads/", 797 | "license": [ 798 | "MIT" 799 | ], 800 | "authors": [ 801 | { 802 | "name": "Nicolas Grekas", 803 | "email": "p@tchwork.com" 804 | }, 805 | { 806 | "name": "Symfony Community", 807 | "homepage": "https://symfony.com/contributors" 808 | } 809 | ], 810 | "description": "A generic function and convention to trigger deprecation notices", 811 | "homepage": "https://symfony.com", 812 | "support": { 813 | "source": "https://github.com/symfony/deprecation-contracts/tree/v2.5.1" 814 | }, 815 | "funding": [ 816 | { 817 | "url": "https://symfony.com/sponsor", 818 | "type": "custom" 819 | }, 820 | { 821 | "url": "https://github.com/fabpot", 822 | "type": "github" 823 | }, 824 | { 825 | "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", 826 | "type": "tidelift" 827 | } 828 | ], 829 | "time": "2022-01-02T09:53:40+00:00" 830 | }, 831 | { 832 | "name": "symfony/filesystem", 833 | "version": "v3.3.4", 834 | "source": { 835 | "type": "git", 836 | "url": "https://github.com/symfony/filesystem.git", 837 | "reference": "311fa718389efbd8b627c272b9324a62437018cc" 838 | }, 839 | "dist": { 840 | "type": "zip", 841 | "url": "https://api.github.com/repos/symfony/filesystem/zipball/311fa718389efbd8b627c272b9324a62437018cc", 842 | "reference": "311fa718389efbd8b627c272b9324a62437018cc", 843 | "shasum": "" 844 | }, 845 | "require": { 846 | "php": ">=5.5.9" 847 | }, 848 | "type": "library", 849 | "extra": { 850 | "branch-alias": { 851 | "dev-master": "3.3-dev" 852 | } 853 | }, 854 | "autoload": { 855 | "psr-4": { 856 | "Symfony\\Component\\Filesystem\\": "" 857 | }, 858 | "exclude-from-classmap": [ 859 | "/Tests/" 860 | ] 861 | }, 862 | "notification-url": "https://packagist.org/downloads/", 863 | "license": [ 864 | "MIT" 865 | ], 866 | "authors": [ 867 | { 868 | "name": "Fabien Potencier", 869 | "email": "fabien@symfony.com" 870 | }, 871 | { 872 | "name": "Symfony Community", 873 | "homepage": "https://symfony.com/contributors" 874 | } 875 | ], 876 | "description": "Symfony Filesystem Component", 877 | "homepage": "https://symfony.com", 878 | "time": "2017-06-24T09:29:48+00:00" 879 | }, 880 | { 881 | "name": "symfony/polyfill-php80", 882 | "version": "v1.23.0", 883 | "source": { 884 | "type": "git", 885 | "url": "https://github.com/symfony/polyfill-php80.git", 886 | "reference": "eca0bf41ed421bed1b57c4958bab16aa86b757d0" 887 | }, 888 | "dist": { 889 | "type": "zip", 890 | "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/eca0bf41ed421bed1b57c4958bab16aa86b757d0", 891 | "reference": "eca0bf41ed421bed1b57c4958bab16aa86b757d0", 892 | "shasum": "" 893 | }, 894 | "require": { 895 | "php": ">=7.1" 896 | }, 897 | "type": "library", 898 | "extra": { 899 | "branch-alias": { 900 | "dev-main": "1.23-dev" 901 | }, 902 | "thanks": { 903 | "name": "symfony/polyfill", 904 | "url": "https://github.com/symfony/polyfill" 905 | } 906 | }, 907 | "autoload": { 908 | "psr-4": { 909 | "Symfony\\Polyfill\\Php80\\": "" 910 | }, 911 | "files": [ 912 | "bootstrap.php" 913 | ], 914 | "classmap": [ 915 | "Resources/stubs" 916 | ] 917 | }, 918 | "notification-url": "https://packagist.org/downloads/", 919 | "license": [ 920 | "MIT" 921 | ], 922 | "authors": [ 923 | { 924 | "name": "Ion Bazan", 925 | "email": "ion.bazan@gmail.com" 926 | }, 927 | { 928 | "name": "Nicolas Grekas", 929 | "email": "p@tchwork.com" 930 | }, 931 | { 932 | "name": "Symfony Community", 933 | "homepage": "https://symfony.com/contributors" 934 | } 935 | ], 936 | "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", 937 | "homepage": "https://symfony.com", 938 | "keywords": [ 939 | "compatibility", 940 | "polyfill", 941 | "portable", 942 | "shim" 943 | ], 944 | "support": { 945 | "source": "https://github.com/symfony/polyfill-php80/tree/v1.23.0" 946 | }, 947 | "funding": [ 948 | { 949 | "url": "https://symfony.com/sponsor", 950 | "type": "custom" 951 | }, 952 | { 953 | "url": "https://github.com/fabpot", 954 | "type": "github" 955 | }, 956 | { 957 | "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", 958 | "type": "tidelift" 959 | } 960 | ], 961 | "time": "2021-02-19T12:13:01+00:00" 962 | }, 963 | { 964 | "name": "symfony/yaml", 965 | "version": "v3.3.4", 966 | "source": { 967 | "type": "git", 968 | "url": "https://github.com/symfony/yaml.git", 969 | "reference": "1f93a8d19b8241617f5074a123e282575b821df8" 970 | }, 971 | "dist": { 972 | "type": "zip", 973 | "url": "https://api.github.com/repos/symfony/yaml/zipball/1f93a8d19b8241617f5074a123e282575b821df8", 974 | "reference": "1f93a8d19b8241617f5074a123e282575b821df8", 975 | "shasum": "" 976 | }, 977 | "require": { 978 | "php": ">=5.5.9" 979 | }, 980 | "require-dev": { 981 | "symfony/console": "~2.8|~3.0" 982 | }, 983 | "suggest": { 984 | "symfony/console": "For validating YAML files using the lint command" 985 | }, 986 | "type": "library", 987 | "extra": { 988 | "branch-alias": { 989 | "dev-master": "3.3-dev" 990 | } 991 | }, 992 | "autoload": { 993 | "psr-4": { 994 | "Symfony\\Component\\Yaml\\": "" 995 | }, 996 | "exclude-from-classmap": [ 997 | "/Tests/" 998 | ] 999 | }, 1000 | "notification-url": "https://packagist.org/downloads/", 1001 | "license": [ 1002 | "MIT" 1003 | ], 1004 | "authors": [ 1005 | { 1006 | "name": "Fabien Potencier", 1007 | "email": "fabien@symfony.com" 1008 | }, 1009 | { 1010 | "name": "Symfony Community", 1011 | "homepage": "https://symfony.com/contributors" 1012 | } 1013 | ], 1014 | "description": "Symfony Yaml Component", 1015 | "homepage": "https://symfony.com", 1016 | "time": "2017-06-15T12:58:50+00:00" 1017 | } 1018 | ], 1019 | "packages-dev": [], 1020 | "aliases": [], 1021 | "minimum-stability": "stable", 1022 | "stability-flags": [], 1023 | "prefer-stable": false, 1024 | "prefer-lowest": false, 1025 | "platform": [], 1026 | "platform-dev": [], 1027 | "plugin-api-version": "2.6.0" 1028 | } 1029 | -------------------------------------------------------------------------------- /examples/create-client.php: -------------------------------------------------------------------------------- 1 | $toggl_api_key, 'apiVersion' => $toggl_api_version, 'debug' => true)); 11 | 12 | // Create a client 13 | print "createClient\n"; 14 | // manually populate variables to create test client 15 | $client_name = "My Toggl Test client"; 16 | $wid = 807286; // Retrieve this with the get-workspaces.php file and update 17 | $client_notes = "11"; 18 | 19 | echo "What should post is: $client_name - $wid - $client_notes"; 20 | $clientdata = array('client' => array('name' => $client_name, 'wid' => $wid, 'notes' => $client_notes)); 21 | $response = $toggl_client->createClient($clientdata); -------------------------------------------------------------------------------- /examples/create-user.php: -------------------------------------------------------------------------------- 1 | $toggl_api_key, 'apiVersion' => $toggl_api_version, 'debug' => true)); 11 | 12 | // Create a user 13 | print "createUser\n"; 14 | $user = $toggl_client->createUser(['user' => [ 15 | 'email' => 'user@example.com', 16 | 'password' => 'abcdefghi', 17 | ] 18 | ]); 19 | 20 | var_dump($user); 21 | 22 | // Get the current user 23 | $currentUser = $toggl_client->GetCurrentUser(); 24 | 25 | var_dump($currentUser); -------------------------------------------------------------------------------- /examples/get-userinfo-by-emailpass.php: -------------------------------------------------------------------------------- 1 | $username, 'password' => $password, 'apiVersion' => $toggl_api_version, 'debug' => true)); 11 | 12 | // Get the current user 13 | $currentUser = $toggl_client->GetCurrentUser(); 14 | 15 | var_dump($currentUser); -------------------------------------------------------------------------------- /examples/get-userinfo-by-token.php: -------------------------------------------------------------------------------- 1 | $toggl_api_key, 'apiVersion' => $toggl_api_version, 'debug' => true)); 11 | 12 | // Get the current user 13 | $currentUser = $toggl_client->GetCurrentUser(); 14 | 15 | var_dump($currentUser); -------------------------------------------------------------------------------- /examples/get-workspaces.php: -------------------------------------------------------------------------------- 1 | $toggl_api_key, 'apiVersion' => $toggl_api_version)); 11 | 12 | // Get all workspaces 13 | print "getWorkspaces\n"; 14 | $workspaces = $toggl_client->getWorkspaces(array()); 15 | foreach($workspaces as $workspace){ 16 | $id = $workspace['id']; 17 | print $id . " - " . $workspace['name'] . "\n"; 18 | 19 | // Get all users in this workspace 20 | $users = $toggl_client->getWorkspaceUsers(array('id' => $id)); 21 | print "This workspace has " . count($users) . " users\n"; 22 | foreach ($users as $user){ 23 | print $user['id'] . ' - ' . $user['fullname'] . "\n"; 24 | } 25 | print "\n"; 26 | } 27 | -------------------------------------------------------------------------------- /examples/report-weekly.php: -------------------------------------------------------------------------------- 1 | $toggl_api_key, 12 | 'apiVersion' => $toggle_api_reporting_version, 13 | 'debug' => false, 14 | ]); 15 | 16 | // Create a client 17 | print "getWeeklyReport\n"; 18 | // manually populate variables to create test client 19 | $user_agent = "Toggl PHP Client"; 20 | $wid = 1973711; // Retrieve this with the get-workspaces.php file and update 21 | 22 | // 23 | // 24 | //$clientdata = array('client' => array('name' => $client_name, 'wid' => $wid, 'notes' => $client_notes)); 25 | $response = $toggl_reports->weekly([ 26 | "user_agent" => $user_agent, 27 | "workspace_id" => $wid, 28 | ]); 29 | 30 | $p = $response['data']; 31 | foreach ($p as $entry) { 32 | 33 | $totalMilliseconds = $entry['totals'][7]; 34 | $totalSeconds = $totalMilliseconds / 1000; 35 | 36 | $hours = floor($totalSeconds / 3600); 37 | $mins = floor($totalSeconds / 60 % 60); 38 | 39 | echo $entry['title']['client'] . ' - ' . $entry['title']['project'] . ' (' . $hours . ':' . $mins . ')' . PHP_EOL; 40 | } -------------------------------------------------------------------------------- /src/AJT/Toggl/AuthenticationDetailsMissingException.php: -------------------------------------------------------------------------------- 1 | load($locator->locate($file))); 47 | } 48 | 49 | protected static function getClientConfig($config): array 50 | { 51 | $clientConfig = []; 52 | 53 | if (isset($config['debug']) && is_bool($config['debug'])) { 54 | $clientConfig['debug'] = $config['debug']; 55 | } 56 | 57 | if (isset($config['api_key'])) { 58 | $clientConfig['auth'] = [ 59 | $config['api_key'], 60 | 'api_token', 61 | ]; 62 | return $clientConfig; 63 | } 64 | if (isset($config['username'])) { 65 | if (!isset($config['password'])) { 66 | $config['password'] = 'api_token'; 67 | } 68 | 69 | $clientConfig['auth'] = [ 70 | $config['username'], 71 | $config['password'], 72 | ]; 73 | return $clientConfig; 74 | } 75 | 76 | throw new AuthenticationDetailsMissingException('Provide authentication details'); 77 | } 78 | 79 | /** 80 | * Shortcut for executing Commands in the Definitions. 81 | * 82 | * @param string $method 83 | * @param array|null $args 84 | * 85 | * @return mixed|void 86 | */ 87 | public function __call($method, array $args) 88 | { 89 | $commandName = ucfirst($method); 90 | /** @var Result $result */ 91 | $result = parent::__call($commandName, $args); 92 | // Remove data field 93 | if (is_array($result) && isset($result['data'])) { 94 | return $result['data']; 95 | } 96 | 97 | return $result; 98 | } 99 | } -------------------------------------------------------------------------------- /src/AJT/Toggl/reporting_v2.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Toggl Reports", 3 | "apiVersion": "v2", 4 | "description": "Toggl Reports API v2", 5 | "baseUri": "https://api.track.toggl.com/reports/api/v2/", 6 | "operations": { 7 | "Project": { 8 | "httpMethod": "GET", 9 | "uri": "project", 10 | "summary": "Get projects report", 11 | "responseModel": "getResponse", 12 | "parameters": { 13 | "user_agent": { 14 | "location": "query", 15 | "type": "string", 16 | "required": true, 17 | "description": "string, required, the name of your application or your email address so we can get in touch in case you're doing something wrong." 18 | }, 19 | "workspace_id": { 20 | "location": "query", 21 | "type": "integer", 22 | "required": true, 23 | "description": "integer, required. The workspace which data you want to access." 24 | }, 25 | "project_id": { 26 | "location": "query", 27 | "type": "integer", 28 | "required": true, 29 | "description": "integer, required. The project whose data you want to access" 30 | }, 31 | "page": { 32 | "location": "query", 33 | "type": "integer", 34 | "description": "number of 'tasks_page' you want to fetch" 35 | }, 36 | "order_field": { 37 | "location": "query", 38 | "type": "string", 39 | "description": "name/assignee/duration/billable_amount/estimated_seconds" 40 | }, 41 | "order_desc": { 42 | "location": "query", 43 | "type": "string", 44 | "description": "on/off, on for descending and off for ascending order" 45 | } 46 | } 47 | }, 48 | "Weekly": { 49 | "httpMethod": "GET", 50 | "uri": "weekly", 51 | "summary": "Get weekly report", 52 | "responseModel": "getResponse", 53 | "parameters": { 54 | "user_agent": { 55 | "location": "query", 56 | "type": "string", 57 | "required": true, 58 | "description": "string, required, the name of your application or your email address so we can get in touch in case you're doing something wrong." 59 | }, 60 | "workspace_id": { 61 | "location": "query", 62 | "type": "integer", 63 | "required": true, 64 | "description": "integer, required. The workspace which data you want to access." 65 | }, 66 | "since": { 67 | "location": "query", 68 | "type": "string", 69 | "description": "string, ISO 8601 date (YYYY-MM-DD), by default until - 6 days." 70 | }, 71 | "until": { 72 | "location": "query", 73 | "type": "string", 74 | "description": "string, ISO 8601 date (YYYY-MM-DD), by default today" 75 | }, 76 | "billable": { 77 | "location": "query", 78 | "type": "string", 79 | "default": "both", 80 | "description": "possible values: yes/no/both, default both" 81 | }, 82 | "client_ids": { 83 | "location": "query", 84 | "type": "string", 85 | "description": "client ids separated by a comma, 0 if you want to filter out time entries without a client" 86 | }, 87 | "project_ids": { 88 | "location": "query", 89 | "type": "string", 90 | "description": "project ids separated by a comma, 0 if you want to filter out time entries without a project" 91 | }, 92 | "user_ids": { 93 | "location": "query", 94 | "type": "string", 95 | "description": "user ids separated by a comma" 96 | }, 97 | "tag_ids": { 98 | "location": "query", 99 | "type": "string", 100 | "description": "tag ids separated by a comma, 0 if you want to filter out time entries without a tag" 101 | }, 102 | "task_ids": { 103 | "location": "query", 104 | "type": "string", 105 | "description": "task ids separated by a comma, 0 if you want to filter out time entries without a task" 106 | }, 107 | "time_entry_ids": { 108 | "location": "query", 109 | "type": "string", 110 | "description": "time entry ids separated by a comma" 111 | }, 112 | "description": { 113 | "location": "query", 114 | "type": "string", 115 | "description": "string, time entry description" 116 | }, 117 | "order_field": { 118 | "location": "query", 119 | "type": "string", 120 | "description": "title/day1/day2/day3/day4/day5/day6/day7/week_total in weekly report" 121 | }, 122 | "order_desc": { 123 | "location": "query", 124 | "type": "string", 125 | "description": "on/off, on for descending and off for ascending order" 126 | }, 127 | "distinct_rates": { 128 | "location": "query", 129 | "type": "string", 130 | "description": "on/off, default off" 131 | }, 132 | "rounding": { 133 | "location": "query", 134 | "type": "string", 135 | "description": "on/off, default off, rounds time according to workspace settings" 136 | }, 137 | "display_hours": { 138 | "location": "query", 139 | "type": "string", 140 | "default": "minutes", 141 | "description": "decimal/minutes, display hours with minutes or as a decimal number, default minutes" 142 | }, 143 | "grouping": { 144 | "location": "query", 145 | "type": "string", 146 | "default": "projects", 147 | "description": "users/projects, default projects. If one grouping is selected, the other acts as subgrouping." 148 | }, 149 | "calculate": { 150 | "location": "query", 151 | "type": "string", 152 | "default": "time", 153 | "description": "time/earnings, default time" 154 | } 155 | } 156 | }, 157 | "Details": { 158 | "httpMethod": "GET", 159 | "uri": "details", 160 | "summary": "Get detailed report", 161 | "responseModel": "getResponse", 162 | "parameters": { 163 | "user_agent": { 164 | "location": "query", 165 | "type": "string", 166 | "required": true, 167 | "description": "string, required, the name of your application or your email address so we can get in touch in case you're doing something wrong." 168 | }, 169 | "workspace_id": { 170 | "location": "query", 171 | "type": "integer", 172 | "required": true, 173 | "description": "integer, required. The workspace which data you want to access." 174 | }, 175 | "since": { 176 | "location": "query", 177 | "type": "string", 178 | "description": "string, ISO 8601 date (YYYY-MM-DD), by default until - 6 days." 179 | }, 180 | "until": { 181 | "location": "query", 182 | "type": "string", 183 | "description": "string, ISO 8601 date (YYYY-MM-DD), by default today" 184 | }, 185 | "billable": { 186 | "location": "query", 187 | "type": "string", 188 | "default": "both", 189 | "description": "possible values: yes/no/both, default both" 190 | }, 191 | "client_ids": { 192 | "location": "query", 193 | "type": "string", 194 | "description": "client ids separated by a comma, 0 if you want to filter out time entries without a client" 195 | }, 196 | "project_ids": { 197 | "location": "query", 198 | "type": "string", 199 | "description": "project ids separated by a comma, 0 if you want to filter out time entries without a project" 200 | }, 201 | "user_ids": { 202 | "location": "query", 203 | "type": "string", 204 | "description": "user ids separated by a comma" 205 | }, 206 | "tag_ids": { 207 | "location": "query", 208 | "type": "string", 209 | "description": "tag ids separated by a comma, 0 if you want to filter out time entries without a tag" 210 | }, 211 | "task_ids": { 212 | "location": "query", 213 | "type": "string", 214 | "description": "task ids separated by a comma, 0 if you want to filter out time entries without a task" 215 | }, 216 | "time_entry_ids": { 217 | "location": "query", 218 | "type": "string", 219 | "description": "time entry ids separated by a comma" 220 | }, 221 | "description": { 222 | "location": "query", 223 | "type": "string", 224 | "description": "string, time entry description" 225 | }, 226 | "order_field": { 227 | "location": "query", 228 | "type": "string", 229 | "description": "date/description/duration/user in detailed reports" 230 | }, 231 | "order_desc": { 232 | "location": "query", 233 | "type": "string", 234 | "description": "on/off, on for descending and off for ascending order" 235 | }, 236 | "distinct_rates": { 237 | "location": "query", 238 | "type": "string", 239 | "description": "on/off, default off" 240 | }, 241 | "rounding": { 242 | "location": "query", 243 | "type": "string", 244 | "description": "on/off, default off, rounds time according to workspace settings" 245 | }, 246 | "display_hours": { 247 | "location": "query", 248 | "type": "string", 249 | "default": "minutes", 250 | "description": "decimal/minutes, display hours with minutes or as a decimal number, default minutes" 251 | }, 252 | "page": { 253 | "location": "query", 254 | "type": "integer", 255 | "default": 1, 256 | "description": "integer, default 1" 257 | } 258 | } 259 | }, 260 | "Summary": { 261 | "httpMethod": "GET", 262 | "uri": "summary", 263 | "summary": "Get summary report", 264 | "responseModel": "getResponse", 265 | "parameters": { 266 | "user_agent": { 267 | "location": "query", 268 | "type": "string", 269 | "required": true, 270 | "description": "string, required, the name of your application or your email address so we can get in touch in case you're doing something wrong." 271 | }, 272 | "workspace_id": { 273 | "location": "query", 274 | "type": "integer", 275 | "required": true, 276 | "description": "integer, required. The workspace which data you want to access." 277 | }, 278 | "since": { 279 | "location": "query", 280 | "type": "string", 281 | "description": "string, ISO 8601 date (YYYY-MM-DD), by default until - 6 days." 282 | }, 283 | "until": { 284 | "location": "query", 285 | "type": "string", 286 | "description": "string, ISO 8601 date (YYYY-MM-DD), by default today" 287 | }, 288 | "billable": { 289 | "location": "query", 290 | "type": "string", 291 | "default": "both", 292 | "description": "possible values: yes/no/both, default both" 293 | }, 294 | "client_ids": { 295 | "location": "query", 296 | "type": "string", 297 | "description": "client ids separated by a comma, 0 if you want to filter out time entries without a client" 298 | }, 299 | "project_ids": { 300 | "location": "query", 301 | "type": "string", 302 | "description": "project ids separated by a comma, 0 if you want to filter out time entries without a project" 303 | }, 304 | "user_ids": { 305 | "location": "query", 306 | "type": "string", 307 | "description": "user ids separated by a comma" 308 | }, 309 | "tag_ids": { 310 | "location": "query", 311 | "type": "string", 312 | "description": "tag ids separated by a comma, 0 if you want to filter out time entries without a tag" 313 | }, 314 | "task_ids": { 315 | "location": "query", 316 | "type": "string", 317 | "description": "task ids separated by a comma, 0 if you want to filter out time entries without a task" 318 | }, 319 | "time_entry_ids": { 320 | "location": "query", 321 | "type": "string", 322 | "description": "time entry ids separated by a comma" 323 | }, 324 | "description": { 325 | "location": "query", 326 | "type": "string", 327 | "description": "string, time entry description" 328 | }, 329 | "order_field": { 330 | "location": "query", 331 | "type": "string", 332 | "description": "title/duration/amount in summary reports" 333 | }, 334 | "order_desc": { 335 | "location": "query", 336 | "type": "string", 337 | "description": "on/off, on for descending and off for ascending order" 338 | }, 339 | "distinct_rates": { 340 | "location": "query", 341 | "type": "string", 342 | "description": "on/off, default off" 343 | }, 344 | "rounding": { 345 | "location": "query", 346 | "type": "string", 347 | "description": "on/off, default off, rounds time according to workspace settings" 348 | }, 349 | "display_hours": { 350 | "location": "query", 351 | "type": "string", 352 | "default": "minutes", 353 | "description": "decimal/minutes, display hours with minutes or as a decimal number, default minutes" 354 | }, 355 | "grouping": { 356 | "location": "query", 357 | "type": "string", 358 | "default": "projects", 359 | "description": "users/projects/clients, default projects. If one grouping is selected, the other acts as subgrouping." 360 | }, 361 | "subgrouping": { 362 | "location": "query", 363 | "type": "string", 364 | "default": "time_entries", 365 | "description": "Following subgroupings are available in the summary report: projects (time_entries, tasks, users), clients (time_entries, tasks, projects, users), users (time_entries, tasks, projects, clients)" 366 | }, 367 | "subgrouping_ids": { 368 | "location": "query", 369 | "type": "boolean", 370 | "default": false, 371 | "description": "Whether returned items will contain 'ids' key containing comma separated group item ID values." 372 | }, 373 | "grouped_time_entry_ids": { 374 | "location": "query", 375 | "type": "boolean", 376 | "default": false, 377 | "description": "Whether returned items will contain 'time_entry_ids' key containing comma separated time entries ID values for given item." 378 | } 379 | } 380 | } 381 | }, 382 | "models": { 383 | "getResponse": { 384 | "type": "object", 385 | "additionalProperties": { 386 | "location": "json" 387 | } 388 | } 389 | } 390 | } 391 | -------------------------------------------------------------------------------- /src/AJT/Toggl/services_v9.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Toggl", 3 | "apiVersion": "v9", 4 | "description": "Toggl API v9", 5 | "baseUri": "https://api.track.toggl.com/api/v9/", 6 | "operations": { 7 | "CreateClient": { 8 | "httpMethod": "POST", 9 | "uri": "workspaces/{workspace_id}/clients", 10 | "summary": "Create Client", 11 | "responseModel": "getResponse", 12 | "parameters": { 13 | "workspace_id": { 14 | "location": "uri", 15 | "description": "Workspace ID", 16 | "required": true, 17 | "type": "integer" 18 | }, 19 | "client": { 20 | "location": "json", 21 | "type": "object", 22 | "description": "Client Object", 23 | "properties": { 24 | "name": { 25 | "type": "string", 26 | "required": true, 27 | "description": " The name of the client (string, required, unique in workspace)" 28 | }, 29 | "wid": { 30 | "type": "integer", 31 | "required": true, 32 | "description": "workspace ID, where the client will be used (integer, required)" 33 | }, 34 | "notes": { 35 | "type": "string", 36 | "required": false, 37 | "description": "Notes for the client (string, not required)" 38 | }, 39 | "hrate": { 40 | "type": "numeric", 41 | "required": false, 42 | "description": "The hourly rate for this client (float, not required, available only for pro workspaces)" 43 | }, 44 | "cur": { 45 | "type": "string", 46 | "required": false, 47 | "description": "The name of the client's currency (string, not required, available only for pro workspaces)" 48 | } 49 | } 50 | } 51 | } 52 | }, 53 | "GetClient": { 54 | "httpMethod": "GET", 55 | "uri": "workspaces/{workspace_id}/clients/{id}", 56 | "summary": "Get Client Details", 57 | "responseModel": "getResponse", 58 | "parameters": { 59 | "workspace_id": { 60 | "location": "uri", 61 | "type": "integer", 62 | "required": true, 63 | "description": "Workspace ID" 64 | }, 65 | "id": { 66 | "location": "uri", 67 | "type": "integer", 68 | "required": true, 69 | "description": "Client ID" 70 | } 71 | } 72 | }, 73 | "UpdateClient": { 74 | "httpMethod": "PUT", 75 | "uri": "workspaces/{workspace_id}/clients/{id}", 76 | "summary": "Update Client", 77 | "responseModel": "getResponse", 78 | "parameters": { 79 | "workspace_id": { 80 | "location": "uri", 81 | "type": "integer", 82 | "required": true, 83 | "description": "Workspace ID" 84 | }, 85 | "id": { 86 | "location": "uri", 87 | "type": "integer", 88 | "required": true, 89 | "description": "Client ID" 90 | }, 91 | "client": { 92 | "location": "json", 93 | "type": "object", 94 | "description": "Client Object", 95 | "properties": { 96 | "name": { 97 | "type": "string", 98 | "required": false, 99 | "description": "The name of the client (string, not required, unique in workspace)" 100 | }, 101 | "notes": { 102 | "type": "string", 103 | "required": false, 104 | "description": "Notes for the client (string, not required)" 105 | }, 106 | "hrate": { 107 | "type": "numeric", 108 | "required": false, 109 | "description": "The hourly rate for this client (float, not required, available only for pro workspaces)" 110 | }, 111 | "cur": { 112 | "type": "string", 113 | "required": false, 114 | "description": "The name of the client's currency (string, not required, available only for pro workspaces)" 115 | } 116 | } 117 | } 118 | } 119 | }, 120 | "DeleteClient": { 121 | "httpMethod": "DELETE", 122 | "uri": "workspaces/{workspace_id}/clients/{id}", 123 | "summary": "Delete Client", 124 | "responseModel": "getResponse", 125 | "parameters": { 126 | "workspace_id": { 127 | "location": "uri", 128 | "type": "integer", 129 | "required": true, 130 | "description": "Workspace ID" 131 | }, 132 | "id": { 133 | "location": "uri", 134 | "type": "integer", 135 | "required": true, 136 | "description": "Client ID" 137 | } 138 | } 139 | }, 140 | "ArchiveClient": { 141 | "httpMethod": "POST", 142 | "uri": "workspaces/{workspace_id}/clients/{id}/archive", 143 | "summary": "Archive Client", 144 | "responseModel": "getResponse", 145 | "parameters": { 146 | "workspace_id": { 147 | "location": "uri", 148 | "type": "integer", 149 | "required": true, 150 | "description": "Workspace ID" 151 | }, 152 | "id": { 153 | "location": "uri", 154 | "type": "integer", 155 | "required": true, 156 | "description": "Client ID" 157 | } 158 | } 159 | }, 160 | "RestoreClient": { 161 | "httpMethod": "DELETE", 162 | "uri": "workspaces/{workspace_id}/clients/{id}/restore", 163 | "summary": "Restore Archived Client", 164 | "responseModel": "getResponse", 165 | "parameters": { 166 | "workspace_id": { 167 | "location": "uri", 168 | "type": "integer", 169 | "required": true, 170 | "description": "Workspace ID" 171 | }, 172 | "id": { 173 | "location": "uri", 174 | "type": "integer", 175 | "required": true, 176 | "description": "Client ID" 177 | } 178 | } 179 | }, 180 | "GetClients": { 181 | "httpMethod": "GET", 182 | "uri": "me/clients", 183 | "summary": "Get clients visible to user", 184 | "responseModel": "getResponse" 185 | }, 186 | "GetClientProjects": { 187 | "httpMethod": "GET", 188 | "uri": "clients/{id}/projects", 189 | "summary": "Get client projects", 190 | "responseModel": "getResponse", 191 | "parameters": { 192 | "id": { 193 | "location": "uri", 194 | "description": "Client ID", 195 | "required": true, 196 | "type": "integer" 197 | }, 198 | "active": { 199 | "location": "query", 200 | "description": "Active (true, false, both)", 201 | "type": "string", 202 | "default": "true" 203 | } 204 | } 205 | }, 206 | "CreateProject": { 207 | "httpMethod": "POST", 208 | "uri": "workspaces/{workspace_id}/projects", 209 | "summary": "Create Project", 210 | "responseModel": "getResponse", 211 | "parameters": { 212 | "workspace_id": { 213 | "location": "uri", 214 | "description": "Workspace ID", 215 | "required": true, 216 | "type": "integer" 217 | }, 218 | "project": { 219 | "location": "json", 220 | "type": "object", 221 | "description": "Project Object", 222 | "properties": { 223 | "name": { 224 | "type": "string", 225 | "required": true, 226 | "description": "The name of the project (string, required, unique for client and workspace)" 227 | }, 228 | "wid": { 229 | "type": "integer", 230 | "required": true, 231 | "description": "workspace ID, where the project will be saved (integer, required)" 232 | }, 233 | "cid": { 234 | "type": "integer", 235 | "required": false, 236 | "description": "client ID (integer, not required)" 237 | }, 238 | "active": { 239 | "type": "boolean", 240 | "required": false, 241 | "default": true, 242 | "description": "whether the project is archived or not (boolean, by default true)" 243 | }, 244 | "is_private": { 245 | "type": "boolean", 246 | "required": false, 247 | "default": true, 248 | "description": "whether project is accessible for only project users or for all workspace users (boolean, default true)" 249 | }, 250 | "template": { 251 | "type": "boolean", 252 | "required": false, 253 | "default": false, 254 | "description": "whether the project can be used as a template (boolean, not required)" 255 | }, 256 | "template_id": { 257 | "type": "integer", 258 | "required": false, 259 | "description": "id of the template project used on current project's creation" 260 | }, 261 | "billable": { 262 | "type": "boolean", 263 | "required": false, 264 | "default": true, 265 | "description": "whether the project is billable or not (boolean, default true, available only for pro workspaces)" 266 | } 267 | } 268 | } 269 | } 270 | }, 271 | "GetProjects": { 272 | "httpMethod": "GET", 273 | "uri": "workspaces/{workspace_id}/projects", 274 | "summary": "Get projects", 275 | "responseModel": "getResponse", 276 | "parameters": { 277 | "workspace_id": { 278 | "location": "uri", 279 | "description": "Workspace ID", 280 | "required": true, 281 | "type": "integer" 282 | }, 283 | "active": { 284 | "location": "query", 285 | "description": "possible values true/false/both. By default true. If false, only archived projects are returned.", 286 | "type": "string", 287 | "default": "true" 288 | }, 289 | "page": { 290 | "location": "query", 291 | "description": "Page number to fetch.", 292 | "type": "integer", 293 | "default": 1 294 | } 295 | } 296 | }, 297 | "GetProject": { 298 | "httpMethod": "GET", 299 | "uri": "workspaces/{workspace_id}/projects/{id}", 300 | "summary": "Get Project details", 301 | "responseModel": "getResponse", 302 | "parameters": { 303 | "workspace_id": { 304 | "location": "uri", 305 | "description": "Workspace ID", 306 | "required": true, 307 | "type": "integer" 308 | }, 309 | "id": { 310 | "location": "uri", 311 | "type": "integer", 312 | "required": true, 313 | "description": "Project ID" 314 | } 315 | } 316 | }, 317 | "GetProjectTasks": { 318 | "httpMethod": "GET", 319 | "uri": "projects/{id}/tasks", 320 | "summary": "Get Project tasks", 321 | "responseModel": "getResponse", 322 | "parameters": { 323 | "id": { 324 | "location": "uri", 325 | "type": "integer", 326 | "required": true, 327 | "description": "Project ID" 328 | } 329 | } 330 | }, 331 | "UpdateProject": { 332 | "httpMethod": "PUT", 333 | "uri": "workspaces/{workspace_id}/projects/{id}", 334 | "summary": "Update Project", 335 | "responseModel": "getResponse", 336 | "parameters": { 337 | "workspace_id": { 338 | "location": "uri", 339 | "type": "integer", 340 | "required": true, 341 | "description": "Workspace ID" 342 | }, 343 | "id": { 344 | "location": "uri", 345 | "type": "integer", 346 | "required": true, 347 | "description": "Project ID" 348 | }, 349 | "project": { 350 | "location": "json", 351 | "type": "object", 352 | "description": "Project Object", 353 | "properties": { 354 | "name": { 355 | "type": "string", 356 | "required": false, 357 | "description": "The name of the project (string, not required, unique for client and workspace)" 358 | }, 359 | "wid": { 360 | "type": "integer", 361 | "required": false, 362 | "description": "workspace ID, where the project will be saved (integer, not required)" 363 | }, 364 | "cid": { 365 | "type": "integer", 366 | "required": false, 367 | "description": "client ID (integer, not required)" 368 | }, 369 | "active": { 370 | "type": "boolean", 371 | "required": false, 372 | "default": true, 373 | "description": "whether the project is archived or not (boolean, by default true)" 374 | }, 375 | "is_private": { 376 | "type": "boolean", 377 | "required": false, 378 | "default": true, 379 | "description": "whether project is accessible for only project users or for all workspace users (boolean, default true)" 380 | }, 381 | "template": { 382 | "type": "boolean", 383 | "required": false, 384 | "default": false, 385 | "description": "whether the project can be used as a template (boolean, not required)" 386 | }, 387 | "template_id": { 388 | "type": "integer", 389 | "required": false, 390 | "description": "id of the template project used on current project's creation" 391 | }, 392 | "billable": { 393 | "type": "boolean", 394 | "required": false, 395 | "default": true, 396 | "description": "whether the project is billable or not (boolean, default true, available only for pro workspaces)" 397 | } 398 | } 399 | } 400 | } 401 | }, 402 | "DeleteProject": { 403 | "httpMethod": "DELETE", 404 | "uri": "workspaces/{workspace_id}/projects/{id}", 405 | "summary": "Delete Project", 406 | "responseModel": "getResponse", 407 | "parameters": { 408 | "workspace_id": { 409 | "location": "uri", 410 | "type": "integer", 411 | "required": true, 412 | "description": "Workspace ID" 413 | }, 414 | "id": { 415 | "location": "uri", 416 | "type": "integer", 417 | "required": true, 418 | "description": "Project ID" 419 | } 420 | } 421 | }, 422 | "DeleteProjects": { 423 | "httpMethod": "DELETE", 424 | "uri": "projects/{ids}", 425 | "summary": "Delete multiple Project", 426 | "responseModel": "getResponse", 427 | "parameters": { 428 | "ids": { 429 | "location": "uri", 430 | "type": "string", 431 | "required": true, 432 | "description": "Comma separated list of Project IDs" 433 | } 434 | } 435 | }, 436 | "GetProjectUsers": { 437 | "httpMethod": "GET", 438 | "uri": "workspaces/{workspace_id}/project_users", 439 | "summary": "Get project users", 440 | "responseModel": "getResponse", 441 | "parameters": { 442 | "workspace_id": { 443 | "location": "uri", 444 | "description": "Workspace ID", 445 | "required": true, 446 | "type": "integer" 447 | } 448 | } 449 | }, 450 | "CreateProjectUser": { 451 | "httpMethod": "POST", 452 | "uri": "workspaces/{workspace_id}/project_users", 453 | "summary": "Create Project User", 454 | "responseModel": "getResponse", 455 | "parameters": { 456 | "workspace_id": { 457 | "location": "uri", 458 | "description": "Workspace ID", 459 | "required": true, 460 | "type": "integer" 461 | }, 462 | "project_user": { 463 | "location": "json", 464 | "type": "object", 465 | "description": "Project User Object", 466 | "properties": { 467 | "pid": { 468 | "type": "integer", 469 | "required": true, 470 | "description": "project ID (integer, required)" 471 | }, 472 | "uid": { 473 | "type": "integer", 474 | "required": true, 475 | "description": "user ID, who is added to the project (integer, required)" 476 | }, 477 | "wid": { 478 | "type": "integer", 479 | "required": false, 480 | "description": "workspace ID, where the project belongs to (integer, not-required, project's workspace id is used)" 481 | }, 482 | "manager": { 483 | "type": "boolean", 484 | "required": false, 485 | "default": false, 486 | "description": "admin rights for this project (boolean, default false)" 487 | }, 488 | "rate": { 489 | "type": "numeric", 490 | "required": false, 491 | "description": "hourly rate for the project user (float, not-required, only for pro workspaces) in the currency of the project's client or in workspace default currency." 492 | }, 493 | "fullname": { 494 | "type": "string", 495 | "required": false, 496 | "description": "fullname: full name of the user, who is added to the project" 497 | } 498 | } 499 | } 500 | } 501 | }, 502 | "UpdateProjectUser": { 503 | "httpMethod": "PUT", 504 | "uri": "workspaces/{workspace_id}/project_users/{id}", 505 | "summary": "Update Project User", 506 | "responseModel": "getResponse", 507 | "parameters": { 508 | "workspace_id": { 509 | "location": "uri", 510 | "description": "Workspace ID", 511 | "required": true, 512 | "type": "integer" 513 | }, 514 | "id": { 515 | "location": "uri", 516 | "type": "integer", 517 | "required": true, 518 | "description": "Project ID" 519 | }, 520 | "project_user": { 521 | "location": "json", 522 | "type": "object", 523 | "description": "Project User Object", 524 | "properties": { 525 | "manager": { 526 | "type": "boolean", 527 | "required": false, 528 | "default": false, 529 | "description": "admin rights for this project (boolean, default false)" 530 | }, 531 | "rate": { 532 | "type": "numeric", 533 | "required": false, 534 | "description": "hourly rate for the project user (float, not-required, only for pro workspaces) in the currency of the project's client or in workspace default currency." 535 | }, 536 | "fullname": { 537 | "type": "string", 538 | "required": false, 539 | "description": "fullname: full name of the user, who is added to the project" 540 | } 541 | } 542 | } 543 | } 544 | }, 545 | "DeleteProjectUser": { 546 | "httpMethod": "DELETE", 547 | "uri": "workspaces/{workspace_id}/project_users/{id}", 548 | "summary": "Delete Project User", 549 | "responseModel": "getResponse", 550 | "parameters": { 551 | "workspace_id": { 552 | "location": "uri", 553 | "description": "Workspace ID", 554 | "required": true, 555 | "type": "integer" 556 | }, 557 | "id": { 558 | "location": "uri", 559 | "type": "integer", 560 | "required": true, 561 | "description": "Project ID" 562 | } 563 | } 564 | }, 565 | "CreateProjectUsers": { 566 | "httpMethod": "POST", 567 | "uri": "workspaces/{workspace_id}/project_users", 568 | "summary": "Create multiple Project Users", 569 | "responseModel": "getResponse", 570 | "parameters": { 571 | "workspace_id": { 572 | "location": "uri", 573 | "description": "Workspace ID", 574 | "required": true, 575 | "type": "integer" 576 | }, 577 | "project_user": { 578 | "location": "json", 579 | "type": "array", 580 | "items": { 581 | "type": "object", 582 | "description": "Project User Object", 583 | "properties": { 584 | "pid": { 585 | "type": "integer", 586 | "required": true, 587 | "description": "project ID (integer, required)" 588 | }, 589 | "uid": { 590 | "type": "integer", 591 | "required": true, 592 | "description": "user ID, who is added to the project (integer, required)" 593 | }, 594 | "wid": { 595 | "type": "integer", 596 | "required": false, 597 | "description": "workspace ID, where the project belongs to (integer, not-required, project's workspace id is used)" 598 | }, 599 | "manager": { 600 | "type": "boolean", 601 | "required": false, 602 | "default": false, 603 | "description": "admin rights for this project (boolean, default false)" 604 | }, 605 | "rate": { 606 | "type": "numeric", 607 | "required": false, 608 | "description": "hourly rate for the project user (float, not-required, only for pro workspaces) in the currency of the project's client or in workspace default currency." 609 | }, 610 | "fullname": { 611 | "type": "string", 612 | "required": false, 613 | "description": "fullname: full name of the user, who is added to the project" 614 | } 615 | } 616 | } 617 | } 618 | } 619 | }, 620 | "UpdateProjectUsers": { 621 | "httpMethod": "PUT", 622 | "uri": "workspaces/{workspace_id}/project_users/{ids}", 623 | "summary": "Update multiple Project User", 624 | "responseModel": "getResponse", 625 | "parameters": { 626 | "workspace_id": { 627 | "location": "uri", 628 | "description": "Workspace ID", 629 | "required": true, 630 | "type": "integer" 631 | }, 632 | "ids": { 633 | "location": "uri", 634 | "type": "string", 635 | "required": true, 636 | "description": "Comma separated list of Project User IDs" 637 | }, 638 | "project_user": { 639 | "location": "json", 640 | "type": "array", 641 | "items": { 642 | "type": "object", 643 | "description": "Project User Object", 644 | "properties": { 645 | "manager": { 646 | "type": "boolean", 647 | "required": false, 648 | "default": false, 649 | "description": "admin rights for this project (boolean, default false)" 650 | }, 651 | "rate": { 652 | "type": "numeric", 653 | "required": false, 654 | "description": "hourly rate for the project user (float, not-required, only for pro workspaces) in the currency of the project's client or in workspace default currency." 655 | }, 656 | "fullname": { 657 | "type": "string", 658 | "required": false, 659 | "description": "fullname: full name of the user, who is added to the project" 660 | } 661 | } 662 | } 663 | } 664 | } 665 | }, 666 | "DeleteProjectUsers": { 667 | "httpMethod": "DELETE", 668 | "uri": "workspaces/{workspace_id}/project_users/{ids}", 669 | "summary": "Delete multiple Project Users", 670 | "responseModel": "getResponse", 671 | "parameters": { 672 | "workspace_id": { 673 | "location": "uri", 674 | "description": "Workspace ID", 675 | "required": true, 676 | "type": "integer" 677 | }, 678 | "ids": { 679 | "location": "uri", 680 | "type": "string", 681 | "required": true, 682 | "description": "Comma separated list of Project User IDs" 683 | } 684 | } 685 | }, 686 | "CreateTag": { 687 | "httpMethod": "POST", 688 | "uri": "workspaces/{workspace_id}/tags", 689 | "summary": "Create Tag", 690 | "responseModel": "getResponse", 691 | "parameters": { 692 | "workspace_id": { 693 | "location": "uri", 694 | "description": "Workspace ID", 695 | "required": true, 696 | "type": "integer" 697 | }, 698 | "tag": { 699 | "location": "json", 700 | "type": "object", 701 | "description": "Tag Object", 702 | "properties": { 703 | "name": { 704 | "type": "string", 705 | "required": true, 706 | "description": "The name of the tag (string, required, unique in workspace)" 707 | }, 708 | "wid": { 709 | "type": "integer", 710 | "required": true, 711 | "description": "workspace ID, where the tag will be used (integer, required)" 712 | } 713 | } 714 | } 715 | } 716 | }, 717 | "UpdateTag": { 718 | "httpMethod": "PUT", 719 | "uri": "workspaces/{workspace_id}/tags/{id}", 720 | "summary": "Update Tag", 721 | "responseModel": "getResponse", 722 | "parameters": { 723 | "workspace_id": { 724 | "location": "uri", 725 | "description": "Workspace ID", 726 | "required": true, 727 | "type": "integer" 728 | }, 729 | "id": { 730 | "location": "uri", 731 | "type": "integer", 732 | "required": true, 733 | "description": "Tag ID" 734 | }, 735 | "tag": { 736 | "location": "json", 737 | "type": "object", 738 | "description": "Tag Object", 739 | "properties": { 740 | "name": { 741 | "type": "string", 742 | "required": true, 743 | "description": "The name of the tag (string, required, unique in workspace)" 744 | } 745 | } 746 | } 747 | } 748 | }, 749 | "DeleteTag": { 750 | "httpMethod": "DELETE", 751 | "uri": "workspaces/{workspace_id}/tags/{id}", 752 | "summary": "Delete Tag", 753 | "responseModel": "getResponse", 754 | "parameters": { 755 | "workspace_id": { 756 | "location": "uri", 757 | "description": "Workspace ID", 758 | "required": true, 759 | "type": "integer" 760 | }, 761 | "id": { 762 | "location": "uri", 763 | "type": "integer", 764 | "required": true, 765 | "description": "Tag ID" 766 | } 767 | } 768 | }, 769 | "CreateTask": { 770 | "httpMethod": "POST", 771 | "uri": "workspaces/{workspace_id}/projects/{project_id}/tasks", 772 | "summary": "Create Task", 773 | "responseModel": "getResponse", 774 | "parameters": { 775 | "workspace_id": { 776 | "location": "uri", 777 | "description": "Workspace ID", 778 | "required": true, 779 | "type": "integer" 780 | }, 781 | "project_id": { 782 | "location": "uri", 783 | "description": "Project ID", 784 | "required": true, 785 | "type": "integer" 786 | }, 787 | "task": { 788 | "location": "json", 789 | "type": "object", 790 | "description": "Task Object", 791 | "properties": { 792 | "name": { 793 | "type": "string", 794 | "required": true, 795 | "description": "The name of the task (string, required, unique in project)" 796 | }, 797 | "pid": { 798 | "type": "integer", 799 | "required": true, 800 | "description": "project ID for the task (integer, required)" 801 | }, 802 | "wid": { 803 | "type": "integer", 804 | "required": false, 805 | "description": "workspace ID, where the task will be saved (integer, project's workspace id is used when not supplied)" 806 | }, 807 | "uid": { 808 | "type": "integer", 809 | "required": false, 810 | "description": "user ID, to whom the task is assigned to (integer, not required)" 811 | }, 812 | "estimated_seconds": { 813 | "type": "integer", 814 | "required": false, 815 | "description": "estimated duration of task in seconds (integer, not required)" 816 | }, 817 | "active": { 818 | "type": "boolean", 819 | "required": false, 820 | "default": true, 821 | "description": "whether the task is done or not (boolean, by default true)" 822 | } 823 | } 824 | } 825 | } 826 | }, 827 | "GetTask": { 828 | "httpMethod": "GET", 829 | "uri": "workspaces/{workspace_id}/projects/{project_id}/tasks/{id}", 830 | "summary": "Get Task", 831 | "responseModel": "getResponse", 832 | "parameters": { 833 | "workspace_id": { 834 | "location": "uri", 835 | "description": "Workspace ID", 836 | "required": true, 837 | "type": "integer" 838 | }, 839 | "project_id": { 840 | "location": "uri", 841 | "description": "Project ID", 842 | "required": true, 843 | "type": "integer" 844 | }, 845 | "id": { 846 | "location": "uri", 847 | "type": "integer", 848 | "required": true, 849 | "description": "Task ID" 850 | } 851 | } 852 | }, 853 | "UpdateTask": { 854 | "httpMethod": "PUT", 855 | "uri": "workspaces/{workspace_id}/projects/{project_id}/tasks/{id}", 856 | "summary": "Update Task", 857 | "responseModel": "getResponse", 858 | "parameters": { 859 | "workspace_id": { 860 | "location": "uri", 861 | "description": "Workspace ID", 862 | "required": true, 863 | "type": "integer" 864 | }, 865 | "project_id": { 866 | "location": "uri", 867 | "description": "Project ID", 868 | "required": true, 869 | "type": "integer" 870 | }, 871 | "id": { 872 | "location": "uri", 873 | "type": "integer", 874 | "required": true, 875 | "description": "Task ID" 876 | }, 877 | "task": { 878 | "location": "json", 879 | "type": "object", 880 | "description": "Task Object", 881 | "properties": { 882 | "name": { 883 | "type": "string", 884 | "required": false, 885 | "description": "The name of the task (string, not required, unique in project)" 886 | }, 887 | "uid": { 888 | "type": "integer", 889 | "required": false, 890 | "description": "user ID, to whom the task is assigned to (integer, not required)" 891 | }, 892 | "estimated_seconds": { 893 | "type": "integer", 894 | "required": false, 895 | "description": "estimated duration of task in seconds (integer, not required)" 896 | }, 897 | "active": { 898 | "type": "boolean", 899 | "required": false, 900 | "default": true, 901 | "description": "whether the task is done or not (boolean, by default true)" 902 | } 903 | } 904 | } 905 | } 906 | }, 907 | "DeleteTask": { 908 | "httpMethod": "DELETE", 909 | "uri": "workspaces/{workspace_id}/projects/{project_id}/tasks/{id}", 910 | "summary": "Delete Task", 911 | "responseModel": "getResponse", 912 | "parameters": { 913 | "workspace_id": { 914 | "location": "uri", 915 | "description": "Workspace ID", 916 | "required": true, 917 | "type": "integer" 918 | }, 919 | "project_id": { 920 | "location": "uri", 921 | "description": "Project ID", 922 | "required": true, 923 | "type": "integer" 924 | }, 925 | "id": { 926 | "location": "uri", 927 | "type": "integer", 928 | "required": true, 929 | "description": "Task ID" 930 | } 931 | } 932 | }, 933 | "UpdateTasks": { 934 | "httpMethod": "PUT", 935 | "uri": "workspaces/{workspace_id}/projects/{project_id}/tasks/{ids}", 936 | "summary": "Update Tasks", 937 | "responseModel": "getResponse", 938 | "parameters": { 939 | "workspace_id": { 940 | "location": "uri", 941 | "description": "Workspace ID", 942 | "required": true, 943 | "type": "integer" 944 | }, 945 | "project_id": { 946 | "location": "uri", 947 | "description": "Project ID", 948 | "required": true, 949 | "type": "integer" 950 | }, 951 | "ids": { 952 | "location": "uri", 953 | "type": "string", 954 | "required": true, 955 | "description": "Comma-separated list of Task IDs" 956 | }, 957 | "task": { 958 | "location": "json", 959 | "type": "array", 960 | "items": { 961 | "type": "object", 962 | "description": "Task Object", 963 | "properties": { 964 | "name": { 965 | "type": "string", 966 | "required": false, 967 | "description": "The name of the task (string, not required, unique in project)" 968 | }, 969 | "uid": { 970 | "type": "integer", 971 | "required": false, 972 | "description": "user ID, to whom the task is assigned to (integer, not required)" 973 | }, 974 | "estimated_seconds": { 975 | "type": "integer", 976 | "required": false, 977 | "description": "estimated duration of task in seconds (integer, not required)" 978 | }, 979 | "active": { 980 | "type": "boolean", 981 | "required": false, 982 | "default": true, 983 | "description": "whether the task is done or not (boolean, by default true)" 984 | } 985 | } 986 | } 987 | } 988 | } 989 | }, 990 | "DeleteTasks": { 991 | "httpMethod": "DELETE", 992 | "uri": "workspaces/{workspace_id}/projects/{project_id}/tasks/{ids}", 993 | "summary": "Delete Tasks", 994 | "responseModel": "getResponse", 995 | "parameters": { 996 | "workspace_id": { 997 | "location": "uri", 998 | "description": "Workspace ID", 999 | "required": true, 1000 | "type": "integer" 1001 | }, 1002 | "project_id": { 1003 | "location": "uri", 1004 | "description": "Project ID", 1005 | "required": true, 1006 | "type": "integer" 1007 | }, 1008 | "ids": { 1009 | "location": "uri", 1010 | "type": "string", 1011 | "required": true, 1012 | "description": "Comma-separated list of Task IDs" 1013 | } 1014 | } 1015 | }, 1016 | "CreateTimeEntry": { 1017 | "httpMethod": "POST", 1018 | "uri": "time_entries", 1019 | "summary": "Create Time Entry", 1020 | "responseModel": "getResponse", 1021 | "parameters": { 1022 | "time_entry": { 1023 | "location": "json", 1024 | "type": "object", 1025 | "description": "Time Entry Object", 1026 | "properties": { 1027 | "description": { 1028 | "type": "string", 1029 | "required": false, 1030 | "description": "(string, not required)" 1031 | }, 1032 | "wid": { 1033 | "type": "integer", 1034 | "required": false, 1035 | "description": "workspace ID (integer, required if pid or tid not supplied)" 1036 | }, 1037 | "pid": { 1038 | "type": "integer", 1039 | "required": false, 1040 | "description": "pid: project ID (integer, not required)" 1041 | }, 1042 | "tid": { 1043 | "type": "integer", 1044 | "required": false, 1045 | "description": "tid: task ID (integer, not required)" 1046 | }, 1047 | "billable": { 1048 | "type": "boolean", 1049 | "required": false, 1050 | "default": false, 1051 | "description": "(boolean, not required, default false, available for pro workspaces)" 1052 | }, 1053 | "created_with": { 1054 | "type": "string", 1055 | "required": true, 1056 | "description": "the name of your client app (string, required)" 1057 | }, 1058 | "tags": { 1059 | "type": "array", 1060 | "required": false, 1061 | "items": { 1062 | "type": "string" 1063 | }, 1064 | "description": "a list of tag names (array of strings, not required)" 1065 | }, 1066 | "duration": { 1067 | "type": "integer", 1068 | "required": true, 1069 | "description": "duration of time entry (integer, required)" 1070 | }, 1071 | "duronly": { 1072 | "type": "boolean", 1073 | "required": false, 1074 | "description": "should Toggl show the start and stop time of this time entry? (boolean, not required)" 1075 | }, 1076 | "start": { 1077 | "type": "string", 1078 | "required": true, 1079 | "description": "start of time entry (string, required, ISO 8601 date and time)" 1080 | } 1081 | } 1082 | } 1083 | } 1084 | }, 1085 | "StartTimeEntry": { 1086 | "httpMethod": "POST", 1087 | "uri": "/workspaces/{workspace_id}/time_entries", 1088 | "summary": "Start Time Entry", 1089 | "responseModel": "getResponse", 1090 | "parameters": { 1091 | "workspace_id": { 1092 | "location": "uri", 1093 | "description": "Workspace ID", 1094 | "required": true, 1095 | "type": "integer" 1096 | }, 1097 | "time_entry": { 1098 | "location": "json", 1099 | "type": "object", 1100 | "description": "Time Entry Object", 1101 | "properties": { 1102 | "duration": { 1103 | "type": "integer", 1104 | "static": true, 1105 | "description": "Negative value required to start time entry", 1106 | "default": -1 1107 | }, 1108 | "description": { 1109 | "type": "string", 1110 | "required": false, 1111 | "description": "(string, not required)" 1112 | }, 1113 | "wid": { 1114 | "type": "integer", 1115 | "required": false, 1116 | "description": "workspace ID (integer, required if pid or tid not supplied)" 1117 | }, 1118 | "pid": { 1119 | "type": "integer", 1120 | "required": false, 1121 | "description": "pid: project ID (integer, not required)" 1122 | }, 1123 | "tid": { 1124 | "type": "integer", 1125 | "required": false, 1126 | "description": "tid: task ID (integer, not required)" 1127 | }, 1128 | "billable": { 1129 | "type": "boolean", 1130 | "required": false, 1131 | "default": false, 1132 | "description": "(boolean, not required, default false, available for pro workspaces)" 1133 | }, 1134 | "created_with": { 1135 | "type": "string", 1136 | "required": true, 1137 | "description": "the name of your client app (string, required)" 1138 | }, 1139 | "tags": { 1140 | "type": "array", 1141 | "required": false, 1142 | "items": { 1143 | "type": "string" 1144 | }, 1145 | "description": "a list of tag names (array of strings, not required)" 1146 | }, 1147 | "duronly": { 1148 | "type": "boolean", 1149 | "required": false, 1150 | "description": "should Toggl show the start and stop time of this time entry? (boolean, not required)" 1151 | } 1152 | } 1153 | } 1154 | } 1155 | }, 1156 | "StopTimeEntry": { 1157 | "httpMethod": "PATCH", 1158 | "uri": "workspaces/{workspace_id}/time_entries/{id}/stop", 1159 | "summary": "Stop Time Entry", 1160 | "responseModel": "getResponse", 1161 | "parameters": { 1162 | "workspace_id": { 1163 | "location": "uri", 1164 | "description": "Workspace ID", 1165 | "required": true, 1166 | "type": "integer" 1167 | }, 1168 | "id": { 1169 | "location": "uri", 1170 | "type": "integer", 1171 | "required": true, 1172 | "description": "Time Entry ID" 1173 | } 1174 | } 1175 | }, 1176 | "GetTimeEntry": { 1177 | "httpMethod": "GET", 1178 | "uri": "me/time_entries/{id}", 1179 | "summary": "Get Time Entry", 1180 | "responseModel": "getResponse", 1181 | "parameters": { 1182 | "id": { 1183 | "location": "uri", 1184 | "type": "integer", 1185 | "required": true, 1186 | "description": "Time Entry ID" 1187 | } 1188 | } 1189 | }, 1190 | "GetCurrentTimeEntry": { 1191 | "httpMethod": "GET", 1192 | "uri": "me/time_entries/current", 1193 | "summary": "Get Current Time Entry" 1194 | }, 1195 | "UpdateTimeEntry": { 1196 | "httpMethod": "PUT", 1197 | "uri": "workspaces/{workspace_id}/time_entries/{id}", 1198 | "summary": "Update Time Entry", 1199 | "responseModel": "getResponse", 1200 | "parameters": { 1201 | "workspace_id": { 1202 | "location": "uri", 1203 | "description": "Workspace ID", 1204 | "required": true, 1205 | "type": "integer" 1206 | }, 1207 | "id": { 1208 | "location": "uri", 1209 | "type": "integer", 1210 | "required": true, 1211 | "description": "Time Entry ID" 1212 | }, 1213 | "time_entry": { 1214 | "location": "json", 1215 | "type": "object", 1216 | "description": "Time Entry Object", 1217 | "properties": { 1218 | "description": { 1219 | "type": "string", 1220 | "required": false, 1221 | "description": "(string, not required)" 1222 | }, 1223 | "wid": { 1224 | "type": "integer", 1225 | "required": false, 1226 | "description": "workspace ID (integer, required if pid or tid not supplied)" 1227 | }, 1228 | "pid": { 1229 | "type": "integer", 1230 | "required": false, 1231 | "description": "pid: project ID (integer, not required)" 1232 | }, 1233 | "tid": { 1234 | "type": "integer", 1235 | "required": false, 1236 | "description": "tid: task ID (integer, not required)" 1237 | }, 1238 | "billable": { 1239 | "type": "boolean", 1240 | "required": false, 1241 | "default": false, 1242 | "description": "(boolean, not required, default false, available for pro workspaces)" 1243 | }, 1244 | "created_with": { 1245 | "type": "string", 1246 | "required": false, 1247 | "description": "the name of your client app (string, not required)" 1248 | }, 1249 | "tags": { 1250 | "type": "array", 1251 | "required": false, 1252 | "items": { 1253 | "type": "string" 1254 | }, 1255 | "description": "a list of tag names (array of strings, not required)" 1256 | }, 1257 | "duration": { 1258 | "type": "integer", 1259 | "required": false, 1260 | "description": "duration of time entry (integer, not required)" 1261 | }, 1262 | "duronly": { 1263 | "type": "boolean", 1264 | "required": false, 1265 | "description": "should Toggl show the start and stop time of this time entry? (boolean, not required)" 1266 | }, 1267 | "start": { 1268 | "type": "string", 1269 | "required": false, 1270 | "description": "start of time entry (string, not required, ISO 8601 date and time)" 1271 | } 1272 | } 1273 | } 1274 | } 1275 | }, 1276 | "DeleteTimeEntry": { 1277 | "httpMethod": "DELETE", 1278 | "uri": "workspaces/{workspace_id}/time_entries/{id}", 1279 | "summary": "Delete Time Entry", 1280 | "responseModel": "getResponse", 1281 | "parameters": { 1282 | "workspace_id": { 1283 | "location": "uri", 1284 | "description": "Workspace ID", 1285 | "required": true, 1286 | "type": "integer" 1287 | }, 1288 | "id": { 1289 | "location": "uri", 1290 | "type": "integer", 1291 | "required": true, 1292 | "description": "Time Entry ID" 1293 | } 1294 | } 1295 | }, 1296 | "GetTimeEntries": { 1297 | "httpMethod": "GET", 1298 | "uri": "me/time_entries", 1299 | "summary": "Get time entries started in a specific time range.If start_date and end_date are not specified, time entries started during the last 9 days are returned.", 1300 | "responseModel": "getResponse", 1301 | "parameters": { 1302 | "start_date": { 1303 | "location": "query", 1304 | "description": "Start date (must be ISO 8601 date and time string)", 1305 | "type": "string" 1306 | }, 1307 | "end_date": { 1308 | "location": "query", 1309 | "description": "End date (must be ISO 8601 date and time string)", 1310 | "type": "string" 1311 | } 1312 | } 1313 | }, 1314 | "GetCurrentUser": { 1315 | "httpMethod": "GET", 1316 | "uri": "me", 1317 | "summary": "Get Get current user data", 1318 | "responseModel": "getResponse" 1319 | }, 1320 | "CreateUser": { 1321 | "httpMethod": "POST", 1322 | "uri": "signup", 1323 | "summary": "Sign up new user", 1324 | "responseModel": "getResponse", 1325 | "parameters": { 1326 | "user": { 1327 | "location": "json", 1328 | "type": "object", 1329 | "description": "User Object", 1330 | "properties": { 1331 | "email": { 1332 | "type": "string", 1333 | "required": true, 1334 | "description": "a valid email for the user whose account is created (string, required)" 1335 | }, 1336 | "password": { 1337 | "type": "string", 1338 | "required": true, 1339 | "description": "password at least 6 characters long (string, required)" 1340 | }, 1341 | "timezone": { 1342 | "type": "string", 1343 | "required": true, 1344 | "description": "for example 'Etc/UTC' (string, required)" 1345 | }, 1346 | "created_with": { 1347 | "type": "string", 1348 | "required": true, 1349 | "description": "in free form, name of the app that signed the user app (string, required)" 1350 | } 1351 | } 1352 | } 1353 | } 1354 | }, 1355 | "GetGroups": { 1356 | "httpMethod": "GET", 1357 | "uri": "workspaces/{workspace_id}/groups", 1358 | "summary": "Get groups", 1359 | "responseModel": "getResponse", 1360 | "parameters": { 1361 | "workspace_id": { 1362 | "location": "uri", 1363 | "description": "Workspace ID", 1364 | "required": true, 1365 | "type": "integer" 1366 | } 1367 | } 1368 | }, 1369 | "GetWorkspaces": { 1370 | "httpMethod": "GET", 1371 | "uri": "workspaces", 1372 | "summary": "Get workspaces", 1373 | "responseModel": "getResponse" 1374 | }, 1375 | "GetWorkspaceUsers": { 1376 | "httpMethod": "GET", 1377 | "uri": "workspaces/{id}/users", 1378 | "summary": "Get workspace users", 1379 | "responseModel": "getResponse", 1380 | "parameters": { 1381 | "id": { 1382 | "location": "uri", 1383 | "description": "Workspace ID", 1384 | "required": true, 1385 | "type": "integer" 1386 | } 1387 | } 1388 | }, 1389 | "GetWorkspaceClients": { 1390 | "httpMethod": "GET", 1391 | "uri": "workspaces/{id}/clients", 1392 | "summary": "Get workspace clients", 1393 | "responseModel": "getResponse", 1394 | "parameters": { 1395 | "id": { 1396 | "location": "uri", 1397 | "description": "Workspace ID", 1398 | "required": true, 1399 | "type": "integer" 1400 | } 1401 | } 1402 | }, 1403 | "GetWorkspaceTags": { 1404 | "httpMethod": "GET", 1405 | "uri": "workspaces/{id}/tags", 1406 | "summary": "Get workspace tags", 1407 | "responseModel": "getResponse", 1408 | "parameters": { 1409 | "id": { 1410 | "location": "uri", 1411 | "description": "Workspace ID", 1412 | "required": true, 1413 | "type": "integer" 1414 | } 1415 | } 1416 | }, 1417 | "GetWorkspaceTasks": { 1418 | "httpMethod": "GET", 1419 | "uri": "workspaces/{id}/tasks", 1420 | "summary": "Get workspace tasks", 1421 | "responseModel": "getResponse", 1422 | "parameters": { 1423 | "id": { 1424 | "location": "uri", 1425 | "description": "Workspace ID", 1426 | "required": true, 1427 | "type": "integer" 1428 | }, 1429 | "active": { 1430 | "location": "query", 1431 | "description": "possible values true/false/both. By default true. If false, only done tasks are returned.", 1432 | "type": "string", 1433 | "default": "true" 1434 | } 1435 | } 1436 | }, 1437 | "InviteOrganizationUser": { 1438 | "httpMethod": "POST", 1439 | "uri": "organizations/{organization_id}/invitations", 1440 | "summary": "Invite User to Organization", 1441 | "responseModel": "getResponse", 1442 | "parameters": { 1443 | "organization_id": { 1444 | "location": "uri", 1445 | "type": "integer", 1446 | "required": true, 1447 | "description": "Organization ID" 1448 | }, 1449 | "emails": { 1450 | "location": "json", 1451 | "type": "array", 1452 | "required": true, 1453 | "description": "List of valid emails (array, required)", 1454 | "items": { 1455 | "type": "string", 1456 | "required": true, 1457 | "description": "The valid email of user who must be invite to this workspace (string, required)" 1458 | } 1459 | } 1460 | } 1461 | }, 1462 | "GetWorkspaceProjectUsers": { 1463 | "httpMethod": "GET", 1464 | "uri": "workspaces/{id}/project_users", 1465 | "summary": "Get workspace project users", 1466 | "responseModel": "getResponse", 1467 | "parameters": { 1468 | "id": { 1469 | "location": "uri", 1470 | "description": "Workspace ID", 1471 | "required": true, 1472 | "type": "integer" 1473 | } 1474 | } 1475 | }, 1476 | "UpdateWorkspaceUser": { 1477 | "httpMethod": "PUT", 1478 | "uri": "workspace_users/{id}", 1479 | "summary": "Update Task", 1480 | "responseModel": "getResponse", 1481 | "parameters": { 1482 | "id": { 1483 | "location": "uri", 1484 | "type": "integer", 1485 | "required": true, 1486 | "description": "Workspace User ID" 1487 | }, 1488 | "workspace_user": { 1489 | "location": "json", 1490 | "type": "object", 1491 | "description": "Workspace User Object", 1492 | "properties": { 1493 | "admin": { 1494 | "type": "boolean", 1495 | "required": true, 1496 | "description": "if user is workspace admin (boolean)" 1497 | } 1498 | } 1499 | } 1500 | } 1501 | }, 1502 | "DeleteWorkspaceUser": { 1503 | "httpMethod": "DELETE", 1504 | "uri": "workspace_users/{id}", 1505 | "summary": "Delete Workspace User", 1506 | "responseModel": "getResponse", 1507 | "parameters": { 1508 | "id": { 1509 | "location": "uri", 1510 | "type": "integer", 1511 | "required": true, 1512 | "description": "Workspace User ID" 1513 | } 1514 | } 1515 | } 1516 | }, 1517 | "models": { 1518 | "getResponse": { 1519 | "type": "object", 1520 | "additionalProperties": { 1521 | "location": "json" 1522 | } 1523 | } 1524 | } 1525 | } 1526 | -------------------------------------------------------------------------------- /src/AJT/Toggl/tests/Toggl/Tests/TogglClientTest.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arendjantetteroo/guzzle-toggl/2fe192e8d7e7d40c387fac3dc99e60d7768091a5/src/AJT/Toggl/tests/Toggl/Tests/TogglClientTest.php -------------------------------------------------------------------------------- /src/AJT/Toggl/tests/bootstrap.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arendjantetteroo/guzzle-toggl/2fe192e8d7e7d40c387fac3dc99e60d7768091a5/src/AJT/Toggl/tests/bootstrap.php --------------------------------------------------------------------------------