{"id":22003864,"url":"https://github.com/ajimix/asana-api-php-class","last_synced_at":"2025-04-04T15:10:11.732Z","repository":{"id":3100377,"uuid":"4125870","full_name":"ajimix/asana-api-php-class","owner":"ajimix","description":"A dependency free, lightweight PHP class that acts as wrapper for Asana API. Lets make things fast and easy! :)","archived":false,"fork":false,"pushed_at":"2022-07-19T04:25:42.000Z","size":253,"stargazers_count":142,"open_issues_count":1,"forks_count":67,"subscribers_count":16,"default_branch":"master","last_synced_at":"2025-03-28T14:09:18.029Z","etag":null,"topics":["asana","asana-api","oauth","php","wrapper"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ajimix.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-04-24T14:54:40.000Z","updated_at":"2024-12-06T16:40:07.000Z","dependencies_parsed_at":"2022-08-06T13:15:25.624Z","dependency_job_id":null,"html_url":"https://github.com/ajimix/asana-api-php-class","commit_stats":null,"previous_names":[],"tags_count":38,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ajimix%2Fasana-api-php-class","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ajimix%2Fasana-api-php-class/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ajimix%2Fasana-api-php-class/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ajimix%2Fasana-api-php-class/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ajimix","download_url":"https://codeload.github.com/ajimix/asana-api-php-class/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247198463,"owners_count":20900080,"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","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":["asana","asana-api","oauth","php","wrapper"],"created_at":"2024-11-30T00:11:22.729Z","updated_at":"2025-04-04T15:10:11.707Z","avatar_url":"https://github.com/ajimix.png","language":"PHP","readme":"# Asana API PHP class\n\nA dependency free, lightweight PHP class that acts as wrapper for Asana API.  \nLets make things fast and easy! :)\n\n## Installing\n\nChoose your favourite flavour\n\n- Download the php class from Github.\n- Or use [Packagist](https://packagist.org/packages/ajimix/asana-api-php-class) PHP package manager.\n\nFinally require the asana.php file.\n\n## Working with the class\n\nFirst declare the asana class\n\n```php\n$asana = new Asana([\n    'personalAccessToken' =\u003e 'GET_IT_FROM_ASANA'\n]);\n```\n\n*Optionally you can pass an accessToken instead of a personalAccessToken if you use OAuth. Read [Using Asana Oauth Tokens](#using-asana-oauth-tokens) below for more info.*\n\n#### Creating a task\n\n```php\n$asana-\u003ecreateTask([\n   'workspace' =\u003e '176825', // Workspace ID\n   'name' =\u003e 'Hello World!', // Name of task\n   'assignee' =\u003e 'bigboss@bigcompany.com', // Assign task to...\n   'followers' =\u003e ['3714136', '5900783'] // We add some followers to the task... (this time by ID)\n]);\n```\n\nCreating a task for another assignee than yourself will mark the task as private by\ndefault. This results in the task not being available for modification through the\nAPI anymore. Take a look at the [API Reference](https://asana.com/developers/api-reference/tasks)\nfor more fields of the Task you can directly pass to `createTask`.\n\n#### Adding task to project\n\n```php\n$asana-\u003eaddProjectToTask('THIS_TASK_ID_PLEASE', 'TO_THIS_COOL_PROJECT_ID');\n```\n\n#### Commenting on a task\n\n```php\n$asana-\u003ecommentOnTask('MY_BEAUTIFUL_TASK_ID', 'Please please! Don\\'t assign me this task!');\n```\n\n#### Getting projects in all workspaces\n\n```php\n$asana-\u003egetProjects();\n```\n\n#### Updating project info\n\n```php\n$asana-\u003eupdateProject('COOL_PROJECT_ID', [\n    'name' =\u003e 'This is a new cool project!',\n    'notes' =\u003e 'At first, it wasn\\'t cool, but after this name change, it is!'\n]);\n```\n\n#### Do more\n\nThere are a [lot more methods](https://github.com/ajimix/asana-api-php-class/blob/master/asana.php) to do almost everything with asana.\n\nSee the examples [inside examples folder](https://github.com/ajimix/asana-api-php-class/tree/master/examples), read the comments on the [class file]((https://github.com/ajimix/asana-api-php-class/blob/master/asana.php)) for class magic and read [Asana API documentation](http://developer.asana.com/documentation/) if you want to be a master.\n\nIf a method returned some data, you can always retrieve it by calling.\n\n```php\n$asana-\u003egetData();\n```\n\nIf you miss some functionality, open a pull request and it will be merged as soon as possible.\n\nEnjoy ;D\n\n## Using Asana OAuth tokens\n\nTo use this API, you can also create an App on Asana to get an oAuth access token, then include the class:\n\n```php\nrequire_once('asana-oauth.php');\n```\n\nDeclare the oAuth class as:\n\n```php\n$asanaAuth = new AsanaAuth('YOUR_APP_ID', 'YOUR_APP_SECRET', 'CALLBACK_URL');\n$url = $asanaAuth-\u003egetAuthorizeUrl();\n```\n\nWhere YOUR_APP_ID, YOUR_APP_SECRET and CALLBACK_URL you get from your App's details on Asana. Now, redirect the browser to the result held by $url. The user will be asked to login \u0026 accept your app, after which the browser will be returned to the CALLBACK_URL, which should process the result:\n\n```php\n$code = $_GET['code'];\n$asanaAuth-\u003egetAccessToken($code);\n```\n\nAnd you will receive an object with the access token and a refresh token\nThe token expires after one hour so you can refresh it doing the following:\n\n```php\n$asanaAuth-\u003erefreshAccessToken('ACCESS_TOKEN');\n```\n\nFor a more detailes instructions on how to make oauth work check the example in examples/oauth.php\n\n## Author\n\n**Twitter:** [@ajimix](http://twitter.com/ajimix)\n\n**GitHub:** [github.com/ajimix](https://github.com/ajimix)\n\n**Contributors:** [view contributors](https://github.com/ajimix/asana-api-php-class/graphs/contributors)\n\n\n### Copyright and license\n\nCopyright 2022 Ajimix\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this work except in compliance with the License.\nYou may obtain a copy of the License in the LICENSE file, or at:\n\n   http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fajimix%2Fasana-api-php-class","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fajimix%2Fasana-api-php-class","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fajimix%2Fasana-api-php-class/lists"}