Virola Web API

Current version of Web API is a very basic one as we decided to start publishing it as soon as we get the first working request.

Test Web API calls can be made with the curl command.

Web API access token is required to send Web API requests.

To get a Web API token, use main menu Tools -> Web API Access Token

The token will tie your user profile with Web API calls you make, so all calls will be performed on your behalf.

Note! Once you generate a new token, your previously generated token will stop working.

Menu item to get Web API access token

Chat room ID is required to send chat messages.

To get the chat room ID, right click the room in the room list and check its number at the top of the opened context menu.

Menu item to get Web API access token

Web API Requests

Get server health information
curl -k -X GET \
	-H "Authorization: Bearer TOKEN" \
Send a text message into the room
curl -k -X POST \
	-H "Authorization: Bearer TOKEN" \
	https://HOST:PORT/api/v1/rooms/ROOM_ID/text-messages \
	-d "{\"content\":\"Hello, World\"}"

You can also use the javascript language to access wabapi, as shown in the following example:

    var req = new XMLHttpRequest();
    req.onreadystatechange = function() { 
        if (req.readyState == 4 && req.status == 200)
            document.write("<pre>" + req.responseText + "</pre>");
    }"GET", "https://HOST:PORT/api/v1/server-health", true);
    req.setRequestHeader("Authorization", "Bearer TOKEN");