» Public API

Overcast provides a set of public API that can be used to interact with the environment such as reading state or performing certain actions. In the following document we are going to learn the basics of how to invoke the public API and show some examples of usage.

» Calling the API

The public API is invoked using the same url for every call, with the following format:

https://overcast.smartfoxserver.com/public_api/{command}/{p1}/.../{pN}

Where:

Since the public API use standard HTTP protocol any HTTP client (browser, command line tool, language specific library) can be used to interact with it.

From the other end the Overcast API will reply with a plain JSON object.

» Listing available SFS2X instances

The list_sfs command allows to obtain the list of available SmartFoxServer instances running in a specific app. The request format is as follows:

/public_api/list_sfs/{appId}/{regionId}

The API will reply with a list of server objects. For example:

[
  {
    "name": "Server1-EU",
    "ip": "18.159.129.242",
    "region": "eu-central-1",
    "ccu": "1150"
  },
  {
    "name": "Server2-EU",
    "ip": "18.196.73.119",
    "region": "eu-central-1",
    "ccu": "699"
  },
  {
    "name": "Server3-US",
    "ip": "34.205.72.152",
    "region": "us-east-1",
    "ccu": "2884"
  }
]
		

Each object has four properties:

With this command clients can filter the available list of SFS instances by their source region and choose where to connect.