AppMage

Dashboard

This endpoint group provides functionalities for managing user dashboard configurations and retrieving available widgets.

Endpoints

POST /api/rpc (Method: DashboardRpc.saveConfig)

  • Description: Saves the dashboard configuration for a user

  • Request Body:

    {
      "method": "DashboardRpc.saveConfig",
      "params": {
        "instanceId": "string",
        "config": {}
      }
    }
  • Parameters:

    Name Type Required Description
    instanceId String Yes The unique identifier for the dashboard instance.
    config Any Yes The complex configuration object for the dashboard.
  • Response:

    {
      "success": true,
      "data": {
        "success": true
      }
    }
  • Example (cURL):

    curl -X POST https://api.example.com/api/rpc \
      -H "Content-Type: application/json" \
      -H "X-API-Key: YOUR_API_KEY" \
      -d '{
        "method": "DashboardRpc.saveConfig",
        "params": {
          "instanceId": "my-dashboard-1",
          "config": {
            "layout": [],
            "widgets": {}
          }
        }
      }'

POST /api/rpc (Method: DashboardRpc.loadConfig)

  • Description: Loads the dashboard configuration for a user

  • Request Body:

    {
      "method": "DashboardRpc.loadConfig",
      "params": {
        "instanceId": "string"
      }
    }
  • Parameters:

    Name Type Required Description
    instanceId String Yes The unique identifier for the dashboard instance.
  • Response:

    {
      "success": true,
      "data": {
        // Returns the loaded dashboard configuration object or null if not found.
      }
    }
  • Example (cURL):

    curl -X POST https://api.example.com/api/rpc \
      -H "Content-Type: application/json" \
      -H "X-API-Key: YOUR_API-KEY" \
      -d '{
        "method": "DashboardRpc.loadConfig",
        "params": {
          "instanceId": "my-dashboard-1"
        }
      }'

POST /api/rpc (Method: DashboardRpc.getAvailableWidgets)

  • Description: Gets the list of available widgets (metadata only) for the user's role.

  • Request Body:

    {
      "method": "DashboardRpc.getAvailableWidgets",
      "params": {}
    }
  • Parameters:

    Name Type Required Description
  • Response:

    {
      "success": true,
      "data": [
        {
          "name": "string",
          "type": "string",
          "description": "string",
          "roles": ["string"]
        }
      ]
    }
  • Example (cURL):

    curl -X POST https://api.example.com/api/rpc \
      -H "Content-Type: application/json" \
      -H "X-API-Key: YOUR_API-KEY" \
      -d '{
        "method": "DashboardRpc.getAvailableWidgets",
        "params": {}
      }'