Aoba XMPP Messaging API 1.0.0

XMPP-based real-time messaging API using WebSocket transport (RFC 7395).

Purpose

This API provides real-time chat functionality including:

  • Direct messaging (1:1 chat)
  • Group chat (Multi-User Chat / MUC)
  • Presence (online/offline/away status)
  • Message delivery receipts (XEP-0184)

Protocol

Uses XMPP (Extensible Messaging and Presence Protocol) over WebSocket. Messages are XML stanzas following XMPP Core (RFC 6120) and relevant XEPs.

Authentication

  1. Client opens WebSocket to /xmpp
  2. Server validates JWT from auth_token cookie during upgrade
  3. XMPP stream negotiation begins with pre-authenticated session
  4. SASL authentication auto-succeeds (cookie already validated)
  5. Client sends initial presence to indicate availability

XEPs Implemented

  • XEP-0045: Multi-User Chat (MUC) for group messaging
  • XEP-0184: Message Delivery Receipts
  • XEP-0199: XMPP Ping (keepalive)

Servers

  • ws://localhost:8082/wsdevelopment

    Local development server

  • wss://staging.aoba.chat/wssstaging

    Staging server (TLS required)

  • wss://api.aoba.chat/wssproduction

    Production server (TLS required)

Operations

  • SEND /xmpp

    XMPP over WebSocket endpoint following RFC 7395.

    Authentication: JWT token must be present in auth_token cookie. Connection uses XMPP framing (urn:ietf:params:xml:ns:xmpp-framing).

    JID Format: {username}@{domain}/{resource}

    • Example: alice@localhost/web-abc123

    Send direct message to user

    Send a 1:1 chat message to another user. The message is routed through the XMPP server to the recipient's connected clients.

    Operation IDsendChatMessage

    Available only on servers:

    object

    Accepts the following message:

    Direct Chat MessageChatMessage

    1:1 chat message between users

    Message IDChatMessage
    object

    XMPP message stanza for direct chat

    Examples

  • RECEIVE /xmpp

    XMPP over WebSocket endpoint following RFC 7395.

    Authentication: JWT token must be present in auth_token cookie. Connection uses XMPP framing (urn:ietf:params:xml:ns:xmpp-framing).

    JID Format: {username}@{domain}/{resource}

    • Example: alice@localhost/web-abc123

    Receive direct message from user

    Receive a 1:1 chat message from another user.

    Operation IDreceiveChatMessage

    Available only on servers:

    object

    Accepts the following message:

    Direct Chat MessageChatMessage

    1:1 chat message between users

    Message IDChatMessage
    object

    XMPP message stanza for direct chat

    Examples

  • SEND /xmpp

    XMPP over WebSocket endpoint following RFC 7395.

    Authentication: JWT token must be present in auth_token cookie. Connection uses XMPP framing (urn:ietf:params:xml:ns:xmpp-framing).

    JID Format: {username}@{domain}/{resource}

    • Example: alice@localhost/web-abc123

    Send message to group

    Send a message to a MUC room. The message is broadcast to all room participants by the server.

    JID Format: group-{uuid}@{domain}

    Operation IDsendGroupMessage

    Available only on servers:

    object

    Accepts the following message:

    Group Chat MessageGroupChatMessage

    Message to a MUC room

    Message IDGroupChatMessage
    object

    XMPP message stanza for group chat (MUC)

    Examples

  • RECEIVE /xmpp

    XMPP over WebSocket endpoint following RFC 7395.

    Authentication: JWT token must be present in auth_token cookie. Connection uses XMPP framing (urn:ietf:params:xml:ns:xmpp-framing).

    JID Format: {username}@{domain}/{resource}

    • Example: alice@localhost/web-abc123

    Receive message from group

    Receive a group chat message. The from JID includes the sender's nickname in the resource part.

    From Format: group-{uuid}@{domain}/{senderUsername}

    Operation IDreceiveGroupMessage

    Available only on servers:

    object

    Accepts the following message:

    Group Chat MessageGroupChatMessage

    Message to a MUC room

    Message IDGroupChatMessage
    object

    XMPP message stanza for group chat (MUC)

    Examples

  • SEND /xmpp

    XMPP over WebSocket endpoint following RFC 7395.

    Authentication: JWT token must be present in auth_token cookie. Connection uses XMPP framing (urn:ietf:params:xml:ns:xmpp-framing).

    JID Format: {username}@{domain}/{resource}

    • Example: alice@localhost/web-abc123

    Send presence update

    Broadcast presence status to contacts and joined rooms. Initial presence must be sent after authentication to appear online.

    Operation IDsendPresence

    Available only on servers:

    object

    Accepts the following message:

    Presence StanzaPresenceUpdate

    User availability status

    Message IDPresenceUpdate
    object

    XMPP presence stanza

    Examples

  • RECEIVE /xmpp

    XMPP over WebSocket endpoint following RFC 7395.

    Authentication: JWT token must be present in auth_token cookie. Connection uses XMPP framing (urn:ietf:params:xml:ns:xmpp-framing).

    JID Format: {username}@{domain}/{resource}

    • Example: alice@localhost/web-abc123

    Receive presence update

    Receive presence updates from contacts and room participants.

    Operation IDreceivePresence

    Available only on servers:

    object

    Accepts the following message:

    Presence StanzaPresenceUpdate

    User availability status

    Message IDPresenceUpdate
    object

    XMPP presence stanza

    Examples

  • SEND /xmpp

    XMPP over WebSocket endpoint following RFC 7395.

    Authentication: JWT token must be present in auth_token cookie. Connection uses XMPP framing (urn:ietf:params:xml:ns:xmpp-framing).

    JID Format: {username}@{domain}/{resource}

    • Example: alice@localhost/web-abc123

    Send message with delivery receipt request

    Send a message with XEP-0184 receipt request. The recipient should respond with a delivery receipt when the message is received.

    Operation IDsendMessageWithReceipt

    Available only on servers:

    object

    Accepts the following message:

    Message with Receipt RequestDeliveryReceiptRequest

    Message requesting delivery confirmation (XEP-0184)

    Message IDDeliveryReceiptRequest
    object allOf

    Message with XEP-0184 receipt request

    Examples

  • RECEIVE /xmpp

    XMPP over WebSocket endpoint following RFC 7395.

    Authentication: JWT token must be present in auth_token cookie. Connection uses XMPP framing (urn:ietf:params:xml:ns:xmpp-framing).

    JID Format: {username}@{domain}/{resource}

    • Example: alice@localhost/web-abc123

    Receive delivery receipt

    Receive confirmation that a sent message was delivered. The receipt contains the original message ID.

    Operation IDreceiveDeliveryReceipt

    Available only on servers:

    object

    Accepts the following message:

    Delivery ReceiptDeliveryReceipt

    Confirmation of message delivery (XEP-0184)

    Message IDDeliveryReceipt
    object

    XEP-0184 delivery receipt acknowledgment

    Examples

