Skip to main content

Admin Client API

About Admin Client API​

Our Admin Client API offers a comprehensive set of endpoints designed to facilitate the management and administration of the node states. With intuitive routes and robust handlers, administrators can seamlessly navigate various node operations with ease and efficiency. The Admin Client API, paired with the Admin UI — a web application, is your go-to tool for managing node states, simplifying interactions with the server.

The Admin API empowers you to:

  • Revoke root keys
  • Request validation challenge
  • Install and list node applications
  • Fetch decentralized identifiers (DID)
  • Manage client keys

In essence, the Admin API simplifies node management, while the Admin UI offers an intuitive interface for seamless control.

How to Use​

To utilize the Admin API endpoints effectively, the recommended approach is to leverage the Admin UI web application. The Admin UI automates various steps involved in interacting with the Admin API, ensuring seamless integration and providing the best user experience.

By using the Admin UI, administrators can streamline their workflow, access essential functionalities with ease, and benefit from intuitive visualizations and controls. This approach not only simplifies the management of decentralized networks but also ensures that administrators have access to the best options and features available.

API Endpoints​

  1. Root Key Request - This endpoint allows administrators to add root keys for secure authentication and access control within the decentralized network environment. Validation Challenge Generation

    Pre requirements - Before calling "Root Key Request" endpoint, it is essential to first call the "/request-challenge" endpoint. This step is necessary as the "Root Key Request" endpoint requires a challenge to be passed and verified during the process of adding the root key

    POST /root-key

    Parameters:

    • accountId : The account identifier associated with the request.
    • signature : The signature generated by signing the challenge and message with the wallet.
    • publicKey : The public key used for verification.
    • callbackUrl : The URL to which the response callback should be sent.

    Note: The parameters for this POST request, including accountId, signature, and publicKey, are generated by signing the challenge and message with the wallet.

    Example call with curl

    curl -X POST \
    -H "Content-Type: application/json" \
    -d '{"accountId": "<ACCOUNT_ID>", "signature": "<SIGNATURE>", "publicKey": "<PUBLIC_KEY>", "callbackUrl": "<CALLBACK_URL>"}' \
    http://<NODE-URL>/admin-api/root-key

    Example response

    > Success response
    { data: "Root key added" }
    > Error response
    { error: "Failed to add root key: <error_message>" }
  2. Request authentication challenge - Administrators can utilize this endpoint to generate validation challenges, enabling users to authenticate their identity via wallet signatures for enhanced security measures.

    POST /request-challenge

    Example call with curl

    curl -X POST http://<NODE-URL>/admin-api/request-challenge

    Example response

    > Success response
    { data: { challenge: <challenge> } }
    > Error response
    { error: "Failed to fetch challenge: <error_message>" }
  3. Install Application - This endpoint facilitates the installation of new applications on the node, expanding the functionality and capabilities of the decentralized network ecosystem.

    POST /install-application

    Parameters:

    • application : Application name - can be selected from the Admin UI
    • version : Application release version - can be selected from the Admin UI

    Example call with curl

    curl -X POST \
    -H "Content-Type: application/json" \
    -d '{"application": "<APPLICATION_NAME>", "version": "<VERSION>"}' \
    http://<NODE-URL>/admin-api/install-application

    Example response

    > Success response
    { data: "Application Installed" }
    > Error response
    { error: "Failed to install application: <error_message>" }
  4. List installed Application - This endpoint returns a list of installed applications, providing valuable insights into the current state of the decentralized network ecosystem

    GET /applications

    Example call with curl

    curl -X GET http://<NODE-URL>/admin-api/applications

    Example response

    > Success response
    { data: {
    applications:
    [{
    application_name: <application_name>,
    version: <application_version>
    }]
    }}
    > Error response
    { error: "Failed to fetch installed applications: <error_message>" }
  5. Add Client Key - Administrators can add new client keys via this endpoint, enabling seamless access and authentication for authorized users within the network.

    POST /add-client-key

    Parameters:

    • wallet_signature : Signature generated with the wallet

    • payload : Reqest payload containing message and metadata

    • wallet_metadata : Crypto wallet metadata containing information for wallet_type and signing_key

      Example call with curl

    curl -X POST \
    -H "Content-Type: application/json" \
    -d '{"wallet_signature": "<WALLET_SIGNATURE>", "payload": { "message": <MESSAGE>, "metadata": <METADATA_VALUE>}. "wallet_metadata": {"wallet_type": <WALLET_TYPE>, "signing_key": <SIGNING_KEY>}}' \
    http://<NODE-URL>/admin-api/add-client-key

    Example response

    > Success response
    { data: "Client key stored" }
    > Error response
    { error: "Failed to add client key: <error_message>" }
  6. Get the DID - Fetches the Decentralized Identifier (DID) associated with the node, providing a unique identifier for network entities and enabling interoperability across decentralized applications.

    GET /did

    curl -X GET http://<NODE-URL>/admin-api/did

    Example response

    > Success response
    { data:
    {
    id: <id>,
    root_keys:
    [{
    signing_key: <signing_key>
    }]
    }
    }
    > Error response
    { error: "Failed to fetch DID: <error_message>" }
Was this page helpful?
Need some help? Check Support page