XOne API Agent
The XOne API Agent is an intelligent assistant designed to help you create, manage, and deploy Application Programming Interfaces (APIs) using the .NET 10 framework. It acts as a full-stack developer for your data connections, handling the entire lifecycle of an API from writing the initial code to ensuring it works correctly before it goes live.
Powered by advanced AI, this agent uses a set of built-in skills to ensure your APIs are secure, efficient, and tested. It automatically creates the project structure, writes the necessary code, compiles the application, runs safety tests in an isolated environment, and finally deploys the API to the XOne platform.
How it Works
When you use the XOne API Agent, you are essentially handing over the technical heavy lifting to an AI engineer. The process happens in several automatic steps:
- Setup: The agent creates the skeleton of your .NET 10 project.
- Coding: It writes the code for your API endpoints and business logic, using efficient tools like Dapper for database access.
- Building: It compiles the code into a runnable application.
- Testing: The agent runs automated tests inside a temporary, isolated “sandbox” (using Docker technology). This ensures that your new API doesn’t break existing systems and works as expected.
- Deployment: Once tested successfully, the agent publishes your API to the XOne platform.
- Verification: It performs a final check to confirm the API is live and responding correctly.
Connection & Credentials
This component requires configuring a credential in the Nappai panel before interacting with the external service:
- Go to the Credentials section in your Nappai panel.
- Create a new credential of the type XOne Platform API and fill in the required fields:
- Platform URL: The address of your XOne platform (e.g.,
https://platform.xone.example.com). - Master API Key: Your secure access key for the XOne platform.
- Platform URL: The address of your XOne platform (e.g.,
- In your workflow, select the saved credential in the Credential input field of this node.
Operations
This component does not offer manual operation selection. It operates as an autonomous agent that automatically executes the entire API development lifecycle upon triggering.
Inputs
The following fields are available to configure this component. Each field may be visible in different operations:
- Credential: The specific API key and platform URL configuration used to connect to the XOne service. This must be selected from your saved credentials.
- Project Slug: The unique identifier for the project you are working on within the XOne platform.
- MariaDB Connection String: The connection details required to link the API to your MariaDB database for testing and data management.
- Language Model Connection: The configuration for the AI language model that powers the agent’s decision-making and code generation.
Outputs
The XOne API Agent primarily functions as an executor of processes. Instead of returning simple text data, its main “output” is the status of the operation.
You will receive feedback indicating whether the build, test, and deployment phases were successful or if any errors occurred. This status allows you to verify that your API has been correctly compiled, tested, and deployed to the XOne platform.
Output Data Example (JSON)json
{ “status”: “success”, “project_slug”: “my-new-api-v1”, “build_result”: { “compiled”: true, “errors”: [] }, “test_result”: { “passed”: true, “tests_executed”: 15 }, “deployment_status”: { “deployed”: true, “endpoint_url”: “https://platform.xone.example.com/api/my-new-api-v1” } }
Connectivity
This component is typically used at the end of a data management workflow.
- Inputs: It connects to components that provide project identifiers (Project Slug) and database connection details. It may also follow components that define the API’s requirements or structure.
- Outputs: The output status is often passed to monitoring components or notification services to alert users if the API deployment fails or succeeds.
Usage Example
Imagine you need a new API endpoint to fetch user data from your MariaDB database and serve it to a mobile app.
- You configure the XOne API Agent with your XOne Platform API credential.
- You provide the Project Slug for your current project and the MariaDB Connection String so the AI knows where the data lives.
- The Agent automatically:
- Creates the necessary .NET code to query the database.
- Compiles the code.
- Runs tests to ensure no data is lost or corrupted.
- Deploys the API to XOne.
- You receive a success status, confirming that your new API endpoint is live and ready for use.
Tips and Best Practices
- Pre-test Your Database: Ensure your MariaDB connection string is correct and accessible before running the agent, as the AI relies on it for testing.
- Unique Project Slugs: Make sure your Project Slug is unique and valid in the XOne platform to avoid deployment conflicts.
- Monitor Status Logs: Keep an eye on the operation status. If the agent reports a failure, the error logs will help you understand if the issue was with the code generation, testing, or deployment.
Security Considerations
- Credential Protection: The XOne Platform API credential contains sensitive Master API Keys. Ensure these are stored securely in the Nappai panel and not shared publicly.
- Isolated Testing: The agent uses an isolated Docker environment for testing. This means tests are safe and will not interfere with your live production data, but ensure your test database contains appropriate sample data.