Messages

  • #1Direct Chat MessageChatMessage

    1:1 chat message between users

    Message IDChatMessage
    object

    XMPP message stanza for direct chat

  • #2Group Chat MessageGroupChatMessage

    Message to a MUC room

    Message IDGroupChatMessage
    object

    XMPP message stanza for group chat (MUC)

  • #3Presence StanzaPresenceUpdate

    User availability status

    Message IDPresenceUpdate
    object

    XMPP presence stanza

  • #4Message with Receipt RequestDeliveryReceiptRequest

    Message requesting delivery confirmation (XEP-0184)

    Message IDDeliveryReceiptRequest
    object allOf

    Message with XEP-0184 receipt request

  • #5Delivery ReceiptDeliveryReceipt

    Confirmation of message delivery (XEP-0184)

    Message IDDeliveryReceipt
    object

    XEP-0184 delivery receipt acknowledgment

Schemas

  • object

    XMPP message stanza for direct chat

  • object

    XMPP message stanza for group chat (MUC)

  • object

    XMPP presence stanza

  • object allOf

    Message with XEP-0184 receipt request

  • object

    XEP-0184 delivery receipt acknowledgment

  • JID
    string
    must match: ^([^@/]+@)?[^@/]+(\/[^@/]+)?$

    Jabber ID (JID) following RFC 7622.

    Formats:

    • Bare JID: localpart@domain (e.g., alice@localhost)
    • Full JID: localpart@domain/resource (e.g., alice@localhost/web-123)
    • Domain JID: domain (e.g., conference.localhost)
      Examples values:
    • "alice@localhost"
    • "alice@localhost/web-abc123"
    • "group-uuid@conference.localhost"
  • object

    XMPP error stanza