PHPackages                             intensa/outline-api-client - 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. [API Development](/categories/api)
4. /
5. intensa/outline-api-client

ActiveLibrary[API Development](/categories/api)

intensa/outline-api-client
==========================

A simple API client for OutlineVPN written in PHP

1.0.2(2y ago)187913[3 PRs](https://github.com/intensa/outline-api-client/pulls)MITPHPPHP &gt;=7.4

Since May 11Pushed 1y ago4 watchersCompare

[ Source](https://github.com/intensa/outline-api-client)[ Packagist](https://packagist.org/packages/intensa/outline-api-client)[ RSS](/packages/intensa-outline-api-client/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (3)Dependencies (1)Versions (6)Used By (0)

OutlineVPN API Client
=====================

[](#outlinevpn-api-client)

A simple API client for [OutlineVPN](https://getoutline.org/ru/) written in PHP.

The project implemented a class for working with OutlineVPN api methods and a class for convenient interaction with access keys

Installation
------------

[](#installation)

Install the latest version with

```
$ composer require intensa/outline-api-client
```

Requirements
------------

[](#requirements)

PHP &gt;= 7.4

How to use
----------

[](#how-to-use)

### Usage API Client

[](#usage-api-client)

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

use OutlineApiClient\OutlineApiClient;

try {

    // Your Outline server address
    $serverUrl = 'https://127.0.0.1:3333/YZwl3D1r-B6cNYzQ';

    $api = new OutlineApiClient($serverUrl);

    // Get an array of all server keys
    $keysList = $api->getKeys();

    // Create new key
    $key = $api->create();

    // Rename exist key.
    // Passing key id and new name
    $api->setName($key['id'], 'New key name');

    // Set transfer data limit for key.
    // Passing key id and limit in bytes.
    // In the example set 5MB
    $api->setLimit($key['id'], 5 * 1024 * 1024);

    // Remove key limit
    // Passing key id
    $api->deleteLimit($key['id']);

    // Delete key
    $api->delete($key['id']);

    // Get an array of used traffic for all keys
    $transferData = $api->metricsTransfer();
} catch (\Exception $e) {
    // Handle exception
}
```

### Usage OutlineVPN key wrapper

[](#usage-outlinevpn-key-wrapper)

Interaction with an existing key

```
