Type of APIs exposed

The Rual platform provides an HTTPS and WebSocket communication layer by default. Every API-block created in our blueprints will automatically become HTTP(S) endpoints and WS methods that, based on the scope, can be requested publicly or privately.

Shared Platform API

Our API on the shared hosting is located at https://dvc-api.rual.dev/{entity}/api/v1/info, requesting this URL will always provide you with the host you are connected with, core version and what type of env. you connected with.

The same works for websockets, just the method of requesting is a little bit different. You would connect on wss://dvc-ws.rual.dev using Primus located at https://dvc-ws.rual.dev/primus/primus.js.

WebSocket Communication

When succesfully connected, you should be able to make a request. As HTTP(S) and WS requests look identical on our platform, the request to the info endpoint would look like:

    "method": "GET",
    "uri": "/api/v1/info",
    "query": { ... },
    "body": { ... },
    "requestid": "your request id iterator (e.g. request-1, request-2, etc)",
    "access_token": "optional",
    "entity": "{entity}"

Our platform sometimes broadcasts messages like updates on the page you just visited or channels your blueprint subscribed to, you'll notice these messages will not include an URI in their JSON payload.

Request IDs

We use a request ID to make sure your websocket request will receive a response. This ID is locally generated. If you decide to connect using a WebSocket, make sure each request ID is unique per connection.

The request ID you send us, will be returned unaltered. This ID is for your own purpose, this wat you're able to easily identify the response on a pending request.