## Introduction

The NitroShare client running on this device provides an HTTP API that local applications can use to interact with the client.

### Authentication

In order to ensure that only local applications can interact with the client, the API requires a special HTTP header, `X-Auth-Token`, to be present. The value for this header can be obtained from `~/.NitroShare`. This JSON file contains both the port number and token value needed for authentication. For example:

    {
        "port": 8000,
        "token": "{1d38b8db-1fc7-4410-8205-2bb753e36f2d}"
    }

### Requests

Actions are invoked by sending HTTP POST requests to the correct endpoint. The `Content-Type` header should be set to `application/json`. The parameters are provided in the request body as a JSON object.

The response will also contain a JSON payload — an object that contains a single member, `return`. Its value is determined by the return value of the action.