PHPackages                             one2joe/line-notify-sdk-php-no-ssl - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. one2joe/line-notify-sdk-php-no-ssl

ActiveLibrary

one2joe/line-notify-sdk-php-no-ssl
==================================

LINE Notify SDK for PHP

052PHP

Since Sep 30Pushed 3y ago1 watchersCompare

[ Source](https://github.com/one2joe/line-notify-sdk-php-no-ssl)[ Packagist](https://packagist.org/packages/one2joe/line-notify-sdk-php-no-ssl)[ RSS](/packages/one2joe-line-notify-sdk-php-no-ssl/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

 [ ![](https://camo.githubusercontent.com/bba3f66a666eaa2046a391abbdc5351052e0548296a1dd1cf268fd77f68a795d/68747470733a2f2f75706c6f61642e77696b696d656469612e6f72672f77696b6970656469612f636f6d6d6f6e732f7468756d622f342f34312f4c494e455f6c6f676f2e7376672f32323070782d4c494e455f6c6f676f2e7376672e706e67) ](https://pay.line.me/)

LINE Notify SDK *for* PHP
=========================

[](#line-notify-sdk-for-php)

LINE Notify SDK for PHP

[![Latest Stable Version](https://camo.githubusercontent.com/b3c5c33b9d847161272afba1682ee540665138cae47a86e0e3c8e8d8e9c24691/68747470733a2f2f706f7365722e707567782e6f72672f79696461732f6c696e652d6e6f746966792d73646b2f762f737461626c653f666f726d61743d666c61742d737175617265)](https://packagist.org/packages/yidas/line-notify-sdk)[![License](https://camo.githubusercontent.com/ffc8281642d6038a3e47c4a9893e1a0d06f46fcc878854ef5b04e020f55e526f/68747470733a2f2f706f7365722e707567782e6f72672f79696461732f6c696e652d6e6f746966792d73646b2f6c6963656e73653f666f726d61743d666c61742d737175617265)](https://packagist.org/packages/yidas/line-notify-sdk)

OUTLINE
-------

[](#outline)

- [Demonstration](#demonstration)
- [Requirements](#requirements)
    - [Client for LINE Notify](#client-for-line-notify)
- [Installation](#installation)
- [Usage](#usage)
    - [Auth Client](#auth-client)
        - [getAuthUrl()](#getauthurl)
        - [getAccessToken()](#getaccesstoken)
        - [getCode()](#getcode)
        - [getWebPath()](#getwebpath)
    - [Notify Client](#notify-client)
        - [notify()](#notify)
        - [status()](#status)
        - [revoke()](#revoke)
        - [setAccessTokens()](#setaccesstokens)
        - [addAccessToken()](#addaccesstoken)
        - [getRateLimit()](#getratelimit)
    - [Shared Methods](#shared-methods)
        - [getResponseLogs()](#getresponselogs)
- [Resources](#resources)

---

DEMONSTRATION
-------------

[](#demonstration)

[Sample Codes Site for LINE Notify](https://github.com/yidas/line-notify-sdk-php/tree/master/sample)

As a quick start, use `Auth` client to create an authorize URL with callback redirectUrl for redirection:

```
$lineNotifyAuth = new \yidas\lineNotify\Auth([
    'clientId' => 'i5zOKhJ9hGyRYdCk281wJr',
    'clientSecret' => '************************',
]);

$authUrl = $$lineNotifyAuth->getAuthUrl("http://localhost/redirectUrl.php");
// header("Location: {$authUrl}");
```

Next, use `Auth` client to get accessToken on callback URL (`redirectUrl.php`), then use `Notify` client to send notifications with accessToken:

```
// Get accessToekn by automatically obtaining callback code from query string
$accessToken = $lineNotifyAuth->getAccessToken();

// Send notification with accessToken (Concurrency supported)
$lineNotify = new \yidas\lineNotify\Notify($accessToken);
$result = $lineNotify->notify('Hello!');
```

---

REQUIREMENTS
------------

[](#requirements)

This library requires the following:

- PHP &gt;= 5.4.0
- guzzlehttp/guzzle &gt;= 5.3.1
- [LINE Notify service client](#client-for-line-notify)

### Client for LINE Notify

[](#client-for-line-notify)

Each LINE Notify service require authentication information for integration, as shown below:

- Client ID
- Client Secret

To get a LINE Notify Client:

1. Register a new LINE Notify service from [LINE Notify - Add service](https://notify-bot.line.me/my/services/new) with redirectUrl setting.
2. After registering, get your service's **clientId/clientSecret** from [LINE Notify - Manage registered services (service provider)](https://notify-bot.line.me/my/services/) for integration.

---

INSTALLATION
------------

[](#installation)

Run Composer in your project:

```
composer require yidas/line-notify-sdk ~1.0.0

```

Then you could use SDK class after Composer is loaded on your PHP project:

```
require __DIR__ . '/vendor/autoload.php';

use yidas\lineNotify\Auth;
use yidas\lineNotify\Notify;
```

---

USAGE
-----

[](#usage)

Before using any API methods, first you need to create a Client with configuration, then use the client to access LINE Notify API methods.

### Auth Client

[](#auth-client)

Create a LINE Notify Auth Client with [API Authentication](#client-for-line-notify):

```
$lineNotifyAuth = new \yidas\lineNotify\Auth([
    'clientId' => 'Your LINE Notify service's client ID',
    'clientSecret' => 'Your LINE Notify service's client Secret',
    // 'debug' => true,
    // 'log' => true,
]);
```

##### Parameters

[](#parameters)

- `array $config`:

KeyRequiredTypeDefaultDescriptionclientIdYstringLINE Notify service's client IDclientSecretYstringLINE Notify service's client SecretdebugNbooleanfalseDebug mode: Throw error exception when API request or result failslogNbooleanfalseLog mode: Save all responses to each API request#### getAuthUrl()

[](#getauthurl)

Get LINE Notify OAuth authorize URL

```
public string getAuthUrl(string $redirectUrl=null, string $state='none', string $responseMode=null)
```

*Example:*

```
// Set redirectUrl to `/callback` from the same path of current URL
define('LINE_NOTIFY_REDIRECT_URL', \yidas\lineNotify\Auth::getWebPath() . "/callback");
$authUrl = $lineNotifyAuth->getAuthUrl(LINE_NOTIFY_REDIRECT_URL);
```

#### getAccessToken()

[](#getaccesstoken)

Get AccessToken with redirectUrl and callback's code

```
public string getAccessToken(string $redirectUri=false, string $code=false, boolean $stateForVerify=false)
```

*Example:*

```
$accessToken = $lineNotifyAuth->getAccessToken(LINE_NOTIFY_REDIRECT_URL, $_GET['code'], 'CSRF state for verifying');
```

#### getCode()

[](#getcode)

Get code on callback redirect URL

```
static public string getCode(string $stateForVerify=false)
```

#### getWebPath()

[](#getwebpath)

Get current web URL path

```
static public string getWebPath()
```

### Notify Client

[](#notify-client)

Create a LINE Notify Client with accessToekn setting:

```
$lineNotify = new \yidas\lineNotify\Notify('HkyggKbHymoS*****************sFuVfa0mlcBNPI', [
    // 'debug' => true,
    // 'log' => true,
]);
```

##### Parameters

[](#parameters-1)

- `string|array $accessTokens`: Support single or multiple accessTokens for notification
- `array $config`:

KeyRequiredTypeDefaultDescriptiondebugNbooleanfalseDebug mode: Throw error exception when API request or result failslogNbooleanfalseLog mode: Save all responses to each API request#### notify()

[](#notify)

Send notification concurrently based on accessToken(s)

```
public integer notify(string $message, array $options=[], string|array $accessTokens=false)
```

> Return Values: Number of successful notifications

*Example:*

```
// Send single notification with one accessToken
$lineNotify = new \yidas\lineNotify\Notify('HkyggKbHymoS*****************sFuVfa0mlcBNPI');
$result = $lineNotify->notify('Hello!');

// Send notification for multiple accessTokens concurrently
$lineNotify = new \yidas\lineNotify\Notify(['GymoS****', 'Afa0****']);
$sccessNum = $lineNotify->notify('Hello everyone!');
```

##### Options

[](#options)

OptionTypeDescriptionmessagestring1000 characters maximageThumbnailHTTP/HTTPS URLMaximum size of 240×240px JPEGimageFullsizeHTTP/HTTPS URLMaximum size of 2048×2048px JPEGimageFilestringLocal file pathstickerPackageIdnumberPackage ID. ([Sticker List](https://devdocs.line.me/files/sticker_list.pdf))stickerIdnumberSticker ID.notificationDisabledbooleanDeault is `false`*Example*

```
$lineNotify = new \yidas\lineNotify\Notify(['HkyggKbHymoS*****************sFuVfa0mlcBNPI']);

// Send notification with image URL options
$successNum = $lineNotify->notify(false, [
    'message' => 'Image Notify',
    'imageThumbnail'=>'https://upload.wikimedia.org/wikipedia/commons/thumb/4/41/LINE_logo.svg/220px-LINE_logo.svg.png',
    'imageFullsize'=>'https://upload.wikimedia.org/wikipedia/commons/thumb/4/41/LINE_logo.svg/440px-LINE_logo.svg.png',
    ]);

// Send notification with image upload options
$successNum = $lineNotify->notify(false, [
    'message' => 'Image Notify',
    'imageFile' => '/tmp/filename.png',
    ]);

// Send notification with sticker options
$successNum = $lineNotify->notify(false, [
    'message' => 'Sticker Notify',
    'stickerPackageId' => 1,
    'stickerId' => 100,
    ]);
```

> `imageFile` requires to be a file path of string type

#### status()

[](#status)

Check accessToken connection status

```
public array status(string $accessToken)
```

*Example:*

```
$response = $lineNotify->status('HkyggKbHymoS*****************sFuVfa0mlcBNPI');
$statusCode = $response['status'];
```

#### revoke()

[](#revoke)

Revoke accessToken on the connected service side

```
public  revoke(string $accessToken)
```

*Example:*

```
$result = $lineNotify->revoke('HkyggKbHymoS*****************sFuVfa0mlcBNPI');
```

#### setAccessTokens()

[](#setaccesstokens)

Set AccessTokens for sending notification

```
public self setAccessTokens(array $accessTokens=[])
```

#### addAccessToken()

[](#addaccesstoken)

Add an AccessToken for sending notification

```
public self addAccessToken(string $accessToken)
```

#### getRateLimit()

[](#getratelimit)

Get last response's Rate Limit information

```
public array getRateLimit()
```

### Shared Methods

[](#shared-methods)

#### getResponseLogs()

[](#getresponselogs)

Get response logs when log mode is enabled

```
public array getResponseLogs()
```

---

RESOURCES
---------

[](#resources)

**[LINE Notify (EN)](https://notify-bot.line.me/en/)**

**[LINE Notify API Document (EN)](https://notify-bot.line.me/doc/en/)**

###  Health Score

16

—

LowBetter than 5% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity24

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/ddf7ffa7fce940e627fce839fb804e8991d5bba08495a5c6fac052f5e7402d78?d=identicon)[one2joe](/maintainers/one2joe)

---

Top Contributors

[![cmumad](https://avatars.githubusercontent.com/u/27104830?v=4)](https://github.com/cmumad "cmumad (4 commits)")

### Embed Badge

![Health badge](/badges/one2joe-line-notify-sdk-php-no-ssl/health.svg)

```
[![Health](https://phpackages.com/badges/one2joe-line-notify-sdk-php-no-ssl/health.svg)](https://phpackages.com/packages/one2joe-line-notify-sdk-php-no-ssl)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
