{"id":16410545,"url":"https://github.com/skipperbent/happn-php-sdk","last_synced_at":"2025-06-21T22:03:14.961Z","repository":{"id":57037408,"uuid":"45443755","full_name":"skipperbent/happn-php-sdk","owner":"skipperbent","description":"Easy to use PHP SDK for accessing Happn data.","archived":false,"fork":false,"pushed_at":"2018-03-08T05:58:23.000Z","size":29,"stargazers_count":3,"open_issues_count":1,"forks_count":2,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-30T20:49:50.890Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/skipperbent.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":"2015-11-03T05:24:03.000Z","updated_at":"2018-03-08T03:16:21.000Z","dependencies_parsed_at":"2022-08-24T06:41:10.038Z","dependency_job_id":null,"html_url":"https://github.com/skipperbent/happn-php-sdk","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/skipperbent/happn-php-sdk","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skipperbent%2Fhappn-php-sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skipperbent%2Fhappn-php-sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skipperbent%2Fhappn-php-sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skipperbent%2Fhappn-php-sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/skipperbent","download_url":"https://codeload.github.com/skipperbent/happn-php-sdk/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skipperbent%2Fhappn-php-sdk/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261200371,"owners_count":23123945,"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-10-11T06:43:15.031Z","updated_at":"2025-06-21T22:03:09.944Z","avatar_url":"https://github.com/skipperbent.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# happn-php-sdk\n\nEasy to use PHP SDK for accessing Happn data.\n\n## Installation\nAdd the latest version of happn-php-sdk to your ```composer.json```\n\n```json\n{\n    \"require\": {\n        \"pecee/happn-php-sdk\": \"1.*\"\n    },\n    \"require-dev\": {\n        \"pecee/happn-php-sdk\": \"1.*\"\n    }\n}\n```\n\n## Like this?\n\nLike this SDK? Then you'll definetly love our \"tinder-php-sdk\", check it out here:\nhttps://github.com/skipperbent/tinder-php-sdk\n\n## Examples\n\nThis section contains basic examples on how to use the SDK.\n\n### Getting Facebook access token\n\nTo use the SDK - the api requires you to get a valid Facebook access token. This can be accomplished by following [this link](https://www.facebook.com/dialog/oauth?client_id=247294518656661\u0026redirect_uri=https://www.happn.fr\u0026scope=basic_info,email,public_profile,user_about_me,user_activities,user_birthday,user_education_history,user_friends,user_interests,user_likes,user_location,user_photos,user_relationship_details\u0026response_type=token) and copying the ```access_token``` parameter provided by Facebook after a successful login.\n\n### Authentication\n\nConnect to the service, using your Facebook token.\n\n```php\n$happn = new \\Pecee\\Http\\Service\\Happn($fbToken);\n```\n\n### Get user information\n\nFetches user information\n\nReturns dictionary packed with:\nuser id, facebook id, twitter id (not implemented), first name, last name, birth date, login (nulled), workplace, distance\n\n```php\n$response = $happn-\u003egetUserInfo($userId);\n```\n\n### Get recommendations\n\nGet recommendations from Happn server to the user authenticated.\n\n```php\n$response = $happn-\u003egetRecommendations($limit = 16, $offset = 0);\n```\n\n### Get distance\n\nFetches the distance from another user\n\n```php\n$response = $happn-\u003egetDistance($userId);\n```\n\n### Get Happn settings\n\n**Note: Will be updated soon with correct parameters**\n\nSet Happn settings.\n\n```php\n$response = $happn-\u003esetSettings(array $userId);\n```\n\n### Set position\n\nSet the position of the user using Happn's API\n\n```php\n$response = $happn-\u003esetPosition($lat, $lon);\n```\n\n### Set position\n\nUpdates user activity\n\n```php\n$response = $happn-\u003eupdateActivity();\n```\n\n### Get user id\n\nReturns user id of the currently authenticated user\n\n```php\n$response = $happn-\u003egetUserId();\n```\n\n### Get Facebook access token\n\nReturns Facebook access token of the currently authenticated user\n\n```php\n$response = $happn-\u003egetFbToken();\n```\n\n### Custom query\n\nMake custom query upon Happn api.\n\n```php\n$response = $happn-\u003eapi($url, $method, array $data);\n```\n\n## The MIT License (MIT)\n\nCopyright (c) 2015 Simon Sessingø / happn-php-sdk\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fskipperbent%2Fhappn-php-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fskipperbent%2Fhappn-php-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fskipperbent%2Fhappn-php-sdk/lists"}