{"id":36980152,"url":"https://github.com/kiwari-engineering/bot-sdk-php","last_synced_at":"2026-01-13T22:49:47.111Z","repository":{"id":57007161,"uuid":"184739252","full_name":"kiwari-engineering/bot-sdk-php","owner":"kiwari-engineering","description":"Kiwari Bot SDK PHP","archived":false,"fork":false,"pushed_at":"2019-05-03T10:53:33.000Z","size":1126,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-27T06:52:05.980Z","etag":null,"topics":["bot-api","bot-sdk","kiwari","kiwari-bot","kiwari-bot-sdk","kiwari-sdk","sdk"],"latest_commit_sha":null,"homepage":"https://www.kiwari.chat","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/kiwari-engineering.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":"2019-05-03T10:44:28.000Z","updated_at":"2019-05-16T03:25:39.000Z","dependencies_parsed_at":"2022-08-21T12:40:40.189Z","dependency_job_id":null,"html_url":"https://github.com/kiwari-engineering/bot-sdk-php","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/kiwari-engineering/bot-sdk-php","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kiwari-engineering%2Fbot-sdk-php","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kiwari-engineering%2Fbot-sdk-php/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kiwari-engineering%2Fbot-sdk-php/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kiwari-engineering%2Fbot-sdk-php/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kiwari-engineering","download_url":"https://codeload.github.com/kiwari-engineering/bot-sdk-php/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kiwari-engineering%2Fbot-sdk-php/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28402159,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-13T14:36:09.778Z","status":"ssl_error","status_checked_at":"2026-01-13T14:35:19.697Z","response_time":56,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["bot-api","bot-sdk","kiwari","kiwari-bot","kiwari-bot-sdk","kiwari-sdk","sdk"],"created_at":"2026-01-13T22:49:47.037Z","updated_at":"2026-01-13T22:49:47.098Z","avatar_url":"https://github.com/kiwari-engineering.png","language":"PHP","readme":"# Kiwari Bot SDK [PHP]\n\n## Requirements\n\n* PHP\n* Composer\n* Kiwari Account for Bot\n* ngrok _(for running the example)_\n\n## How to use\n\n### Setup\n\n* Please add this SDK to your Bot PHP usng composer\n\n```bash\n$ composer require kiwari/kiwari-bot-sdk\n```\n\n* Get your `acces_token` of Kiwari Bot Account, you can find in Kiwari Dashboard\n* Init Kiwari Bot SDK\n\n```php\n\u003c?php\n\nrequire 'vendor/autoload.php';\n\n$bot = new \\Kiwari\\Kiwari('your-access-token-here');\n$bot-\u003eenableLog(true); // you can enable log, the log file is inside your tmp\n\n//now you need to run the bot\n$bot-\u003erun();\n```\n\n* After you init Kiwari Bot, you can get `message`, `chatroom`, `sender`, and `myaccount`\n\n```php\n\u003c?php\n\n//and now you can get the incomming data by using :\n$sender = $bot-\u003egetSender();\n/**\n * to get the sender\n * example data for method : $bot-\u003egetSender()\n * \n * {\n *      \"id\": 287,\n *      \"phone_number\": \"+6285123123123\",\n *      \"fullname\": \"Jarjit Singh\",\n *      \"qiscus_email\": \"jarjitid@kiwari-prod.com\",\n *      \"qiscus_id\": 11\n * }\n */\n\n$myAccount = $bot-\u003egetMyAccount();\n/**\n * to get the my account or the bot\n * example data for method : $bot-\u003egetMyAccount()\n * \n * {\n *      \"id\": 22,\n *      \"phone_number\": \"+628681234567\",\n *      \"fullname\": \"Cuti Bot\",\n *      \"qiscus_email\": \"cutibot_id@kiwari-prod.com\"\n * }\n */\n\n$room = $bot-\u003egetChatRoom();\n/**\n * to get chatroom\n * example data for method : $bot-\u003egetChatRoom()\n * \n * {\n *     \"id\": 1510,\n *     \"qiscus_room_name\": \"Name of Chat Room\",\n *     \"qiscus_room_id\": 8777,\n *     \"is_group_chat\": false,\n *     \"created_at\": \"2017-06-02T01:33:12.233Z\",\n *     \"updated_at\": \"2017-06-02T01:33:12.233Z\",\n *     \"application_id\": 3,\n *     \"group_avatar_url\": \"\",\n *     \"is_official_chat\": false,\n *     \"target_user_id\": 443,\n *     \"is_public_chat\": false,\n *     \"is_channel\": false,\n *     \"users\": [\n *         {\n *             \"id\": 287,\n *             \"phone_number\": \"+6285123123123\",\n *             \"fullname\": \"Jarjit Singh\",\n *             \"qiscus_email\": \"jarjitid@kiwari-prod.com\",\n *             \"qiscus_id\": 784\n *          },\n *          {\n *              \"id\": 22,\n *              \"phone_number\": \"+628681234567\",\n *              \"fullname\": \"Cuti Bot\",\n *              \"qiscus_email\": \"cutibot_id@kiwari-prod.com\",\n *              \"qiscus_id\": 2039\n *           }\n *       ],\n *       \"chat_name\": \"Group Chat Name\",\n *       \"chat_avatar_url\": \"\"\n * }\n */\n\n$message = $bot-\u003egetMessage();\n/**\n * to get the message\n * example data for method : $bot-\u003egetMessage()\n * \n * {\n *     \"payload\": {},\n *     \"text\": \"halo bro\",\n *     \"type\": \"text\"\n * }\n */\n```\n\n* Now you can send the message into the opponent user by call the method that provided like below\n\n* **Send Message Text**\n\n```php\n\u003c?php\n\n$response = $bot-\u003esendText($room['qiscus_room_id'], 'Hello, this is from Kiwari Bot SDK PHP');\n\nvar_dump($response); //you can see the response if you need to debug or something to handle in your bot\n```\n\n* **Send Button**\n\n_More example, please see the test [here](tests/Model/ButtonTest.php)_\n\n```php\n\u003c?php\n\n$response = $bot-\u003esendButton($room['qiscus_room_id'], 'This is message Example', [\n    \\Kiwari\\Model\\Button::create()\n        -\u003esetLabel('Google')\n        -\u003esetUrl('https://google.com'),\n    \\Kiwari\\Model\\Button::create()\n        -\u003esetLabel('Facebook')\n        -\u003esetUrl('https://facebook.com'),\n    \\Kiwari\\Model\\Button::create()\n        -\u003esetLabel('Twitter')\n        -\u003esetUrl('https://twitter.com')\n]);\n\nvar_dump($response);\n```\n\n* **Send Document**\n\n_If you want to send document message, you need to upload the document or file first by using `$bot-\u003eupload()` function_\n\n```php\n\u003c?php\n\n$path = '/Users/andhikayuana/Downloads/wav_wav_wavv.mp3';\n$upload = $bot-\u003eupload($path);\nvar_dump($upload-\u003ebody-\u003edata-\u003eurl); // you can get the file url here\n\n//now you can send the document like below\n$response = $bot-\u003esendDocument($room['qiscus_room_id'], $upload-\u003ebody-\u003edata-\u003eurl);\nvar_dump($response);\n```\n\n* **Send Card**\n\n```php\n\u003c?php\n\nuse Kiwari\\Model\\Card;\n\n$bot-\u003esendCard($room['qiscus_room_id'], 'ini teks',\n    Card::create()\n        -\u003esetText('Ini contoh textnya')\n        -\u003esetImageUrl('https://vignette.wikia.nocookie.net/upinipin/images/1/13/4_jarjit.png/revision/latest?cb=20180203141217')\n        -\u003esetTitle('ini contoh judulnya')\n        -\u003esetDescription('ini contoh deskripsi')\n        -\u003esetUrl('https://www.google.com/search?q=jarjit+singh\u0026safe=off\u0026rlz=1C5CHFA_enID828ID828\u0026tbm=isch\u0026source=iu\u0026ictx=1\u0026fir=fHecVrBhuDLpcM%253A%252CUAvPHuNZ8waOSM%252C_\u0026vet=1\u0026usg=AI4_-kR5h1JaCrqS6jGfMR41LepSu6XoWg\u0026sa=X\u0026ved=2ahUKEwi4qZW8-_7hAhVo63MBHS_NCrwQ9QEwA3oECAcQCg#imgrc=_\u0026vet=1')\n        -\u003esetButtons([\n            Button::create()\n                -\u003esetLabel('Jarjit Singh')\n                -\u003esetUrl('https://www.google.com/search?safe=off\u0026source=hp\u0026ei=rgbIXL6ZF8GEvQS1z5y4BQ\u0026q=jarjit+singh\u0026btnK=Google+Search\u0026oq=jarjit+singh\u0026gs_l=psy-ab.3..0l3j0i10l7.1892.2423..2633...0.0..0.110.518.5j1......0....1..gws-wiz.9PGvoF92CXU'),\n            Button::create()\n                -\u003esetLabel('Jarjit Singh')\n                -\u003esetUrl('https://www.google.com/search?safe=off\u0026source=hp\u0026ei=rgbIXL6ZF8GEvQS1z5y4BQ\u0026q=jarjit+singh\u0026btnK=Google+Search\u0026oq=jarjit+singh\u0026gs_l=psy-ab.3..0l3j0i10l7.1892.2423..2633...0.0..0.110.518.5j1......0....1..gws-wiz.9PGvoF92CXU')\n        ]));\n\n```\n\n* **Send Carousel**\n\n```php\n\u003c?php\n\nuse Kiwari\\Model\\Carousel;\n\n$bot-\u003esendCarousel($room['qiscus_room_id'], \n    Carousel::create()\n        -\u003esetCards([\n            Card::create()\n                -\u003esetText('Ini contoh textnya')\n                -\u003esetImageUrl('https://vignette.wikia.nocookie.net/upinipin/images/1/13/4_jarjit.png/revision/latest?cb=20180203141217')\n                -\u003esetTitle('ini contoh judulnya')\n                -\u003esetDescription('ini contoh deskripsi')\n                -\u003esetUrl('https://www.google.com/search?q=jarjit+singh\u0026safe=off\u0026rlz=1C5CHFA_enID828ID828\u0026tbm=isch\u0026source=iu\u0026ictx=1\u0026fir=fHecVrBhuDLpcM%253A%252CUAvPHuNZ8waOSM%252C_\u0026vet=1\u0026usg=AI4_-kR5h1JaCrqS6jGfMR41LepSu6XoWg\u0026sa=X\u0026ved=2ahUKEwi4qZW8-_7hAhVo63MBHS_NCrwQ9QEwA3oECAcQCg#imgrc=_\u0026vet=1')\n                -\u003esetButtons([\n                    Button::create()\n                        -\u003esetLabel('Jarjit Singh')\n                        -\u003esetUrl('https://www.google.com/search?safe=off\u0026source=hp\u0026ei=rgbIXL6ZF8GEvQS1z5y4BQ\u0026q=jarjit+singh\u0026btnK=Google+Search\u0026oq=jarjit+singh\u0026gs_l=psy-ab.3..0l3j0i10l7.1892.2423..2633...0.0..0.110.518.5j1......0....1..gws-wiz.9PGvoF92CXU'),\n                    Button::create()\n                        -\u003esetLabel('Jarjit Singh')\n                        -\u003esetUrl('https://www.google.com/search?safe=off\u0026source=hp\u0026ei=rgbIXL6ZF8GEvQS1z5y4BQ\u0026q=jarjit+singh\u0026btnK=Google+Search\u0026oq=jarjit+singh\u0026gs_l=psy-ab.3..0l3j0i10l7.1892.2423..2633...0.0..0.110.518.5j1......0....1..gws-wiz.9PGvoF92CXU')\n                ]),\n            Card::create()\n                -\u003esetText('Ini contoh textnya')\n                -\u003esetImageUrl('https://vignette.wikia.nocookie.net/upinipin/images/1/13/4_jarjit.png/revision/latest?cb=20180203141217')\n                -\u003esetTitle('ini contoh judulnya')\n                -\u003esetDescription('ini contoh deskripsi')\n                -\u003esetUrl('https://www.google.com/search?q=jarjit+singh\u0026safe=off\u0026rlz=1C5CHFA_enID828ID828\u0026tbm=isch\u0026source=iu\u0026ictx=1\u0026fir=fHecVrBhuDLpcM%253A%252CUAvPHuNZ8waOSM%252C_\u0026vet=1\u0026usg=AI4_-kR5h1JaCrqS6jGfMR41LepSu6XoWg\u0026sa=X\u0026ved=2ahUKEwi4qZW8-_7hAhVo63MBHS_NCrwQ9QEwA3oECAcQCg#imgrc=_\u0026vet=1')\n                -\u003esetButtons([\n                    Button::create()\n                        -\u003esetLabel('Jarjit Singh')\n                        -\u003esetUrl('https://www.google.com/search?safe=off\u0026source=hp\u0026ei=rgbIXL6ZF8GEvQS1z5y4BQ\u0026q=jarjit+singh\u0026btnK=Google+Search\u0026oq=jarjit+singh\u0026gs_l=psy-ab.3..0l3j0i10l7.1892.2423..2633...0.0..0.110.518.5j1......0....1..gws-wiz.9PGvoF92CXU'),\n                    Button::create()\n                        -\u003esetLabel('Jarjit Singh')\n                        -\u003esetUrl('https://www.google.com/search?safe=off\u0026source=hp\u0026ei=rgbIXL6ZF8GEvQS1z5y4BQ\u0026q=jarjit+singh\u0026btnK=Google+Search\u0026oq=jarjit+singh\u0026gs_l=psy-ab.3..0l3j0i10l7.1892.2423..2633...0.0..0.110.518.5j1......0....1..gws-wiz.9PGvoF92CXU')\n                ])\n        ]));\n```\n\n* **Send Custom**\n\n```php\n\u003c?php\n\nuse Kiwari\\Model\\Custom;\n\n$bot-\u003esendCustom($room['qiscus_room_id'], \n    Custom::create()\n        -\u003esetType('promo')\n        -\u003esetContent([\n            'product' =\u003e [\n                'id' =\u003e 123,\n                'name' =\u003e 'sandal mahal',\n                'price' =\u003e 5000000\n            ],\n            'discount' =\u003e 0.1\n        ]));\n\n```\n\n* **Send Location**\n\n```php\n\u003c?php\n\nuse Kiwari\\Model\\Location;\n\n$name = \"Mirota Kampus 2 Simanjuntak\";\n$address = \"Jalan C Simanjuntak No.70 ; Terban ; Gondokusuman ; Kota Yogyakarta ; Daerah Istimewa Yogyakarta 55223\" ; \n$latitude = -7.776235;\n$longitude = 110.374928;\n$mapUrl = \"http://maps.google.com/?q=-7.776235 ;110.374928\" ; \n\n$location = Location::create()\n    -\u003esetName($name)\n    -\u003esetAddress($address)\n    -\u003esetLatitude($latitude)\n    -\u003esetLongitude($longitude)\n    -\u003esetMapUrl($mapUrl);\n\n$bot-\u003esendLocation($room['qiscus_room_id'], $location);\n```\n\n```php\n\u003c?php\n\nuse Kiwari\\Model\\Reply;\n\n$bot-\u003esendReply($room['qiscus_room_id'], \n    Reply::create()\n        -\u003esetText('ini contoh reply')\n        -\u003esetRepliedCommentId(22092099));\n```\n## Example\n\nYou can try example by using [this example](./example)\n\n## Run Webhook Example\n\n* Run webhook example by executing\n\n```bash\n$ make run-example\n```\n\n* After you run webhook in the local, you need to bring online using ngrok\n\n```bash\n$ ngrok http 3000\n```\n\n* Now you can access your webhook url online in the internet like below\n\n```\nForwarding                    https://xxxxxxxx.ngrok.io -\u003e localhost:3000  \n```\n\n* Register the url in the Kiwari dashboard\n* Now you can chat with your Bot\n\n## Test\n\n```bash\n$ make test\n```","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkiwari-engineering%2Fbot-sdk-php","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkiwari-engineering%2Fbot-sdk-php","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkiwari-engineering%2Fbot-sdk-php/lists"}