AppMage

Ecosystem

This endpoint group provides methods for managing downstream services integrated with the current AppBuilder subscription. This includes checking the status of connected services, triggering their provisioning, and generating one-time login links for seamless access.

Endpoints

POST /api/rpc (Method: EcosystemRpc.getDownstreamServicesStatus)

  • Description: Gets the status of all configured downstream services for the current subscription.

  • Request Body:

    {
      "method": "EcosystemRpc.getDownstreamServicesStatus",
      "params": {}
    }
  • Parameters:

    Name Type Required Description
    This method takes no parameters.
  • Response:

    {
      "success": true,
      "data": [
        {
          "name": "serviceA",
          "isProvisioned": true
        },
        {
          "name": "serviceB",
          "isProvisioned": false
        }
      ]
    }
  • 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": "EcosystemRpc.getDownstreamServicesStatus",
        "params": {}
      }'

POST /api/rpc (Method: EcosystemRpc.provisionDownstreamService)

  • Description: Triggers the provisioning of a downstream service for the current subscription. This involves creating a new account on the downstream service and linking it to the current AppBuilder subscription. Delegates to EcosystemService.provisionSubscription and UserService.getUserById.

  • Request Body:

    {
      "method": "EcosystemRpc.provisionDownstreamService",
      "params": {
        "serviceName": "your-downstream-service-name"
      }
    }
  • Parameters:

    Name Type Required Description
    serviceName String Yes The name of the downstream service to provision.
  • Response:

    {
      "success": true,
      "data": {
        "success": true,
        "result": {
          "apiKey": "...",
          "subscriptionId": "...",
          "serviceCode": "..."
        }
      }
    }
  • 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": "EcosystemRpc.provisionDownstreamService",
        "params": {
          "serviceName": "your-downstream-service-name"
        }
      }'

POST /api/rpc (Method: EcosystemRpc.generateDownstreamLoginLink)

  • Description: Generates a one-time login link for a downstream service, allowing the current user to access it without re-authenticating. Delegates to EcosystemService.getDownstreamLoginLink.

  • Request Body:

    {
      "method": "EcosystemRpc.generateDownstreamLoginLink",
      "params": {
        "serviceName": "your-downstream-service-name"
      }
    }
  • Parameters:

    Name Type Required Description
    serviceName String Yes The name of the downstream service for which to generate a login link.
  • Response:

    {
      "success": true,
      "data": {
        "loginUrl": "https://downstream.example.com/onetime-login?token=..."
      }
    }
  • 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": "EcosystemRpc.generateDownstreamLoginLink",
        "params": {
          "serviceName": "your-downstream-service-name"
        }
      }'