{"id":19845216,"url":"https://github.com/rapidwebltd/php-google-people-api","last_synced_at":"2025-04-06T12:10:36.815Z","repository":{"id":37390737,"uuid":"121652908","full_name":"rapidwebltd/php-google-people-api","owner":"rapidwebltd","description":"👥 This package provides a user friendly way of interacting with Google Contacts via the Google People API.","archived":false,"fork":false,"pushed_at":"2020-09-25T13:00:58.000Z","size":88,"stargazers_count":102,"open_issues_count":31,"forks_count":40,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-03-30T11:08:30.588Z","etag":null,"topics":["google","google-contacts","google-people","google-people-api","php","php-library"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rapidwebltd.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-02-15T16:33:41.000Z","updated_at":"2025-03-03T06:21:19.000Z","dependencies_parsed_at":"2022-09-15T00:11:25.418Z","dependency_job_id":null,"html_url":"https://github.com/rapidwebltd/php-google-people-api","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rapidwebltd%2Fphp-google-people-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rapidwebltd%2Fphp-google-people-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rapidwebltd%2Fphp-google-people-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rapidwebltd%2Fphp-google-people-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rapidwebltd","download_url":"https://codeload.github.com/rapidwebltd/php-google-people-api/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247478324,"owners_count":20945266,"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":["google","google-contacts","google-people","google-people-api","php","php-library"],"created_at":"2024-11-12T13:06:54.348Z","updated_at":"2025-04-06T12:10:36.795Z","avatar_url":"https://github.com/rapidwebltd.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 👥 PHP Google People API\n\nThis package provides a user friendly way of interacting with Google Contacts via the Google People API.\n\n\u003cimg src=\"assets/images/php-google-people-api.png\" /\u003e\n\n## Installation\n\nPHP Google People API can be easily installed using Composer. Just run the following command from the root of your project.\n\n```\ncomposer require rapidwebltd/php-google-people-api\n```\n\nIf you have never used the Composer dependency manager before, head to the [Composer website](https://getcomposer.org/) for more information on how to get started.\n\n## Setup\n\nTo use this package, you need to authenticate with Google via OAuth 2. Thankfully, this is made easy by the PHP Google OAuth 2 Handler package.\n\nYou can run its guided setup script with the following command.\n\n```\nphp vendor/rapidwebltd/php-google-oauth-2-handler/src/setup.php\n```\n\nThis will guide you through the process of setting up a project, and logging into to the Google account that you wish to manage contacts for.\nWhen asked which scopes you require access to, enter the following.\n\n```\nhttps://www.googleapis.com/auth/userinfo.profile\nhttps://www.googleapis.com/auth/contacts\nhttps://www.googleapis.com/auth/contacts.readonly\n```\n\nWhen complete, you will have to code you need to create a `GoogleOAuth2Handler` object for this Google account.\n\nYou can then create a `GooglePeople` object, as follows.\n\n```php\n$people = new GooglePeople($googleOAuth2Handler);\n```\n\n## Usage\n\n### Retrieve all contacts\n\n```php\n// Retrieval all contacts\nforeach($people-\u003eall() as $contact) {\n    echo $contact-\u003eresourceName.' - ';\n    if ($contact-\u003enames) {\n        echo $contact-\u003enames[0]-\u003edisplayName;\n    }\n    echo PHP_EOL;\n}\n```\n\n### Retrieve a single contact\n\n```php\n// Retrieve single contact (by resource name)\n$contact = $people-\u003eget('people/c8055020007701654287');\n```\n\n### Create a new contact\n\n```php\n// Create new contact\n$contact = new Contact($people);\n$contact-\u003enames[0] = new stdClass;\n$contact-\u003enames[0]-\u003egivenName = 'Testy';\n$contact-\u003enames[0]-\u003efamilyName = 'McTest Test';\n$contact-\u003esave();\n```\n\n### Update a contact\n\n```php\n// Update contact\n$contact-\u003enames[0]-\u003efamilyName = 'McTest';\n$contact-\u003esave();\n```\n\n### Delete a contact\n\n```php\n// Delete contact\n$contact-\u003edelete();\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frapidwebltd%2Fphp-google-people-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frapidwebltd%2Fphp-google-people-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frapidwebltd%2Fphp-google-people-api/lists"}