Introduction
The IBM API Connect API Agent empowers developers to go from a simple idea to a fully deployed application in record time. With built-in API Generation, specification enhancement, governance validation, and code generation, API development has never been more streamlined or more powerful.
In this blog post, we’ll follow a developer at a major e-commerce company as they use the API Agent to turn an internal idea for a Customer Feedback & Sentiment Analysis API into a working microservice, backed by a database and ready for production, all in a few short steps.
App Idea: Customer Feedback Sentiment Analysis API
The marketing team wants deeper insight into customer sentiment across their platform's product reviews and support tickets. A developer proposes building an internal API that:
- Collects feedback records.
- Categorizes them by sentiment.
- Integrates with a PostgreSQL database.
With the API Agent, they take this from concept to code, quickly and confidently.
1. Create an OpenAPI Specification
First, the developer describes the app in natural language:
“Generate an OpenAPI 3.0 document for a feedback application that allows us to customer feedback on our various products to get sentiment feedback on these products. Do not add security schemas.”
The API Agent’s OpenAPI Generator Tool generates a structured OpenAPI 3.0 spec with:
- Full CRUD operations for three endpoints: /product, /product/{productId} and /feedback.
- Two schemas were also generated: Product and Feedback.
- The Feedback schema contains an important field called sentiment which indicates that feedback should be analyzed in the server code and return some categorization of the feedback itself.
2. Generate Python Code
For the initial proof of concept (POC), the developer uses the Simple Server option in the OpenAPI Python Generator Tool to quickly generate a working prototype. This server type is ideal for demonstrating core functionality and securing stakeholder buy-in. For example:
"Generate Python FastAPI code for the following OpenAPI document @'Feedback-Application-API.yaml'"
This generates:
- A lightweight application scaffold that includes boilerplate code, enabling developers to focus on implementing core business logic rather than setup.
- Mocked API responses with random data derived from the schema definitions, ideal for early testing and demonstrations.
- A detailed README with step-by-step instructions for installing dependencies, running the server, and exploring available endpoints.
3. Evolve into a Database CRUD Server
With stakeholder approval secured, the developer creates a PostgresSQL table from joining several other tables in the company’s organisation. They create several columns about various products and feedback for those product. They then regenerate the application using the OpenAPI Python Generator's Database CRUD Server option, this time generating code that allows us to perform operations on a PostgreSQL database table, to enable real data persistence and interaction. Alternatively, they could generate for DB2 or DynamoDB.
"Generate Python FastAPI code with postgres database integration for the following OpenAPI document @'Feedback-Application-API.yaml'"
This version includes:
- All the features of the Simple Server, but instead of mocked responses, it generates fully functional code to perform real CRUD operations against the developer's database.
- Automatic creation of database connection scaffolding, allowing developers to easily configure and establish connectivity with their chosen database.
At this stage, the developer can shift focus entirely to implementing the application’s core business logic. With the foundational CRUD operations, database models, and connection code already generated by the Database CRUD Server, there’s no need to spend time on repetitive boilerplate or setup tasks. This accelerates development significantly, enabling the team to deliver functional, data-driven features with minimal effort. As a result, the developer is able to rapidly iterate and present a working demo with real backend integration, turning stakeholder feedback into tangible progress within days, not weeks.
4. Build for Production with Connector Pack
To move into production, the developer creates the OpenAPI Python Generator's Connector Pack Server with the PostgreSQL Connector, a powerful option designed to integrate the application with the company's existing infrastructure. The developer also create their database table from step 3 into their production environment so the connector can use this new table in the generated code.
"Generate Python FastAPI code with connector pack integration for the following OpenAPI document @'Feedback-Application-API.yaml'"
Note: The PostgreSQL Connector must be made available as a source by an API Agent Admin within your organization. Please see our documentation for more information.
The generated package includes:
- A fully functional FastAPI backend server, tailored to the OpenAPI specification
- A client SDK that simplifies interaction with the backend and encapsulates the connection logic
Unlike earlier prototypes, this setup doesn't just mimic a database or rely on manually configured connections. Instead, it uses the IBM Connectivity Pack integration with the Postgres connector, enabling seamless and secure communication with the enterprise-grade production database.
The generated client is schema-aware and fully aligned with the database structure, making it easy to extend the backend server with business-specific logic and data operations. The developer takes the business logic developed in earlier iterations and incorporate it directly into this production ready framework. By building on top of a clean, well-integrated scaffold, they can deliver high-value features while trusting that the plumbing between the API layer and the data layer is reliable, secure, and scalable.
5. Deploy the Application
Any of the server types generated, whether it’s the Simple Server, Database CRUD Server, or Connector Pack Server, all can be easily deployed to IBM Code Engine using the Code Deployment Tool.
To prepare for deployment:
- For the Database CRUD Server, populate your database connection details in the database-prop file.
- For the Connector Pack Server, enter your connector credentials into the config.json.
These sensitive credentials will be securely stored as Kubernetes secrets during the deployment process, ensuring complete protection of your configuration data.
Once your setup is complete, zip the generated project and deploy it by prompting:
"Deploy the application code from @'Feedback-Application-API.zip'"
The Code Deployment Tool will initiate a full build and deployment cycle on IBM Code Engine. When deployment is complete, the API Agent will return the public URL of your running application, ready to be shared with your team or stakeholders for testing and feedback.
Conclusion
In just a few streamlined steps, the developer turned a simple internal concept into a fully functional API service powered entirely by the IBM API Connect's API Agent:
- Started with a natural language prompt to generate an OpenAPI 3.0 specification tailored to the business use case.
- Scaffolded backend code using the Simple Server option to quickly build a working proof of concept.
- Regenerated the app with database integration using the Database CRUD Server for real-time data persistence.
- Upgraded to a production-ready implementation using the Connector Pack Server with the PostgreSQL connector.
- Deployed the application to the cloud using IBM Code Engine, enabling instant access for teams and stakeholders.
Each step in the journey eliminated manual effort and accelerated delivery, allowing the developer to focus on business logic and value, not boilerplate.
To explore other powerful tools in the API Agent ecosystem, like spec validation, enhancement with AI-generated descriptions, governance rule remediation, and various other capabilities, check out this article.