# ReadyGamer API

{% hint style="info" %}
Please reach out if you would like a specific endpoint created for you to start here > [ReadyGamer API Access Request](https://forms.gle/YYsfsQLijnXJ23sdA)
{% endhint %}

### Direct ReadyGamer API Access (Existing Virtuals Agent)&#x20;

{% hint style="info" %}
The following sections is if you have an existing Virtuals agent that you want to deploy in your game!&#x20;
{% endhint %}

Your game should do an HTTPS Post request to the endpoint that we will provide you in order to send the chat data. The URL that we will create for you will be in this format:

{% code overflow="wrap" %}

```
https://api.ready-gamer.sovrun.org/api/<name_of_game>/<command>/chat
```

{% endcode %}

For example:&#x20;

{% code overflow="wrap" %}

```
https://api.ready-gamer.sovrun.org/api/roblox/lightsout/chat
```

{% endcode %}

Method: POST

Headers: X-API-Key (Will be provided by Ready Gamer team separately)

### Default template for POST Request <a href="#default-template-for-post-request" id="default-template-for-post-request"></a>

\
Below is the list of the default parameters for a basic chat integration to the Ready Gamer API. In case your game needs to send additional data i.e. environment data, please contact us so we can tailor fit the endpoint for you.

<pre><code><strong>{
</strong> "text": "how are you doing?",
 "userId": "123abc",
 "userName": "john",
 "agentName": "test_ready_gamer_agent",
 "agentId": "8",
}
</code></pre>

* **text** is the chat message coming from the user inside the game
* **userId** is the user id of the player who's currently chatting with the agent npc..
* **userName** is the name of the player who's currently chatting with the agent npc.
* **agentName** is the name of the agent. This should be a unique value per specific agent. We will use this value to delegate the message to the corresponding agent.
  * For testing purposes, please use *"test\_ready\_gamer\_agent"* as the agentName value.
* **agentId** is the id of the agent relevant to the game. We added this to the template so that the game can properly delegate the message in case there are multiple instances of the same agent.

### Default template for the Response <a href="#default-template-for-the-response" id="default-template-for-the-response"></a>

\
After calling the endpoint provided to you, the response will be in this format:

```
{
    "response": "i'm doing great john!", 
    "agentId": "8", 
    "agentName": "test_ready_gamer_agent"
}
```

***

### Direct ReadyGamer API Access (Existing Agent)&#x20;

{% hint style="info" %}
The following sections is if you have an existing agent that you want to deploy in your game!
{% endhint %}

To prepare your agent for integration with the Ready Gamer API, your agent should have an endpoint with a capability to accept HTTPS POST requests in the format below.

### HTTPS Post Request Format <a href="#https-post-request-format" id="https-post-request-format"></a>

```
{
    "message": "how are you doing?",
    "name_of_player": "john",
    "environment": ""
} 
```

* **message** is the chat message coming from the game.
* **name\_of\_player** is the name of the player who's currently chatting with the agent.
* **environment** is a string containing information describing the current game state.

### Response Format <a href="#response-format" id="response-format"></a>

\
Regardless of what custom functions the agent was built to do, it should respond to the request in this format:

```
{
    "response": "i'm doing great john!"
}
```

* **response** is the processed message reply of the agent.

Once your agent endpoint is ready to accept this request, please contact us so we can connect you to the Ready Gamer API.
