get_current_users_count
Find the total number of eenos user accounts
To find the total number of eenos hosting accounts.
Required Headers
| Field | Description | Example |
| X-API-USER | API user name | eenos_api |
| X-API-PASSWORD | API user password | eenos123 |
Status Codes
| Code | Description |
| 200 | OK, Success |
| 500 | Server Error |
| 403 | Forbidden |
| 400 | Bad request |
Request URL
Post url = /get_current_users_count/
Default Full URL = https://your-host-name:5555/api/get_current_users_count/
Version Full URL = https://your-host-name:5555/api/v1/get_current_users_count/
Sample Curl Code
#!/bin/bash
REQUEST_URL="/get_current_users_count/"
BASE_URL="https://your-host-name:5555/api/v1"
# Default base url
# BASE_URL="https://your-host-name:5555/api"
# Version specific base url
# BASE_URL="https://your-host-name:5555/api/v1"
API_URL="$BASE_URL$REQUEST_URL"
/usr/bin/curl -X POST $API_URL \
-d "apiuser=eenos_api" \
-d "apiauth=eenos123"
Sample Output
{
"data" : {
"users" : 31
},
"info" : "Total number of eenos hosting accounts",
"status" : 200
}
Python Code
#!/usr/bin/python3
import requests
from pprint import pprint
# ---------------------------------------------------------------------
# API VERSION RULES
# ---------------------------------------------------------------------
# Default API (stable):
# https://your-host-name:5555/api/
#
# Versioned API (recommended for production / future compatibility):
# https://your-host-name:5555/api/v1/
#
# Endpoint example:
# get_current_users_count/
# Full versioned URL:
# https://your-host-name:5555/api/v1/get_current_users_count/
#
# This endpoint does NOT require a payload body.
# ---------------------------------------------------------------------
# API URL (versioned)
api_url = "https://your-host-name:5555/api/v1/get_current_users_count/"
# If using default API, uncomment below:
# api_url = "https://your-host-name:5555/api/get_current_users_count/"
# Authentication headers (new API format)
headers = {
"X-API-USER": "eenos_api",
"X-API-PASSWORD": "eenos123",
}
try:
response = requests.post(api_url, headers=headers)
response.raise_for_status()
pprint(response.json())
except Exception as e:
pprint(str(e))
PHP Code
<?php
/*
|--------------------------------------------------------------------------
| API VERSION RULES
|--------------------------------------------------------------------------
| Default API (stable):
| https://your-host-name:5555/api/
|
| Versioned API (recommended for production / future compatibility):
| https://your-host-name:5555/api/v1/
|
| Endpoint example:
| get_current_users_count/
| Full versioned URL:
| https://your-host-name:5555/api/v1/get_current_users_count/
|--------------------------------------------------------------------------
*/
// API request URL (versioned)
$request_url = '/get_current_users_count/';
/*
|--------------------------------------------------------------------------
| BASE URL SELECTION
|--------------------------------------------------------------------------
*/
// Versioned API base URL
$base_url = 'https://your-host-name:5555/api/v1';
// Default API base URL (uncomment if needed)
// $base_url = 'https://your-host-name:5555/api';
// Full API URL
$api_url = $base_url . $request_url;
// Initialize cURL
$ch = curl_init($api_url);
// No POST payload required for this endpoint
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
// Authentication headers (new API format)
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'X-API-USER: eenos_api',
'X-API-PASSWORD: eenos123'
]);
// Execute request
$result = curl_exec($ch);
// Error handling
if (curl_errno($ch)) {
echo 'cURL Error: ' . curl_error($ch);
} else {
echo json_encode(json_decode($result), JSON_PRETTY_PRINT);
}
// Close connection
curl_close($ch);
?>