Building an AI-powered automation bot
The AI agents API provides a comprehensive set of tools for building AI-powered automation bots. With these APIs, you can automate text-based conversations by sending and receiving messages to your bot and subscribing to bot events using webhooks.
You can build your integration in any programming language or framework. The tutorial is located in Custom CRM automation template in GitHub. To help you get started, the tutorial includes a ready-to-use Node.js service template and instructions for connecting your CRM to AI agents.
The tutorial assumes your bot is already configured. You’ll need your API key and botId. For more information, see Creating a custom CRM integration.
About the Node.js service template
Applications can be built using any programming language or technology stack.
The template project uses a ready-made template project built with Node.js and Express. The tempate provides a simple server that:
- Handles events received from the bot
- Sends visitor messages to the bot
The template includes a middleware service that acts as an intermediary between your application and the Ultimate Chat API.
Your CRM integration is typically responsible for the following actions:
- Sending messages from the customer to the bot
- Receiving events and webhooks from the bot, such as chat messages and escalations
- Sending messages from an agent to the customer in escalation scenarios using the AI agents chat widget
Quick start
To launch the template project:
- Install the dependencies:
npm install - Create your environment file by copying ".env.example" to ".env" and entering your API key, bot ID, and any other necessary configuration.
- Build and test the service:
npm run build && npm run test - Start the application:
npm run dev - Test your webhook endpoints using the provided Postman collection
CustomCrmWebhook.postman_collection.jsonto send sample requests and verify integration.