RPC

Advanced interaction with the Plugin API using jsonRPC

Our API design follows a RESTful architecture. In some cases, you may be unable to create a proper request due to limitations of the game or framework you are working with.

To work around this, you may use an implementation of jsonRPC (remote procedure call) to interact with the Plugin API.

Send a POST to the /rpc endpoint with information about the API request you want to make. It will be rebuilt into a RESTful request, forwarded to the plugin API, and the associated response will be returned to you.

You must include a forward slash at the end of the URL when using RPC.

  • Correct: https://plugin.tebex.io/rpc/

  • Incorrect: https://plugin.tebex.io/rpc

Below is an example request to get a store's information via RPC.

{
    "method": "GET",
    "params": {
        "SecretKey": "your-secret-key-here",
        "Path": "/information"
    }
}

Here is an example of a POST request using RPC.

{
    "method": "POST",
    "params": {
        "SecretKey": "your-secret-key-here",
        "Path": "/checkout",
        "Body": {
            "package_id": "12345",
            "username": "foo"
        }
    }
}

Make an RPC request

POST https://plugin.tebex.io/rpc/

Request Body

NameTypeDescription

method*

String

HTTP verb to use for the request (GET, POST, PUT, DELETE)

params*

Object

Object describing the request to be made

params.SecretKey*

String

Your store's secret key.

params.Path*

String

Your desired endpoint on the Plugin API

params.Body

Object

JSON body to send to Plugin API

See relevant Endpoint for specific response information.

Last updated