line/line-bot-sdk-php is a Automation project on GitHub, written primarily in PHP. It has 730 stars. LINE Messaging API SDK for PHP
Snapshot summary built from the project's own GitHub metadata — there's no written TopGit review yet. The page will update automatically when a full review is published.
WHY NO REVIEW YET
TopGit writes full reviews for the most-starred, most-requested repositories. This page is a snapshot until then — see the READ ME tab for the original README in full.
How to get x-line-request-id header and error message
You may need to store the x-line-request-id header obtained as a response from several APIs. In this case, please use ~WithHttpInfo functions. You can get headers and status codes. The x-line-accepted-request-id or content-type header can also be obtained in the same way.
$request = new ReplyMessageRequest([
'replyToken' => $replyToken,
'messages' => [$textMessage = (new TextMessage(['text' => 'reply with http info']))],
]);
$response = $messagingApi->replyMessageWithHttpInfo($request);
$this->logger->info('body:' . $response[0]);
$this->logger->info('http status code:' . $response[1]);
$this->logger->info('headers(x-line-request-id):' . $response[2]['x-line-request-id'][0]);
You can get error messages from \LINE\Clients\MessagingApi\ApiException when you use MessagingApiApi. Each client defines its own exception class.
When you need to get x-line-accepted-request-id header from error response, you can get it: $headers['x-line-accepted-request-id'][0].
Components
Webhook
LINE's server sends user actions (such as a message, image, or location) to your bot server.
Request of that contains event(s); event is action of the user.
The following shows how the webhook is handled:
Receive webhook from LINE's server.
Parse request payload by EventRequestParser#parseEventRequest($body, $channelSecret, $signature).
Iterate parsed events and some react as you like.
The following examples show how webhooks are handled:
EchoBot: Route.php
KitchenSink: Route.php
More information
For more information, see the official API documents and PHPDoc.
If it's your first time using this library, we recommend taking a look at examples and the PHPDoc of \LINE .
Hints
Examples
This repository contains two examples of how to use the LINE Messaging API.
EchoBot
A simple sample implementation. This application reacts to text messages that are sent from users.
KitchenSink
A full-stack (and slightly complex) sample implementation. This application demonstrates a practical use of the LINE Messaging API.
PHPDoc
https://line.github.io/line-bot-sdk-php/
This library provides PHPDoc to describe how to use the methods. You can generate the documentation locally:
composer docs
php -S 127.0.0.1:8000 -t build/site
Official API documentation
Official API documents shows the detail of Messaging API and fundamental usage of SDK.
See also
Laravel Support
Easy to use from Laravel.
After installed, add LINE_BOT_CHANNEL_ACCESS_TOKEN to .env
However, if a feature that was publicly released is discontinued for business reasons and becomes completely unusable, we will release changes as a patch release.
Contributing
Please check CONTRIBUTING before making a contribution.
For hacking instructions, please refer HACKING.md.
License
Copyright 2016 LINE Corporation
Licensed under the Apache License, version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
How active is development on line/line-bot-sdk-php?
The most recent commit recorded on line/line-bot-sdk-php was 6 days ago, based on the GitHub push timestamp. The repository has 640 forks — one of the better signals of community interest.
How many stars does line/line-bot-sdk-php have?
line/line-bot-sdk-php has 730 GitHub stars — refresh the page for the live number, or check github.com/line/line-bot-sdk-php. TopGit mirrors GitHub's count but does not claim minute-by-minute accuracy.
Is line/line-bot-sdk-php open source?
Yes — line/line-bot-sdk-php ships under the Apache-2.0 license, which makes its source code freely readable (and, depending on license terms, forkable and reusable). Source: github.com/line/line-bot-sdk-php.
What else is in the Automation space?
line/line-bot-sdk-php is tracked by TopGit under the Automation category, alongside 5 GitHub-tagged topics. Trending and Topics pages list peer repositories of comparable stars and language.
What is line/line-bot-sdk-php?
line/line-bot-sdk-php (line/line-bot-sdk-php) is a PHP project on GitHub. From the project's own README: LINE Messaging API SDK for PHP
What language is line/line-bot-sdk-php written in?
line/line-bot-sdk-php is written primarily in PHP. GitHub's language field is based on the largest share of bytes in the default branch.
What license does line/line-bot-sdk-php use?
line/line-bot-sdk-php is released under the Apache-2.0 license. Always verify the LICENSE file directly on GitHub for the authoritative terms — license strings can be edited out of sync with a project's actual stance.
Where do I read more about line/line-bot-sdk-php?
This TopGit page is a snapshot — the READ ME tab shows the project's own README content (links stripped, images preserved). The GitHub repository at github.com/line/line-bot-sdk-php is the definitive source.
Read full README in the tab above.
Want a second opinion on line-bot-sdk-php?
Ask an AI that can read this page — one click and you get its take on line-bot-sdk-php.