API Builder

Overview
API Builder is an AI-based service designed to create functional APIs quickly and efficiently. By providing descriptions of the APIs, the service generates a downloadable Swagger JSON and a set of API definitions with relevant examples. These Swagger JSON files can be consumed by users to interact with our API BOT in QTP to understand more about those APIs. Additionally, API Builder features a mock API option that will host the APIs on Qyrus Cloud, giving users a mock URL for the generated APIs.
Problem-Solution Fit
Speed and Efficiency: API Builder significantly reduces the time and effort required to create APIs manually. It rapidly generates fully functional APIs based on descriptions, allowing you to focus on other critical aspects of your project.
AI-Driven Automation: Harnessing the power of AI, API Builder automates the API development process. This ensures consistency and reliability in the generated APIs while minimizing human errors.
Easy Mocking and Testing: With the mock API feature, APIs can be quickly hosted on Qyrus Cloud, providing instant mock URLs for testing and reference. This helps in initial development and validation phases without needing a backend setup.
Comprehensive API Definitions: The tool generates detailed API definitions with relevant examples, making it easier for developers to understand and integrate with the APIs. The downloadable Swagger JSON files enhance interoperability with other tools and platforms.
Prerequisites
Before using API Builder, ensure you have the following:
Access to API Builder service.
Basic understanding of API structures and Swagger/OpenAPI specifications.
Descriptions of the functionalities you want your API to have.
Tools for testing APIs (e.g., QAPI, Curl).
Step-by-Step Guide
1. Creating an API
Open API Builder: Begin by opening the API Builder interface. You will see a list of APIs that are already available.
Enter API Description: Start by typing a description of the API you want to build in the provided text box.
Example: "build APIs for petshop"

Generate API: Click on the "Build APIs" button to generate your API and get the relevant schemas and endpoints.

Review APIs: Once the APIs are built, click on "API Definition" to review the APIs.

Download Swagger JSON: Once the API is built, navigate to the "Swagger JSON" tab if not already selected. Then Click the "Download" button to download the generated Swagger JSON file.

Mock API: Mock APIs generate 'static APIs', meaning they return predefined responses without any backend logic or database interactions. This makes them perfect for initial testing and reference scenarios, but they do not create dynamic responses. Mock APIs provide a mock URL that developers can use for references or that testers can use to develop and run tests.
First user needs to save the APIs by clicking the "Save" button.
Click the "Mock APIs" button to create mock APIs.
A mock URL will be generated, which you can then copy for reference or testing purposes.
If the URL is not updated after hitting the mock button, switch between the "API Definition" and "Swagger JSON" tabs to refresh the UI.
Before Mocking APIs : APIs won't be hosted unless they are mocked.

After Mocking APIs : APIs will be hosted and provided with Host URL, making them executable.

2. How to Call or Execute APIs
Once APIs are mocked user can go to the "API Definitions" tab where user can execute the APIs. Alternatively, they can test them using tools like QAPI, Curl etc., as per your preference. Click on "try it out"

After Execution

Demo Video
Use Cases
Example 1: Banking Loan Application
Description: "Build apis for banking loan application"
Generated Endpoints:
GET /loanApplications: Get All Loan ApplicationsPOST /loanApplications: Create Loan ApplicationGET /loanApplications/{applicationId}: Get Loan ApplicationPUT /loanApplications/{applicationId}: Update Loan ApplicationDELETE /loanApplications/{applicationId}: Delete Loan ApplicationPOST /loanApplications/{applicationId}/approve: Approve Loan ApplicationPOST /loanApplications/{applicationId}/reject: Reject Loan ApplicationGET /users/{userId}: Get User ProfilePUT /users/{userId}: Update User ProfilePOST /users/register: User RegistrationPOST /users/login: User Login

Example 2: Pet Shop API
Description: "Build APIs for a pet shop."
Generated Endpoints:
GET /pets: Fetch the list of pets.POST /pets: Add a new pet.GET /pets/{petId}: Get details of a specific pet.PUT /pets/{petId}: Update details of a specific pet.DELETE /pets/{petId}: Delete a specific pet.GET /customers: Fetch the list of customers.POST /customers: Add a new customer.GET /customers/{customerId}: Get details of a specific customer.PUT /customers/{customerId}: Update details of a specific customer.DELETE /customers/{customerId}: Delete a specific customer.GET /purchases: Fetch the list of purchases.POST /purchases: Add a new purchase.GET /purchases/{purchaseId}: Get details of a specific purchase.DELETE /purchases/{purchaseId}: Delete a specific purchase.

Example 3: Specific Usecase
Description: "Build an API with the method POST at the route /pets that allows users to add a new pet to the pet store. The request should include parameters detailing the pet's attributes such as name, type, age, etc. Upon successful addition, the API should return a status code of 201 along with the details of the newly added pet. In the case of invalid input data, the API should respond with a 400 error code."
Generated Endpoints:
POST /pets: Add a new pet to the store.GET /pets: Get all pets from the store.GET /pets/{petId}: Find pets by ID.PUT /pets/{petId}: Updates the details of a pet in the store by ID.DELETE /pets/{petId}: Delete a pet by ID.

Best Practices
Use clear and concise input instructions to achieve accurate results.
Provide detailed descriptions to ensure precise and accurate outcomes.
Avoid using short and imprecise descriptions like "build APIs" as this can cause the model to generate inaccurate results due to lack of context.
FAQs
Q1: What types of descriptions should I provide?
Provide clear and concise descriptions of the functionalities you want your API to have. Focus on the actions and the resources.
Q2: What if the generated API doesn't meet my needs?
You can edit the descriptions and regenerate the API or manually adjust the Swagger JSON and definitions provided.
Q3: What should I do if the mock URL is not updated in the UI?
Switch between the "API Definition" and "Swagger JSON" tabs to refresh the UI.
Q4: Can I test my APIs using tools like CURL?
Yes, you can use tools like QAPI, CURL or any other testing tool to execute the APIs.
Last updated
