Skip to main content

Ejabberd API

Overview

The Ejabberd API provides RESTful endpoints for managing and monitoring XMPP server operations within CONTROL. All requests require HTTP basic authentication and use JSON for request/response payloads.

Authentication

All API endpoints require basic authentication using admin credentials:

  • Username: root@control-xmpp-dev.zequenze.com
  • Password: Your admin API token
  • Base URL: https://127.0.0.1:5443/api/

API Endpoints

Get Registered Stats Hosts

Retrieves statistics for registered hosts, including online user counts.

Endpoint: /stats_host

Request Parameters:

  • name - The statistic name (e.g., "onlineusers")
  • host - The XMPP host domain

Example:

curl -k --basic --user root@control-xmpp-dev.zequenze.com:6N3Zne3ByoSCnZ3d46Gerf452nxLBcNp \
     -H 'Content-Type: application/json' \
     -d '{ "name": "onlineusers", "host": "control-xmpp-dev.zequenze.com" }' \
     'https://127.0.0.1:5443/api/stats_host'

Get Connected Users

Returns a list of all currently connected users.

Endpoint: /connected_users

Example:

curl -k --basic --user root@control-xmpp-dev.zequenze.com:6N3Zne3ByoSCnZ3d46Gerf452nxLBcNp \
     'https://127.0.0.1:5443/api/connected_users'

Get Registered Users

Retrieves all registered users for a specific host.

Endpoint: /registered_users

Request Parameters:

  • host - The XMPP host domain

Example:

curl -k --basic --user root@control-xmpp-dev.zequenze.com:6N3Zne3ByoSCnZ3d46Gerf452nxLBcNp \
     -H 'Content-Type: application/json' \
     -d '{ "host": "control-xmpp-dev.zequenze.com" }' \
     'https://127.0.0.1:5443/api/registered_users'

Get Connected Users Info

Returns detailed information about all connected users.

Endpoint: /connected_users_info

Example:

curl -k --basic --user root@control-xmpp-dev.zequenze.com:6N3Zne3ByoSCnZ3d46Gerf452nxLBcNp \
     'https://127.0.0.1:5443/api/connected_users_info'

Get User Presence

Retrieves the presence status for a specific user.

Endpoint: /get_presence

Request Parameters:

  • user - The username
  • host - The XMPP host domain

Example:

curl -k --basic --user root@control-xmpp-dev.zequenze.com:6N3Zne3ByoSCnZ3d46Gerf452nxLBcNp \
     -H 'Content-Type: application/json' \
     -d '{ "user": "hy400219100000286", "host": "control-xmpp-dev.zequenze.com" }' \
     'https://127.0.0.1:5443/api/get_presence'

Get User Session Info

Returns detailed session information for a specific user.

Endpoint: /user_sessions_info

Request Parameters:

  • user - The username
  • host - The XMPP host domain

Example:

curl -k --basic --user root@control-xmpp-dev.zequenze.com:6N3Zne3ByoSCnZ3d46Gerf452nxLBcNp \
     -H 'Content-Type: application/json' \
     -d '{ "user": "hy400219100000286", "host": "control-xmpp-dev.zequenze.com" }' \
     'https://127.0.0.1:5443/api/user_sessions_info'

Get User Resources

Retrieves all active resources (connections) for a specific user.

Endpoint: /user_resources

Request Parameters:

  • user - The username
  • host - The XMPP host domain

Example:

curl -k --basic --user root@control-xmpp-dev.zequenze.com:6N3Zne3ByoSCnZ3d46Gerf452nxLBcNp \
     -H 'Content-Type: application/json' \
     -d '{ "user": "hy400219100000286", "host": "control-xmpp-dev.zequenze.com" }' \
     'https://127.0.0.1:5443/api/user_resources'