Fundamentals

The BlobHub WebSocket protocol is designed to be used in real-time applications, allowing for efficient and low-latency data exchange between clients and servers.

Messages

All messages between clients and BlobHub server follow the JSON-RPC 2.0 specification.

Requests

Requests are sent from the client to the server or vice versa, to initiate an operation.
{
  jsonrpc: "2.0";
  id: string | number;
  method: string;
  params?: {
    [key: string]: unknown;
  };
}

Responses

Responses are sent in reply to requests, containing the result or error of the operation.
{
  jsonrpc: "2.0";
  id: string | number;
  result?: {
    [key: string]: unknown;
  }
  error?: {
    code: number;
    message: string;
    data?: unknown;
  }
}

Error Codes

The following standard error codes are used in the protocol:
CodeDescription
400Invalid syntax
403Access forbidden
405Method not supported
500Unexpected failure