line/line-bot-sdk-php là dự án PHP với 730 sao trong nhóm Automation. LINE Messaging API SDK for PHP
Tóm tắt dựng từ metadata GitHub của chính dự án — chưa có bài review TopGit. Trang sẽ tự động cập nhật khi bài review đầy đủ được xuất bản.
VÌ SAO CHƯA CÓ REVIEW
TopGit viết bài đầy đủ cho repo có nhiều sao nhất và được yêu cầu nhiều nhất. Trang này là snapshot trong thời gian chờ — xem README gốc ở tab READ ME.
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.
line/line-bot-sdk-php thuộc nhóm Automation trên TopGit, cùng 5 topic GitHub. Trang Trending và Topics liệt kê các repo cùng số sao và cùng ngôn ngữ để so sánh.
Đọc thêm về line/line-bot-sdk-php ở đâu?
Trang TopGit này là một snapshot — tab "Readme" hiển thị nguyên văn README của repo (đã bỏ link, giữ ảnh). Repo GitHub ở github.com/line/line-bot-sdk-php là nguồn chính thức.
line/line-bot-sdk-php có bao nhiêu sao?
line/line-bot-sdk-php có 730 sao GitHub — tải lại trang để xem số mới nhất, hoặc xem trực tiếp github.com/line/line-bot-sdk-php. TopGit phản chiếu số sao của GitHub nhưng không cam kết đến từng phút.
line/line-bot-sdk-php có phải mã nguồn mở không?
Có — line/line-bot-sdk-php phát hành theo license Apache-2.0, nghĩa là mã nguồn mở để đọc, fork và (tùy license) tái sử dụng. Mã: github.com/line/line-bot-sdk-php.
line/line-bot-sdk-php còn đang phát triển không?
Commit gần nhất trên line/line-bot-sdk-php là 5 ngày trước (theo timestamp GitHub). Repo có 640 fork — một chỉ báo về mức độ quan tâm của cộng đồng.
line/line-bot-sdk-php dùng license gì?
line/line-bot-sdk-php phát hành theo license Apache-2.0. Nên mở file LICENSE trên GitHub để xác nhận — license metadata đôi khi lệch với thực tế dự án.
line/line-bot-sdk-php là gì?
line/line-bot-sdk-php (line/line-bot-sdk-php) là dự án PHP trên GitHub. Theo mô tả gốc: LINE Messaging API SDK for PHP
line/line-bot-sdk-php viết bằng ngôn ngữ gì?
line/line-bot-sdk-php chủ yếu viết bằng PHP. Trường "language" của GitHub dựa trên phần lớn byte ở nhánh mặc định.
Đọc đầy đủ README ở tab phía trên.
Muốn nghe thêm một ý kiến về line-bot-sdk-php?
Hỏi một AI đọc được trang này — một cú bấm là có ngay nhận định về line-bot-sdk-php.