line-bot-sdk-php-tiny

LINEAPI
in package

LINEAPI (Messaging API)

This is the Messaging API for creating LINE Chat BOTs.

Tags
link
https://developers.line.biz/en/reference/messaging-api

Table of Contents

API_DATA_HOST  = "https://api-data.line.me"
The host is used for uploading/downloading objects from LINE API Platform.
API_HOST  = "https://api.line.me"
The host is used for connecting the primary service of LINE API Platform.
HTTP_METHOD_DELETE  = 2
HTTP Delete Method
HTTP_METHOD_GET  = 0
HTTP Get Method
HTTP_METHOD_POST  = 1
HTTP Post Method
$responseDecodeAsArray  : bool
If read the response as array while decoding JSON in `requestFactory`.
$channelAccessToken  : string|null
The value is set for authorizing while the API connecting LINE API Platform.
$channelSecret  : string|null
The value is set for verifying signatures that whether the requests were sent from the LINE API Platform.
__construct()  : mixed
LINEAPI constructor.
broadcast()  : object
Send broadcast message.
confirmingAudienceGroupStatus()  : object
Confirming that an audience is ready to accept messages.
createRichMenu()  : object
Create rich menu.
deleteRichMenu()  : object
Delete rich menu.
downloadMessageObject()  : bool
Save file of the message from the function `getMessageObject`.
downloadRichMenuImage()  : bool
Save image of the rich menu from the function `getRichMenuImage`.
getAllMessagesSentCount()  : object
Get number of messages sent this month.
getBroadcastMessagesSentCount()  : object
Get number of sent broadcast messages.
getFollowersCount()  : object
Get number of followers.
getFollowersIds()  : object
Get the user ID of all users who added your LINE Official Accout as a friend.
getFriendDemographics()  : object
Get friend demographics.
getGroup()  : object
Get group summary.
getGroupMemberCount()  : object
Get number of users in a group.
getGroupMemberIds()  : object
Get group member user IDs.
getGroupMemberInfo()  : object
Get group member profile.
getMessageDeliveriesCount()  : object
Get number of message deliveries.
getMessageObject()  : string|null
Download content of the message. (Get the raw data only)
getMulticastMessagesSentCount()  : object
Get number of sent multicast messages.
getProfile()  : object
Get profile.
getPushMessagesSentCount()  : object
Get number of sent push messages.
getReplyMessagesSentCount()  : object
Get number of sent reply messages.
getRichMenu()  : object
Get rich menu.
getRichMenuIdOfUser()  : object
Get rich menu ID of user.
getRichMenuImage()  : string|null
Download rich menu image. (Get the raw data only)
getRichMenuList()  : object
Get rich menu list.
getRoomMemberCount()  : object
Get number of users in a room.
getRoomMemberIds()  : object
Get room member profile.
getRoomMemberInfo()  : object
Get room member user IDs.
getSendMessagesQuota()  : object
Get the target limit for additional messages.
getUserInteractionStatistics()  : object
Get user interaction statistics.
issueChannelAccessToken()  : object
Issue channel access token.
issueUserLinkToken()  : object
Issue link token.
leaveGroup()  : object
Leave group.
leaveRoom()  : object
Leave room.
linkRichMenuToUser()  : object
Link rich menu to user.
multicast()  : object
Send multicast message.
parseEvents()  : array<string|int, mixed>
Verify the request which visits this API, if it's from LINE Webhook, parse the events.
pushMessage()  : object
Send push message.
replyMessage()  : object
Send reply message.
revokeChannelAccessToken()  : bool
Revoke channel access token.
unlinkRichMenuFromUser()  : object
Unlink rich menu from user.
uploadRichMenuImage()  : void
Upload rich menu image. (libcURL used)
requestFactory()  : mixed
Send request to LINE API Platform.
sign()  : string
Signing data via SHA-256.

Constants

API_DATA_HOST

The host is used for uploading/downloading objects from LINE API Platform.

public string API_DATA_HOST = "https://api-data.line.me"

API_HOST

API_HOST

The host is used for connecting the primary service of LINE API Platform.

public string API_HOST = "https://api.line.me"

API_HOST

HTTP_METHOD_DELETE

HTTP Delete Method

public int HTTP_METHOD_DELETE = 2

The constant is used for requestFactory to set the HTTP Method while transporting.

HTTP_METHOD_DELETE

HTTP_METHOD_GET

HTTP Get Method

public int HTTP_METHOD_GET = 0

The constant is used for requestFactory to set the HTTP Method while transporting.

HTTP_METHOD_GET

HTTP_METHOD_POST

HTTP Post Method

public int HTTP_METHOD_POST = 1

The constant is used for requestFactory to set the HTTP Method while transporting.

HTTP_METHOD_POST

Properties

$responseDecodeAsArray

If read the response as array while decoding JSON in `requestFactory`.

public bool $responseDecodeAsArray = alse

The default is exporting as Object, set value to true that it will use Array.

Methods

__construct()

LINEAPI constructor.

public __construct( $channelAccessToken,  $channelSecret) : mixed

This is the constructor of API, to initialize your certificates into it. If you need to use issueChannelAccessToken, you can set both of them as null, issueChannelAccessToken will setup the values automatically.

Parameters
$channelAccessToken :
$channelSecret :
Return values
mixed

downloadMessageObject()

Save file of the message from the function `getMessageObject`.

public downloadMessageObject(string $messageId[, string $path = "./" ]) : bool
Parameters
$messageId : string
$path : string = "./"

(optional)

Return values
bool

If it success, will return true.

downloadRichMenuImage()

Save image of the rich menu from the function `getRichMenuImage`.

public downloadRichMenuImage(string $richMenuId[, string $path = "./" ]) : bool
Parameters
$richMenuId : string
$path : string = "./"

(optional)

Return values
bool

If it success, will return true.

multicast()

Send multicast message.

public multicast(array<string|int, mixed> $targetIds, array<string|int, mixed> $message[, bool $notificationDisabled = false ]) : object
Parameters
$targetIds : array<string|int, mixed>
$message : array<string|int, mixed>
$notificationDisabled : bool = false

(optional)

Tags
link
https://developers.line.biz/en/reference/messaging-api/#send-multicast-message
Return values
object

parseEvents()

Verify the request which visits this API, if it's from LINE Webhook, parse the events.

public parseEvents() : array<string|int, mixed>
Return values
array<string|int, mixed>

requestFactory()

Send request to LINE API Platform.

private requestFactory(string $targetUri, int $method[, mixed $data = array() ][, bool $decode = true ]) : mixed
Parameters
$targetUri : string

An URL for sending request.

$method : int

HTTP Method.

$data : mixed = array()

Content for doing POST. (optional)

$decode : bool = true

Decode the response from JSON. (optional)

Return values
mixed

sign()

Signing data via SHA-256.

private sign(mixed $body) : string
Parameters
$body : mixed
Return values
string

Search results