{"id":23490330,"url":"https://github.com/justijndepover/teamleader-api","last_synced_at":"2025-10-24T11:58:20.836Z","repository":{"id":49859404,"uuid":"353289167","full_name":"justijndepover/teamleader-api","owner":"justijndepover","description":"PHP Client for the Teamleader API","archived":false,"fork":false,"pushed_at":"2024-04-11T08:05:48.000Z","size":89,"stargazers_count":7,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-02T16:49:10.723Z","etag":null,"topics":["api","oauth2","php","teamleader"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/justijndepover.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-03-31T08:51:35.000Z","updated_at":"2024-04-25T19:51:15.000Z","dependencies_parsed_at":"2024-12-25T00:36:00.176Z","dependency_job_id":null,"html_url":"https://github.com/justijndepover/teamleader-api","commit_stats":{"total_commits":21,"total_committers":2,"mean_commits":10.5,"dds":0.04761904761904767,"last_synced_commit":"1dc4158db831fe12a0fcec1fa214f31cfaa9ea11"},"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/justijndepover/teamleader-api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/justijndepover%2Fteamleader-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/justijndepover%2Fteamleader-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/justijndepover%2Fteamleader-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/justijndepover%2Fteamleader-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/justijndepover","download_url":"https://codeload.github.com/justijndepover/teamleader-api/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/justijndepover%2Fteamleader-api/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":280791362,"owners_count":26391692,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-24T02:00:06.418Z","response_time":73,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","oauth2","php","teamleader"],"created_at":"2024-12-25T00:25:34.283Z","updated_at":"2025-10-24T11:58:20.806Z","avatar_url":"https://github.com/justijndepover.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Teamleader API\n\n[![Latest Version on Packagist](https://img.shields.io/packagist/v/justijndepover/teamleader-api.svg?style=flat-square)](https://packagist.org/packages/justijndepover/teamleader-api)\n[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE.md)\n[![Total Downloads](https://img.shields.io/packagist/dt/justijndepover/teamleader-api.svg?style=flat-square)](https://packagist.org/packages/justijndepover/teamleader-api)\n\nPHP Client for the Teamleader API\n\n![Logo](https://raw.githubusercontent.com/justijndepover/teamleader-api/master/docs/logo.jpg)\n\n## Caution\n\nThis application is still in development and could implement breaking changes. Please use at your own risk.\n\n## Installation\n\nYou can install the package with composer\n\n```sh\ncomposer require justijndepover/teamleader-api\n```\n\n## Installing the package in Laravel\n\nTo use the plugin in Laravel applications, please refer to the [Laravel usage page](docs/laravel-usage.md)\n\n## Usage\n\nConnecting to Teamleader:\n```php\n// note the state param: this can be a random string. It's used as an extra layer of protection. Teamleader will return this value when connecting.\n$teamleader = new Teamleader(CLIENT_ID, CLIENT_SECRET, REDIRECT_URI, STATE);\n// open the teamleader login\nheader(\"Location: {$teamleader-\u003eredirectForAuthorizationUrl()}\");\nexit;\n```\n\nAfter connecting, Teamleader will send a request back to your redirect uri.\n```php\n$teamleader = new Teamleader(CLIENT_ID, CLIENT_SECRET, REDIRECT_URI, STATE);\n\nif ($_GET['error']) {\n    // your application should handle this error\n}\n\nif ($_GET['state'] != $teamleader-\u003egetState()) {\n    // state value does not match, your application should handle this error\n}\n\n$teamleader-\u003esetAuthorizationCode($_GET['code']);\n$teamleader-\u003econnect();\n\n// store these values:\n$accessToken = $teamleader-\u003egetAccessToken();\n$refreshToken = $teamleader-\u003egetRefreshToken();\n$expiresAt = $teamleader-\u003egetTokenExpiresAt();\n```\n\nYour application is now connected. To start fetching data:\n```php\n$teamleader = new Teamleader(CLIENT_ID, CLIENT_SECRET, REDIRECT_URI, STATE);\n$teamleader-\u003esetAccessToken($accessToken);\n$teamleader-\u003esetRefreshToken($refreshToken);\n$teamleader-\u003esetTokenExpiresAt($expiresAt);\n\n// fetch data:\n$teamleader-\u003ecrm-\u003eget();\n\n// you should always store your tokens at the end of a call\n$accessToken = $teamleader-\u003egetAccessToken();\n$refreshToken = $teamleader-\u003egetRefreshToken();\n$expiresAt = $teamleader-\u003egetTokenExpiresAt();\n```\n\n## Available methods\n\nNote that your application should have the correct scopes enabled inside the [integration](https://marketplace.focus.teamleader.eu/be/nl/ontwikkel/integraties)\n\nThis application is in an early development stage. Therefore not all resources are available as props yet. (for example: `$teamleader-\u003eusers-\u003eme`)\nIn the meantime it's possible to fetch every resource available through the `get` and `post` methods:\n```php\n$teamleader-\u003eget('users.me');\n$teamleader-\u003eget('departments.list');\n$teamleader-\u003eget('departments.info', ['id' =\u003e $id]);\n$teamleader-\u003epost('contacts.add', [\n    // all the data\n]);\n```\n\n## Rate limiting\n\nAfter each request, the rate limiting headers are available.\n```php\n// returns the maximum rate limit your application can hit in 1 minute\n$teamleader-\u003egetRateLimitLimit();\n\n// returns the current limit remaining\n$teamleader-\u003egetRateLimitRemaining();\n\n// returns the datetime (UTC) when your application can make calls again, after hitting the rate limit.\n$teamleader-\u003egetRateLimitReset();\n```\n\nHow you handle rate limiting is up to you. But the application provides a helper method to ensure you never hit the limit:\n```php\n$teamleader-\u003eget('contacts.info', ['id' =\u003e $id]);\n// executing this function will sleep until the X-RateLimitReset header has passed, but only if the rate limit is hit.\n$teamleader-\u003eensureRateLimitingIsNotExceeded();\n```\n\n## Security\n\nIf you find any security related issues, please open an issue or contact me directly at [justijndepover@gmail.com](justijndepover@gmail.com).\n\n## Contribution\n\nIf you wish to make any changes or improvements to the package, feel free to make a pull request.\n\n## License\n\nThe MIT License (MIT). Please see [License File](LICENSE.md) for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjustijndepover%2Fteamleader-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjustijndepover%2Fteamleader-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjustijndepover%2Fteamleader-api/lists"}