PHPackages                             signes/vbulletin-api-php - 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. signes/vbulletin-api-php

AbandonedLibrary[API Development](/categories/api)

signes/vbulletin-api-php
========================

This package gives you possibility to easy integrate your system with vBulletin 5 API using simple methods calls.

v1.0.0(9y ago)145.5k6[1 issues](https://github.com/pgrzesiecki/vbulletin-api-php/issues)MITPHPPHP &gt;=5.5.9

Since Apr 18Pushed 9y ago7 watchersCompare

[ Source](https://github.com/pgrzesiecki/vbulletin-api-php)[ Packagist](https://packagist.org/packages/signes/vbulletin-api-php)[ Docs](https://github.com/signes-pl/vbulletin-api-php)[ RSS](/packages/signes-vbulletin-api-php/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (2)Dependencies (5)Versions (3)Used By (0)

vBulletin 5 API connector
=========================

[](#vbulletin-5-api-connector)

[![Latest Stable Version](https://camo.githubusercontent.com/8a70a36600d9239e3838f13fca85a49eb7beebd3579117ed5bd1607e5f352d93/68747470733a2f2f706f7365722e707567782e6f72672f7369676e65732f7662756c6c6574696e2d6170692d7068702f762f737461626c65)](https://packagist.org/packages/signes/vbulletin-api-php)[![Build Status](https://camo.githubusercontent.com/512f2b1f7707c203795fa411ab60cbf97387e4e7a6ad8c9e1201d0d44eea0144/68747470733a2f2f7472617669732d63692e6f72672f7369676e65732d706c2f7662756c6c6574696e2d6170692d7068702e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/signes-pl/vbulletin-api-php)[![Circle CI](https://camo.githubusercontent.com/09cd2b433f43e05a4d9a1c876e043cf06e3b4aff97459b80bbb8746fecd1a1bd/68747470733a2f2f636972636c6563692e636f6d2f67682f7369676e65732d706c2f7662756c6c6574696e2d6170692d7068702e7376673f7374796c653d737667)](https://circleci.com/gh/signes-pl/vbulletin-api-php)[![codecov.io](https://camo.githubusercontent.com/e0aba213648e4cf59ea946e5f66982d39aaf7fe905c00ef53cd0515f5037aadb/68747470733a2f2f636f6465636f762e696f2f6769746875622f7369676e65732d706c2f7662756c6c6574696e2d6170692d7068702f636f7665726167652e7376673f6272616e63683d6d6173746572)](https://codecov.io/github/signes-pl/vbulletin-api-php?branch=master)[![License](https://camo.githubusercontent.com/f6f127ff390df465c638a8eeb6c2c475d95018bd216b5fe0dc224f2ad0cb6d51/68747470733a2f2f706f7365722e707567782e6f72672f7369676e65732f61636c2f6c6963656e7365)](https://packagist.org/packages/signes/vbulletin-api-php)

1. [What is this?](#what-is-this)
2. [Basic usage](#basic-usage)
3. [Contexts](#contexts)
    - [Available contexts](#available-contexts)
4. [API service](#api-service)
    - [Lazy connection](#lazy-connection)
    - [Remember configuration and connection](#remember-configuration-and-connection)

What is this?
-------------

[](#what-is-this)

This package gives you possibility to easy integrate your system with vBulletin 5 API using simple methods calls.

Tested with vB **5.2**

Basic usage
-----------

[](#basic-usage)

```
    use Signes\vBApi\Api;
    use Signes\vBApi\ApiConfig;
    use Signes\vBApi\Connector\Provider\GuzzleProvider;

    $apiConfig = new ApiConfig($apiKey, $uniqueId, $clientName, $clientVersion, $platformName, $platformVersion);
    $apiConnector = new GuzzleProvider('http://example.com/my-forum/');

    $api = new Api($apiConfig, $apiConnector);

    $response = $api->callRequest('user.fetchByEmail', ['email' => 'test@example.com']);
```

1. First of all create your API configuration file which should include information's like:

    - **vBulletin API key** - you can find it in vBulletin control panel, under API section. |
    - **Unique ID** - Unique id is used to identity your client and platform name, it can be any unique string. Be careful, if you will change unique ID your request will be recognized as request from new API client and new API client ID will be returned. |
    - **Client name** - Your client name.
    - **Client version** - Your client version.
    - **Platform name** - Your platform name.
    - **Platform version** - Your platform version.

    ```
    use Signes\vBApi\ApiConfig;
    $apiConfig = new ApiConfig($apiKey, $uniqueId, $clientName, $clientVersion, $platformName, $platformVersion);
    ```
2. When configuration object is ready, next step is to initiate connection provider. This provider is responsible for communication between your application and vB forum.

    By default you can use included **Guzzle** provider but before you will do this, you should require **guzzlehttp/guzzle** package in composer. Guzzle provider required forum URL in constructor with trailing slash.

    ```
    use Signes\vBApi\Connector\Provider\GuzzleProvider;
    $apiConnector = new GuzzleProvider('http://example.com/my-forum/');
    ```

    If this is not good enough, you can provide own connection class, just implement `Signes\vBApi\Connector\ConnectorInterface` interface.
3. After that you are ready to prepare API service, which required `Signes\vBApi\ApiConfig` and `Signes\vBApi\Connector\ConnectorInterface` objects.

    ```
    use Signes\vBApi\Api;
    $api = new Api($apiConfig, $apiConnector);
    ```
4. When API service is initialized, you can call any API resource.

    ```
    $response = $api->callRequest('user.fetchByEmail', ['email' => 'test@example.com']);
    $response = $api->callRequest('site.getSiteStatistics', []);
    ```

Contexts
--------

[](#contexts)

Contexts gives you possibility to encapsulation logic into single class. Under the hood contexts also uses raw vB API requests.
Every context must extend `Signes\vBApi\Context\Context` class and can required different parameters in constructor.

Example code:

```
    use Signes\vBApi\Api;
    use Signes\vBApi\ApiConfig;
    use Signes\vBApi\Connector\Provider\GuzzleProvider;
    use Signes\vBApi\Context\User\FetchCurrentUserInfo;
    use Signes\vBApi\Context\User\Login;

    $apiConfig = new ApiConfig($apiKey, $uniqueId, $clientName, $clientVersion, $platformName, $platformVersion);
    $apiConnector = new GuzzleProvider('http://example.com/my-forum/');
    $api = new Api($apiConfig, $apiConnector);

    $currentLoggedInUserContext = new FetchCurrentUserInfo();
    $loginUserContext = new Login('adminUsername', 'adminPassword');

    $meFirst = $api->callContextRequest($currentLoggedInUserContext);
    $api->callContextRequest($loginUserContext);
    $meSecond = $api->callContextRequest($currentLoggedInUserContext);

    echo $meFirst['username'] // "Guest"
    echo $meSecond['username'] // "adminUsername"
```

Context should handle information about request method type, API request type and should return all required parameters by vB for given request.
For your custom context you can also overwrite `parseResponse` method to return expected format, not raw vB API response.

### Available contexts

[](#available-contexts)

- User

    - Register
    - Login
    - Fetch current logged in user data
    - Fetch user data by email
- more contexts soon ...

API service
-----------

[](#api-service)

What do API service for you:

- send `init` request to retrieve access token, secret, api version and client id for future requests,
- remember your identity (when you send valid login request, every future requests will be called as this logged in user),
- prepare signature for every request and include every required by vBulletin parameters,

If you want to integrate with multiple vBulletin instances, you can use API service as a registry. If instance is not remembered `null` will be returned.

```
use Signes\vBApi\Api;
(new Api($apiConfig, $apiConnector))->rememberInstance('myInstanceName');
(new Api($apiConfigSecond, $apiConnectorSecond))->rememberInstance('myOtherInstance');

$firstInstance = Api::getInstance('myInstanceName');
$secondInstance = Api::getInstance('myOtherInstance');
```

### Lazy connection

[](#lazy-connection)

API service constructor has third parameter `$lazy` with default **true** value. This parameter determine moment of `init` request.

If it is set to **true** `init` request will be send during the first `callRequest` method call. So if you provided incorrect configuration you will learn about it until now.

If it is set to **false** `init` request will be send when API service instance is created

### Remember configuration and connection

[](#remember-configuration-and-connection)

It is possible to keep information about `ApiConfig` between PHP requests and it is strongly recommend to do that on production. To do that you can use any of your cache services. Just store `ApiConfig` in cache, and for future use it instance.

That gives you one more benefit, when you login on user account, this information will be remembered in `ApiConfig` and you do not have to call login request for some period of time (depends of your cache expiration).

Credits
-------

[](#credits)

Pawel Grzesiecki - Developer () [MIT](https://opensource.org/licenses/MIT) License

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity27

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 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.

###  Release Activity

Cadence

Every ~152 days

Total

2

Last Release

3526d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/2e1f94544dcdcea9d677139b9b3a228b82f8ea4e1ac0ebf578aa4de727ca967f?d=identicon)[Grzesiecki](/maintainers/Grzesiecki)

---

Top Contributors

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

---

Tags

apivbulletin

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/signes-vbulletin-api-php/health.svg)

```
[![Health](https://phpackages.com/badges/signes-vbulletin-api-php/health.svg)](https://phpackages.com/packages/signes-vbulletin-api-php)
```

###  Alternatives

[m165437/laravel-blueprint-docs

API Blueprint Renderer for Laravel

22779.0k](/packages/m165437-laravel-blueprint-docs)[taluu/behapi

Test your remote api locally through Behat

3212.6k](/packages/taluu-behapi)

PHPackages © 2026

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