{"id":21070625,"url":"https://github.com/wisembly/intercom-php","last_synced_at":"2025-05-16T05:30:55.359Z","repository":{"id":16283517,"uuid":"19031987","full_name":"Wisembly/intercom-php","owner":"Wisembly","description":"php 5.4 client that eases Intercom intergration in your apps","archived":false,"fork":false,"pushed_at":"2015-05-13T13:22:21.000Z","size":432,"stargazers_count":6,"open_issues_count":2,"forks_count":2,"subscribers_count":15,"default_branch":"master","last_synced_at":"2025-04-03T20:37:33.994Z","etag":null,"topics":[],"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/Wisembly.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2014-04-22T14:06:37.000Z","updated_at":"2015-05-13T13:12:55.000Z","dependencies_parsed_at":"2022-08-03T15:09:54.557Z","dependency_job_id":null,"html_url":"https://github.com/Wisembly/intercom-php","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Wisembly%2Fintercom-php","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Wisembly%2Fintercom-php/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Wisembly%2Fintercom-php/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Wisembly%2Fintercom-php/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Wisembly","download_url":"https://codeload.github.com/Wisembly/intercom-php/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254473821,"owners_count":22077182,"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":[],"created_at":"2024-11-19T18:47:38.247Z","updated_at":"2025-05-16T05:30:51.439Z","avatar_url":"https://github.com/Wisembly.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://api.travis-ci.org/Wisembly/intercom-php.svg)](http://travis-ci.org/Wisembly/intercom-php)\n\n# Intercom-php\n\nThis little library allows you to use Intercom API more easily. It provides clients to manage your users or your events fluently.\n\nThe curl client used is [Guzzle](https://github.com/guzzle/guzzle). Instanciate Guzzle with your configuration and give it to your Intercom client with you credentials and it's ready go !\n\n[Intercom API documentation](http://doc.intercom.io/api/)\n\n# Versioning\n\nFor the moment the library is in \"Work In Progress\". Master move fast and I don't guarantee BC before announcing a stable version in 1.1.0.\n\n# Installation\n\n1. Install composer : `curl -s http://getcomposer.org/installer | php`\n(more info at getcomposer.org)\n\n2. Create a `composer.json` file in your project root :\n(or add only the excelant line in your existing composer file)\n\n```yml\n  {\n    \"require\": {\n      \"wisembly/intercom-php\": \"*\",\n    }\n  }\n```\n\n3. Install via composer : `php composer.phar install`\n\n# Use Intercom-php\n\n## Create the client for manage Users\n\n```php\nuse GuzzleHttp\\Client as Guzzle;\nuse Intercom\\Client\\User as Intercom;\n\n$guzzleHttp = new Guzzle;\n$intercom = new Intercom('APP_ID', 'API_KEY', $guzzle);\n```\n\n## Actions\n\nNow you can do all the requests that the Intercom User API allows. For each actions, you need to create a User object that represents your Intercom User.\n\n### Create\n\n```php\nuse Intercom\\Object\\User;\n\n$user = new User(1, 'foo@company.com'); // user_id or email\n$intercom-\u003ecreate($user);\n```\n\n### Update\n\n```php\nuse Intercom\\Object\\User;\n\n$user = new User(1, 'foo@company.com'); // user_id or email\n$intercom-\u003eupdate($user);\n```\n\n### Delete\n\n```php\nuse Intercom\\Object\\User;\n\n$user = new User(1, 'foo@company.com'); // user_id or email\n$intercom-\u003edelete($user);\n```\n\n### Get\n\n```php\n$user = $intercom-\u003eget(1, 'foo@company.com'); // user_id or email\n```\n\n### Search\n\nTo search users through all your Intercom database, use an instance of ``UserSearch`` that allows you to find users with specified attributes.\n\n```php\nuse Intercom\\Request\\Search\\UserSearch;\n\n// Retrieve the first ten users with tag name \"premium\"\n$search = new UserSearch(1, 10, null, 'premium');\n\n$users = $intercom-\u003esearch($search);\n```\n\nSee the complete documentation of this [search API](https://github.com/Wisembly/intercom-php/blob/master/lib/Intercom/Request/Search/UserSearch.php#L31).\n\n### Use case : How to retrieve all your Intercom users ?\n\nBy default the Intercom API allows you to retrieve 500 entities per request.\n\n```php\nuse GuzzleHttp\\Client as Guzzle;\nuse Intercom\\Request\\UserSearch;\nuse Intercom\\Client\\User as Intercom;\n\n// Create the client\n$guzzle = new Guzzle;\n$intercom = new Intercom('APP_ID', 'API_KEY', $guzzle);\n\n// Create a search with defaut parameters\n$search = new UserSearch;\n\n$users = [];\n\n// Fetch all users\ndo {\n    $response = $intercom-\u003esearch($search);\n    $users = array_merge($users, $response-\u003egetContent());\n    $search-\u003esetPage($response-\u003egetNextPage());\n} while ($response-\u003ehasPageToBeFetch());\n```\n\n# TODO\n\n- Tagging\n- Notes\n- Impressions\n- Messages threads\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwisembly%2Fintercom-php","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwisembly%2Fintercom-php","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwisembly%2Fintercom-php/lists"}