- Docs
- Getting Started
- APIs
APIs
Learn about QPub's REST and WebSocket APIs for building real-time applications.
Overview
QPub provides two main APIs for different use cases:
- REST API: HTTP-based API for standard request/response operations
- WebSocket API: Real-time bidirectional communication
REST API
Base URL
https://api.qpub.com/v1
Authentication
curl -H "Authorization: Bearer YOUR_API_KEY" \
https://api.qpub.com/v1/channelsCommon Endpoints
GET /channels- List channelsPOST /channels- Create channelPOST /channels/{id}/messages- Send messageGET /channels/{id}/messages- Get messages
WebSocket API
Connection URL
wss://api.qpub.com/v1/socket
Authentication
// Send auth message after connection
{
"type": "auth",
"apiKey": "your-api-key"
}Message Format
// Client to server
{
"type": "publish",
"channel": "my-channel",
"data": { "text": "Hello!" }
}
// Server to client
{
"type": "message",
"channel": "my-channel",
"data": { "text": "Hello!" },
"timestamp": "2024-01-01T00:00:00Z"
}SDKs
JavaScript SDK
import { QPubSocket } from '@qpub/sdk';
const client = new QPubSocket({
apiKey: 'your-api-key'
});REST SDK
import { QPubREST } from '@qpub/rest-sdk';
const client = new QPubREST({
apiKey: 'your-api-key'
});Getting Started
- Get API Key: Sign up and obtain your API key
- Choose API: Select REST or WebSocket based on your needs
- Make First Request: Send your first API request
- Build Application: Integrate QPub into your application
This page is under construction. API documentation will be expanded soon.
Previous
Choose an SDK
Next
Authentication