LINE Messaging API SDK for PHP

Webhook

LINE's server sends user actions (messages, images, locations, etc.) to your bot server as webhook events.

Handling webhooks

  1. Receive the webhook request from LINE.
  2. Parse the request body with EventRequestParser .
  3. Handle each event.
use LINE\Parser\EventRequestParser;

$parsedEvents = EventRequestParser::parseEventRequest(
    $body,
    $channelSecret,
    $signature,
);

foreach ($parsedEvents->getEvents() as $event) {
    // Handle event
}

See the example implementations:

Search results