diff --git a/api/docs/public/how-to-use-the-api.md b/api/docs/public/how-to-use-the-api.md index a7c93584b..4ddcaecb1 100644 --- a/api/docs/public/how-to-use-the-api.md +++ b/api/docs/public/how-to-use-the-api.md @@ -6,17 +6,17 @@ The Unraid API provides a GraphQL interface that allows you to interact with you 1. First, enable developer mode using the CLI: -```bash -unraid-api developer -``` + ```bash + unraid-api developer + ``` 2. Follow the prompts to enable the sandbox. This will allow you to access the Apollo Sandbox interface. 3. Access the GraphQL playground by navigating to: -``` -http://YOUR_SERVER_IP/graphql -``` + ```txt + http://YOUR_SERVER_IP/graphql + ``` ## Authentication @@ -44,7 +44,7 @@ The generated API key should be included in your GraphQL requests as a header: ```json { - "x-api-key": "YOUR_API_KEY" + "x-api-key": "YOUR_API_KEY" } ``` @@ -83,20 +83,20 @@ The API provides access to various aspects of your Unraid server: ```graphql query { - info { - os { - platform - distro - release - uptime + info { + os { + platform + distro + release + uptime + } + cpu { + manufacturer + brand + cores + threads + } } - cpu { - manufacturer - brand - cores - threads - } - } } ``` @@ -104,22 +104,22 @@ query { ```graphql query { - array { - state - capacity { - disks { - free - used - total - } + array { + state + capacity { + disks { + free + used + total + } + } + disks { + name + size + status + temp + } } - disks { - name - size - status - temp - } - } } ``` @@ -127,13 +127,13 @@ query { ```graphql query { - dockerContainers { - id - names - state - status - autoStart - } + dockerContainers { + id + names + state + status + autoStart + } } ``` diff --git a/api/docs/public/index.md b/api/docs/public/index.md index 2dfa61af7..7b64ad618 100644 --- a/api/docs/public/index.md +++ b/api/docs/public/index.md @@ -7,8 +7,8 @@ The Unraid API provides a GraphQL interface for programmatic interaction with yo The API is available through the Unraid Connect Plugin: 1. Install Unraid Connect Plugin from Apps -2. Configure the plugin -3. Access API functionality through the plugin interface +2. [Configure the plugin](./how-to-use-the-api.md#enabling-the-graphql-sandbox) +3. Access API functionality through the [GraphQL Sandbox](./how-to-use-the-api.md#accessing-the-graphql-sandbox) ## Future Availability