{"id":18226913,"url":"https://github.com/polidog/php-chatwork-api","last_synced_at":"2025-06-21T09:40:04.483Z","repository":{"id":12169895,"uuid":"14767952","full_name":"polidog/php-chatwork-api","owner":"polidog","description":null,"archived":false,"fork":false,"pushed_at":"2023-08-22T01:17:27.000Z","size":788,"stargazers_count":28,"open_issues_count":0,"forks_count":9,"subscribers_count":2,"default_branch":"3.x","last_synced_at":"2025-06-12T15:05:31.949Z","etag":null,"topics":["api-php","chatwork-api","php"],"latest_commit_sha":null,"homepage":null,"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/polidog.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2013-11-28T04:43:21.000Z","updated_at":"2024-12-14T03:11:54.000Z","dependencies_parsed_at":"2024-06-21T20:12:16.154Z","dependency_job_id":null,"html_url":"https://github.com/polidog/php-chatwork-api","commit_stats":{"total_commits":136,"total_committers":5,"mean_commits":27.2,"dds":0.03676470588235292,"last_synced_commit":"459302d721c41287e9ac50af4d5c0c586bfb5551"},"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"purl":"pkg:github/polidog/php-chatwork-api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/polidog%2Fphp-chatwork-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/polidog%2Fphp-chatwork-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/polidog%2Fphp-chatwork-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/polidog%2Fphp-chatwork-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/polidog","download_url":"https://codeload.github.com/polidog/php-chatwork-api/tar.gz/refs/heads/3.x","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/polidog%2Fphp-chatwork-api/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261101636,"owners_count":23109860,"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":["api-php","chatwork-api","php"],"created_at":"2024-11-04T05:04:01.979Z","updated_at":"2025-06-21T09:39:59.451Z","avatar_url":"https://github.com/polidog.png","language":"PHP","readme":"php-chatwork-api\n================\n\n![test](https://github.com/polidog/php-chatwork-api/workflows/test/badge.svg)\n[![Scrutinizer Quality Score](https://scrutinizer-ci.com/g/polidog/php-chatwork-api/badges/quality-score.png?s=56ea782f70ecfbe3de485e4be2a2c585455e44e3)](https://scrutinizer-ci.com/g/polidog/php-chatwork-api/)\n[![Latest Stable Version](https://poser.pugx.org/polidog/php-chatwork-api/v/stable.svg)](https://packagist.org/packages/polidog/php-chatwork-api)\n[![Total Downloads](https://poser.pugx.org/polidog/php-chatwork-api/downloads.svg)](https://packagist.org/packages/polidog/php-chatwork-api)\n[![License](https://poser.pugx.org/polidog/php-chatwork-api/license.svg)](https://packagist.org/packages/polidog/php-chatwork-api)\n\n[Chatwork](http://www.chatwork.com/ja/) APIをPHPから利用するためのライブラリです。\n\n## Install\n\n```\n$ composer require polidog/php-chatwork-api\n```\n\n\n## Quick Example\n\n利用する前に必ずChatWorkのAPIキーを用意しておいてください。  \n[APIキーの確認方法](http://developer.chatwork.com/ja/authenticate.html)を確認してください。\n\n### オブジェクトを取得する\n\n```\n// ChatWork API Clientオブジェクトの初期化\n$chatwork = \\Polidog\\Chatwork\\Chatwork::create(\"chatwork api token\");\n```\n\n### 自分自身の情報(APIキーの所有者)\n\n```\n$user = $chatwork-\u003eme()-\u003eshow();\n\n// APIのレスポンスはすべてオブジェクトの形で取得できます\nvar_dump($user);\n```\n\n### チャットルーム一覧を取得する\n\n```\n$rooms = $chatwork-\u003erooms()-\u003eshow();\nvar_dump($rooms);\n```\n\n### チャットルームを作成する\n\n```\n// まずはRoomクラスを用意する\n$room = new \\Polidog\\Chatwork\\Entity\\Room();\n$room-\u003ename = 'test chat';\n\n// 次にメンバー一覧を用意する\n$members = new \\Polidog\\Chatwork\\Entity\\Collection\\MembersCollection();\n$member = new \\Polidog\\Chatwork\\Entity\\Member();\n$member-\u003erole = 'admin';\n$member-\u003eaccount = $user;\n$members-\u003eadd($member);\n\n$chatwork-\u003erooms()-\u003ecreate($room, $members)\n```\n\n### チャットルームのメンバー一覧を取得する\n```\n$members = $client-\u003erooms()-\u003emembers(123456/* roomidを指定します。*/);\nvar_dump($members);\n\n```\n\n### チャットルームのメッセージ一覧を取得する\n```\n// $force(0: 新しいメッセージのみ, 1: ラスト100メッセージ)\n$messages = $client-\u003erooms()-\u003emessages($room_id)-\u003eshow($force);\n```\n\n### メッセージ送信\n```\n$message = new \\Polidog\\Chatwork\\Entity\\Message();\n$message-\u003ebody = 'メッセージ内容';\n$client-\u003erooms()-\u003emessages($room_id)-\u003ecreate($message);\n```\n\n### メッセージ更新\n```\n$message = new \\Polidog\\Chatwork\\Entity\\Message();\n$message-\u003ebody = 'メッセージ内容';\n// $message_id(メッセージのID)\n$client-\u003erooms()-\u003emessages($room_id)-\u003eupdate($message, $message_id);\n```\n\n### メッセージ削除\n```\n// $message_id(メッセージのID)\n$client-\u003erooms()-\u003emessages($room_id)-\u003edelete($message_id);\n```\n\n### チャットルームのファイル一覧を取得する\n```\n$files = $client-\u003erooms()-\u003efiles($room_id)-\u003eshow();\n```\n\n### ファイル情報を取得する\n```\n$files = $client-\u003erooms()-\u003efiles($room_id)-\u003edetail($file_id);\n```\n\n## 関連リンク\n- [ChatWork API](http://developer.chatwork.com/ja/)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpolidog%2Fphp-chatwork-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpolidog%2Fphp-chatwork-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpolidog%2Fphp-chatwork-api/lists"}