PHPackages                             moaction/jsonrpc-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. moaction/jsonrpc-client

ActiveLibrary[API Development](/categories/api)

moaction/jsonrpc-client
=======================

Jsonrpc client php implementation

v1.4(12y ago)020511MITPHPPHP &gt;=5.3.3

Since Dec 4Pushed 12y ago1 watchersCompare

[ Source](https://github.com/moaction/jsonrpc-client)[ Packagist](https://packagist.org/packages/moaction/jsonrpc-client)[ RSS](/packages/moaction-jsonrpc-client/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependencies (2)Versions (5)Used By (1)

Jsonrpc-client
==============

[](#jsonrpc-client)

JSON-Rpc 2.0 protocol implementation

Installing
==========

[](#installing)

Add to yours composer.json require section:

```
"moaction/jsonrpc-client": "1.*"

```

Usage
=====

[](#usage)

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

[](#basic-usage)

```
$client = new \Moaction\Jsonrpc\Client\ClientBasic('http://mys-server.org/jsonrpc/url');

$request = new \Moaction\Jsonrpc\Common\Request();
$request->setMethod('getUser');
$request->setParams(array('id' => 1));
// You have to set request id whenever you want to recieve response data. See `Notification request`
$request->setId(1);

$response = $client->call($request);
// $response now contains a \Moaction\Jsonrpc\Common\Response object
```

Notification request
--------------------

[](#notification-request)

Notification is a request without id. According to specification server must not reply on a request without id:

> When a rpc call is made, the Server MUST reply with a Response, except for in the case of Notifications.

```
$request = new \Moaction\Jsonrpc\Common\Request();
$request->setMethod('commentAdded');
$request->setParams(array(
    'userId' => 45,
    'commentId' => 471,
));

$client->call($request);
```

Batch request
-------------

[](#batch-request)

```
 // first request
 $request1 = new \Moaction\Jsonrpc\Common\Request();
 $request1->setMethod('getUserInfo');
 $request1->setParams(array('id' => 1));
 $request1->setId(3);

 // second request
 $request2 = new \Moaction\Jsonrpc\Common\Request();
 $request2->setMethod('getUserComments');
 $request2->setParams(array('id' => 1));
 $request2->setId(7);

 // notification
 $request3 = new \Moaction\Jsonrpc\Common\Request();
 $request3->setMethod('loginSucceeded');
 $request3->setParams(array('id' => 1));

 $responses = $client->batch(array($request2, $request2, $request2));

 // now $responses contains array of request objects. Array keys are requests' ids.
 // array(
 //     3 => Request object,
 //     7 => Request object,
 // )
```

###  Health Score

28

—

LowBetter than 52% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity61

Established project with proven stability

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

Total

4

Last Release

4591d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/443011?v=4)[Alexey Ostin](/maintainers/nitso)[@nitso](https://github.com/nitso)

---

Top Contributors

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

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/moaction-jsonrpc-client/health.svg)

```
[![Health](https://phpackages.com/badges/moaction-jsonrpc-client/health.svg)](https://phpackages.com/packages/moaction-jsonrpc-client)
```

###  Alternatives

[exsyst/swagger

A php library to manipulate Swagger specifications

35916.4M7](/packages/exsyst-swagger)[hubspot/api-client

Hubspot API client

24016.2M18](/packages/hubspot-api-client)[pocketmine/bedrock-protocol

An implementation of the Minecraft: Bedrock Edition protocol in PHP

172437.8k11](/packages/pocketmine-bedrock-protocol)[botman/driver-telegram

Telegram driver for BotMan

93459.5k6](/packages/botman-driver-telegram)

PHPackages © 2026

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