QwikBroad API Documentation
v1.0

QwikBroad API Overview

The QwikBroad API allows developers to integrate powerful notification and messaging capabilities into their applications. It supports multi-channel notifications, device management via FCM, and real-time interactions.

Base URL

http://localhost:3000

POST

Register User

Creates a new user account.

Request
Endpoint
/api/register
Body (JSON)
{
  "email": "user@example.com",
  "password": "strongpassword"
}

Response

{
  "message": "User registered successfully",
  "user_id": "uuid-string"
}
POST

Login

Authenticates a user and returns a JWT token.

Endpoint
/api/login
Body (JSON)
{
  "email": "user@example.com",
  "password": "strongpassword"
}

Response

{
  "token": "jwt-token-string"
}
POST

OAuth (Google)

Exchanges a provider token for a system JWT token.

Endpoint
/api/auth/oauth
Body (JSON)
{
  "provider": "google",
  "token": "google-id-token"
}

Devices

POST

Register Device

Registers a mobile device FCM token for push notifications.

Header
Authorization: Bearer <token>
Endpoint
/api/devices/register
Body (JSON)
{
  "fcm_token": "firebase-cloud-messaging-token",
  "platform": "android" 
}

Channels

POST

Create Channel

Creates a new notification channel.

Endpoint
/api/channels
Parameters (Multipart/JSON)
Field Type Description
namestringChannel name
descriptionstringDescription
categorystringCategory (e.g. "Tech")
is_privateboolTrue or False
iconfileChannel icon image
GET

Get My Channels

/api/channels/mine
GET

Public Channels

/api/channels/public
GET

Search Channels

/api/channels/search?q=<query>

Public Search: ?q=name | Private Search: ?q=@api-key

POST

Subscribe

/api/channels/:id/subscribe

Messages

POST

Send Message

Send a broadcast message (Channel Owner only).

Endpoint
/api/channels/:id/messages
Parameters
Field Description
titleMessage title
bodyMessage summary/body
contentRich HTML content
image_urlOptional external image URL
target_type"global" or "specific"
scheduled_atISO datetime string (e.g. 2023-12-31T23:59)
POST

Send External Message

Send a message from an external system using the Channel API Key.

Header
X-API-Key: <Channel-API-Key>
Endpoint
/api/external/channels/:channel_id/send
{
  "title": "Alert",
  "body": "System down",
  "image_url": "http://...",
  "target_user": "user-uuid" 
}

Reactions

POST

React to Message

/api/channels/:id/messages/:message_id/reactions
{
  "emoji": "😄" 
}

Reports

POST

Submit Report

Report a channel or message for inappropriate content.

Endpoint
/api/reports
Body (JSON)
{
  "channel_id": "optional-uuid",
  "message_id": "optional-uuid",
  "reason": "spam", // required
  "description": "Details about the report" // optional
}

* Either channel_id or message_id must be provided.


Polls

POST

Create Poll

Create a new poll in a channel.

Endpoint
/api/polls
Body (JSON)
{
  "channel_id": "uuid-string",
  "question": "What is your favorite color?",
  "options": ["Red", "Blue", "Green", "Yellow"],
  "expires_in": 1440
}
POST

Vote on Poll

Cast or change a vote on a poll option.

Endpoint
/api/polls/vote
Body (JSON)
{
  "poll_id": "uuid-string",
  "option_id": "uuid-string"
}
GET

Get Poll Results

Get the current results of a poll.

Endpoint
/api/polls/:id

Response

{
  "poll_id": "uuid-string",
  "question": "What is your favorite color?",
  "results": [
    { "id": "uuid-1", "text": "Red", "votes": 10 },
    { "id": "uuid-2", "text": "Blue", "votes": 5 }
  ]
}

Widget

Embed Widget

Include the widget in any HTML page to receive notifications in real-time.

Script Tag
                                <script src="http://localhost:3000/widget.js?channel_id=YOUR_CHANNEL_UUID&user_id=OPTIONAL_USER_UUID"></script>
                                
Parameters
Parameter Required Description
channel_idYesThe UUID of the channel to listen to.
user_idNoThe UUID of the user context (for persistent history).
tag_idNoThe DOM ID of an element to trigger the widget (replaces default launcher).