PHPackages                             opensmarty/rest-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. [HTTP &amp; Networking](/categories/http)
4. /
5. opensmarty/rest-api-client

ActiveLibrary[HTTP &amp; Networking](/categories/http)

opensmarty/rest-api-client
==========================

An elegant and smart Rest API Client with OAuth2 authentication support. Build for Laravel and Opensmarty Starter.

v1.0.1(8y ago)051MITPHPPHP &gt;=5.3.0

Since Dec 4Pushed 8y ago1 watchersCompare

[ Source](https://github.com/opensmarty/rest-api-client)[ Packagist](https://packagist.org/packages/opensmarty/rest-api-client)[ Docs](https://github.com/opensmarty/rest-api-client)[ RSS](/packages/opensmarty-rest-api-client/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (2)Dependencies (3)Versions (3)Used By (1)

Opensmarty Rest API Client
==========================

[](#opensmarty-rest-api-client)

[![Latest Version](https://camo.githubusercontent.com/f1cb59752e636329e3cf4be919c2c9c7d4f8b719c90decd1305bc02e9859d700/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f6f70656e736d617274792f726573742d6170692d636c69656e742e7376673f7374796c653d666c61742d737175617265)](https://github.com/opensmarty/rest-api-client/releases)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Total Downloads](https://camo.githubusercontent.com/1768b750a29766ea2018e5e25645201ea8736b7e3735491690ea3bec1c4fd377/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6f70656e736d617274792f726573742d6170692d636c69656e742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/opensmarty/rest-api-client)

Opensmarty Starter API Client is an elegant and smart Rest API Client with OAuth2 authentication support.

Build for Laravel and [Opensmarty Starter](https://opensmarty.github.io).

It can be used for accessing APIs created using [Opensmarty Starter](https://opensmarty.github.io) framework.

Install
-------

[](#install)

### Via Composer

[](#via-composer)

Install composer package to your laravel project

```
composer require opensmarty/rest-api-client
```

Add Service Provider to `config/app.php`

```
    'providers' => [
        ...
        Opensmarty\Rest\RestClientServiceProvider::class,
        ...
    ],
```

Publishing config file.

```
php artisan vendor:publish
```

After published, config file for Rest Client is `config/rest-client.php`, you will need to config it to use Rest Client.

Usage
-----

[](#usage)

```
$restClient = new \Opensmarty\Rest\RestClient('Opensmarty-starter');

$restClient->setOAuthUserCredentials([
    'username' => 'opensmarty@163.com',
    'password' => 'Abc12345',
]);
$restClient->withOAuthTokenTypeUser();

$response = $restClient->get("users")->getResponse();
if (!$restClient->isResponseStatusCode(200)) {
    $restClient->printResponseOriginContent();
    $responseMessage = $restClient->getResponseMessage();
    print_r($responseMessage);
} else {
    $responseData = $restClient->getResponseData();
    print_r($responseData);
}
```

Testing
-------

[](#testing)

```
phpunit
```

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](https://github.com/opensmarty/rest-api-client/blob/master/CONTRIBUTING.md) for details.

Credits
-------

[](#credits)

- [Opensmarty](https://github.com/opensmarty)
- [All Contributors](https://github.com/opensmarty/rest-api-client/contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community9

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 ~2 days

Total

2

Last Release

3081d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/4230463?v=4)[opensmarty](/maintainers/opensmarty)[@opensmarty](https://github.com/opensmarty)

---

Top Contributors

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

---

Tags

apiclientlaravelrestoauth2opensmarty-starter

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/opensmarty-rest-api-client/health.svg)

```
[![Health](https://phpackages.com/badges/opensmarty-rest-api-client/health.svg)](https://phpackages.com/packages/opensmarty-rest-api-client)
```

###  Alternatives

[zoonman/linkedin-api-php-client

LinkedIn API PHP SDK with OAuth 2.0 &amp; CSRF support. Can be used for social sign in or sharing on LinkedIn. Examples. Documentation.

127704.0k](/packages/zoonman-linkedin-api-php-client)[cybercog/youtrack-rest-php

YouTrack REST API PHP Client.

37149.2k3](/packages/cybercog-youtrack-rest-php)[laragear/api-manager

Manage multiple REST servers to make requests in few lines and fluently.

161.8k](/packages/laragear-api-manager)

PHPackages © 2026

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