Skip to content

Endpoints

Jordon Brooks edited this page Jun 26, 2023 · 5 revisions

Are You There

A simple endpoint that checks if the server is up and running.

  • URL: /v1/are_you_there
  • Method: GET
  • Response: A simple "yes" response.

All Info

Returns a JSON object containing information about various aspects of the system, including OS, battery, dock, and version information.

  • URL: /v1/all_info
  • Method: GET
  • Response Description:
    • os: A JSON object containing the operating system information
    • battery: A JSON object containing the battery status information
    • dock: A JSON object containing the dock information
    • version: A JSON object containing the version information of the server application
  • Sample Response:
    {
        "os": {
            "platform": "WINDOWS",
            "name": "Windows 11 Core",
            "version": "10.0.22621",
            "bits": "X86_64"
        },
        "battery": {
            "has_battery": false,
            "battery_percent": 0,
            "charging_status": "UNKNOWN"
        },
        "dock": {
            "dock_info": {
                "brand": "",
                "model": "",
                "usb_ids": []
            },
            "is_docked": true,
            "fallback_detection": false
        },
        "version": {
            "build_timestamp": "2023-06-25T22:42:16.697662700Z",
            "git_branch": "feature/Versioned_API",
            "git_describe": "release_1.0.0-11-gba6bde2",
            "git_commit_timestamp": "2023-06-25T12:38:11.000000000+01:00",
            "debug": true,
            "version": "0.1.0",
            "version_major": 0,
            "version_minor": 1,
            "version_patch": 0,
            "version_pre": "",
            "supported_api_versions": ["v1"]
        }
    }

OS Info

Returns a JSON object containing information about the operating system.

  • URL: /v1/os_info
  • Method: GET
  • Response Description:
    • platform: The type of operating system, e.g., "WINDOWS"
    • name: The name of the operating system, e.g., "Windows 11 Core"
    • version: The version of the operating system
    • bits: The bit architecture of the operating system, e.g., "X86_64"
  • Sample Response:
    {
        "platform": "WINDOWS",
        "name": "Windows 11 Core",
        "version": "10.0.22621",
        "bits": "X86_64"
    }

Battery Info

Returns a JSON object containing information about the battery status.

  • URL: /v1/battery_info
  • Method: GET
  • Response Description:
    • has_battery: A boolean indicating whether the device has a battery
    • battery_percent: The percentage of battery remaining
    • charging_status: The charging status of the battery, can be "UNKNOWN", "BATTERY", "CHARGING"
  • Sample Response:
    {
        "has_battery": false,
        "battery_percent": 0,
        "charging_status": "UNKNOWN"
    }

Version Info

Returns a JSON object containing information about the version of the server application.

  • URL: /v1/version_info
  • Method: GET
  • Response Description:
    • build_timestamp: The timestamp when the current server build was created
    • git_branch: The git branch name associated with the current build
    • git_describe: Description provided through git for the current build
    • git_commit_timestamp: The timestamp when the current git commit was made
    • debug: A boolean indicating whether the current build is a debug version
    • version: The version number of the server application
    • version_major: The major version number
    • version_minor: The minor version number
    • version_patch: The patch version number
    • version_pre: Any pre-release version information
    • supported_api_versions: An array containing the versions of the API that are currently supported
  • Sample Response:
    {
        "build_timestamp": "2023-06-25T22:42:16.697662700Z",
        "git_branch": "feature/Versioned_API",
        "git_describe": "release_1.0.0-11-gba6bde2",
        "git_commit_timestamp": "2023-06-25T12:38:11.000000000+01:00",
        "debug": true,
        "version": "0.1.0",
        "version_major": 0,
        "version_minor": 1,
        "version_patch": 0,
        "version_pre": "",
        "supported_api_versions": ["v1"]
    }

Dock Info

Returns a JSON object containing information about the dock.

  • URL: /v1/dock_info
  • Method: GET
  • Response Description:
    • dock_info: A JSON object containing information about the dock
      • brand: The brand of the dock
      • model: The model of the dock
      • usb_ids: An array containing the USB IDs associated with the dock
    • is_docked: A boolean indicating whether the device is currently docked
    • fallback_detection: A boolean indicating whether fallback detection is being used for the dock
  • Sample Response:
    {
        "dock_info": {
            "brand": "",
            "model": "",
            "usb_ids": []
        },
        "is_docked": true,
        "fallback_detection": false
    }

Supported Versions

Returns an array containing the versions of the API that are currently supported.

  • URL: /api/supported_versions
  • Method: GET
  • Sample Response:
    ["v1"]
Clone this wiki locally