{ JSON-RPC } The simplest way to create APIs

Because the protocol was originally designed to be simple and easy to use!

                            
                            

Sajya is the most popular open-source package for Laravel that makes it easy to implement the JSON-RPC 2.0 server specification including validation of parameters, support for batch and notification requests, and more.

Easy to use

Request and response format is unified and easy to use, allowing even beginners to work. Use any transport you prefer, including HTTP, WebSocket, Server Sent Events, or others.

Learn more about Specification.

{
    "jsonrpc": "2.0",
    "method": "subtract",
    "params": {
      "subtrahend": 23,
      "minuend": 42
    },
    "id": 3
}
--> Request
{
    "jsonrpc": "2.0",
    "result": 19,
    "id": 3
}
<-- Response

Batch

Ability to send several requests in one API call. This helps reduce network costs and speed up your application.

Learn more about batch requests.

Notification

Send requests that do not need to be answered. Customers won't have to wait for the request to actually be fulfilled.

Learn more about notifications requests.

Agnostic of the client-side technology.

Web

Build the API to your React, Vue.js and Angular web apps.

Mobile

Communication from your native Android and iOS apps.

IoT

Something electronic on Rust, Go, C, Java? No problem at all.

declare(strict_types=1);

namespace App\Http\Procedures;

use App\Models\User;
use Sajya\Server\Procedure;

class UserProcedure extends Procedure
{
    public function update(User $user)
    {
        // ...
    }
}

Binding

Bind values of query parameters to various objects such as Eloquent models, Enums and others, which allows you to work with data in your project quickly and conveniently.

Learn more about Binding.

Validation

Automatically validates incoming requests to ensure they meet your specifications. You can also customize the error messages that are returned if the validation fails.

Learn more about request validation.

Tests

Add tests with ease using our developer friendly API testing tool.

Learn more about testing.