Internal Hosts API

Use the Hosts API to:

  • Get host information
  • Get services uptime information
  • Get active connections information

HTTP Headers

The HTTP headers are used to access all RTLS APIs are listed below. Before submitting requests to the company API, set the following headers.

Header Name Example Value Description
X-User-Email admin@example.com Email of the user performing HTTP requests to the API.
X-User-Token Drv3yU7PdyqUMtr89erZ Token allowing user access to the API.

NOTE: Headers are applying to public routes, routes starts with /api/private/... access from localhost and do not require headers

Set header X-USER-EMAIL

Send a request to log in using POST api/auth/log_in.json described in the Auth API. Using the email address returned in the response, set: X-USER-EMAIL = data.email

Set header X-USER-TOKEN

Send a request to log in using POST api/auth/log_in.json described in the Auth API. Using the authentication token returned in the response, set: X-USER-TOKEN = data.token

Set header X-USER-PROJECT

Send a request to get projects using GET api/projects/ described in the Projects API. You must send this request with headers X-USER-EMAIL and X-USER-TOKEN already set. Using the project UID returned in the response, set: X-USER-PROJECT = projects[i].uid

Hosts endpoints

functionality method endpoint
get host information GET /api/v2/host
get host uptime GET /api/v2/host/uptime
get-host-connections GET /api/v2/host/connections

Endpoints

Get host information

GET /api/v2/host

Gets host information.

Response Fields

Field Description
hostname The hostname of the server
serverStatus The status of the server
serverStatus.disk The disk status information
serverStatus.memory The memory status information
serverStatus.cpu The cpu status information

Example Response

{
  "hostname": "localhost",
  "serverStatus": {
    "disk": {
      "total_kb": 157275116,
      "total_gb": 149.99,
      "total_mb": 0.15,
      "usage_percentage": 10,
      "usage_gb": 15,
      "usage_mb": 15360
    },
    "memory": {
      "total_mb": 15883.55,
      "total_gb": 15.51,
      "usage_percentage": 32.28,
      "usage_gb": 5.01,
      "usage_mb": 5130.24
    },
    "cpu": {
      "usage_percentage": "2.93",
      "total_mhz": 2299.974,
      "usage_mhz": 67.47,
      "total_ghz": 2.3,
      "usage_ghz": 0.07
    }
  }
}

Get host uptime

GET /api/v2/host/uptime

Get a host uptime.

Response Fields

Field Description
uptime The list of modules with uptime information.
uptime.uptime The human readable uptime information.
uptime.seconds The uptime information in seconds.
uptime.status The module status information.
uptime.category The module category.

Example Response

{
  "uptime": [
    {
      "uptime": "up 8 weeks, 1 day, 20 hours, 52 minutes",
      "seconds": 4999927,
      "status": "active",
      "category": "Server"
    },
    {
      "uptime": "",
      "seconds": null,
      "status": "installed",
      "category": "rtls-addon-attendance-detection",
      "version": "2024.1.725-0"
    },
    {
      "uptime": "",
      "seconds": null,
      "status": "installed",
      "category": "rtls-addon-boundary-zones",
      "version": "2024.1.725-0"
    },
    {
      "uptime": "5h 24min ago",
      "status": "active",
      "category": "rtls-server",
      "version": "2024.1.736-0",
      "seconds": 19469,
      "children": [
        {
          "uptime": "",
          "seconds": null,
          "status": "installed",
          "category": "rtls-frontend",
          "version": "2024.1.727-0"
        }
      ]
    }
  ]
}

Get host connections

GET /api/v2/host/connections

Get a host connections information

Response Fields

Field Description
connections The host connections information.
connections.port The host connection port number.
connections.ip_connected The host connection IP.

Example Response

{
  "connections": [
    {
      "port": 443,
      "ip_connected": "3.87.200.28"
    },
    {
      "port": 443,
      "ip_connected": "173.35.170.67"
    },
    {
      "port": 80,
      "ip_connected": "127.0.0.1"
    },
    {
      "port": 5800,
      "ip_connected": "52.201.217.218"
    }
  ]
}

results matching ""

    No results matching ""