Updated Endpoints (markdown)
parent
e570fde9eb
commit
0a00b2e8e8
1 changed files with 129 additions and 14 deletions
143
Endpoints.md
143
Endpoints.md
|
@ -1,20 +1,135 @@
|
||||||
http://localhost:9000/v1/are_you_there
|
# HarmonyLinkServer API Documentation
|
||||||
Body: yes
|
|
||||||
|
|
||||||
http://127.0.0.1:9000/v1/all_info
|
## Endpoints
|
||||||
Body: {"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"]}}
|
|
||||||
|
|
||||||
http://localhost:9000/v1/os_info
|
### 1. Are You There
|
||||||
Body: {"platform":"WINDOWS","name":"Windows 11 Core","version":"10.0.22621","bits":"X86_64"}
|
A simple endpoint that checks if the server is up and running.
|
||||||
|
|
||||||
http://localhost:9000/v1/battery_info
|
- **URL:** `/v1/are_you_there`
|
||||||
Body: {"has_battery":false,"battery_percent":0,"charging_status":"UNKNOWN"}
|
- **Method:** `GET`
|
||||||
|
- **Response:** A simple "yes" response.
|
||||||
|
|
||||||
http://localhost:9000/v1/version_info
|
### 2. All Info
|
||||||
Body: {"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"]}
|
Returns a JSON object containing information about various aspects of the system, including OS, battery, dock, and version information.
|
||||||
|
|
||||||
http://localhost:9000/v1/dock_info
|
- **URL:** `/v1/all_info`
|
||||||
Body: {"brand":"","model":"","usb_ids":[]}
|
- **Method:** `GET`
|
||||||
|
- **Sample Response:**
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"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"]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
http://localhost:9000/api/supported_versions
|
### 3. OS Info
|
||||||
Body: ["v1"]
|
Returns a JSON object containing information about the operating system.
|
||||||
|
|
||||||
|
- **URL:** `/v1/os_info`
|
||||||
|
- **Method:** `GET`
|
||||||
|
- **Sample Response:**
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"platform": "WINDOWS",
|
||||||
|
"name": "Windows 11 Core",
|
||||||
|
"version": "10.0.22621",
|
||||||
|
"bits": "X86_64"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### 4. Battery Info
|
||||||
|
Returns a JSON object containing information about the battery status.
|
||||||
|
|
||||||
|
- **URL:** `/v1/battery_info`
|
||||||
|
- **Method:** `GET`
|
||||||
|
- **Possible Charging Status:** "UNKNOWN", "BATTERY", "CHARGING"
|
||||||
|
- **Sample Response:**
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"has_battery": false,
|
||||||
|
"battery_percent": 0,
|
||||||
|
"charging_status": "UNKNOWN"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### 5. Version Info
|
||||||
|
Returns a JSON object containing information about the version of the server application.
|
||||||
|
|
||||||
|
- **URL:** `/v1/version_info`
|
||||||
|
- **Method:** `GET`
|
||||||
|
- **Sample Response:**
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"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,
|
||||||
|
```markdown
|
||||||
|
"version_minor": 1,
|
||||||
|
"version_patch": 0,
|
||||||
|
"version_pre": "",
|
||||||
|
"supported_api_versions": ["v1"]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### 6. Dock Info
|
||||||
|
Returns a JSON object containing information about the dock.
|
||||||
|
|
||||||
|
- **URL:** `/v1/dock_info`
|
||||||
|
- **Method:** `GET`
|
||||||
|
- **Sample Response:**
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"dock_info": {
|
||||||
|
"brand": "",
|
||||||
|
"model": "",
|
||||||
|
"usb_ids": []
|
||||||
|
},
|
||||||
|
"is_docked": true,
|
||||||
|
"fallback_detection": false
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### 7. Supported Versions
|
||||||
|
Returns an array containing the versions of the API that are currently supported.
|
||||||
|
|
||||||
|
- **URL:** `/api/supported_versions`
|
||||||
|
- **Method:** `GET`
|
||||||
|
- **Sample Response:**
|
||||||
|
```json
|
||||||
|
["v1"]
|
||||||
|
```
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue