This is the backend for Cryptrix, a Zoho Cliq extension that provides real-time cryptocurrency prices, top coins, and conversions using the CoinMarketCap API.
- Node.js installed.
- A CoinMarketCap API Key (Get a free one here).
- Ngrok (or similar) to expose your local server to the internet.
- Navigate to the project directory:
cd cryptrix-bot - Install dependencies:
npm install
- Configure environment variables:
- Open
.envfile. - Replace
YOUR_COINMARKETCAP_API_KEY_HEREwith your actual API key.
- Open
Start the server:
node index.jsThe server will run on http://localhost:3000.
Since Zoho Cliq needs to reach your server, use ngrok to create a public URL:
ngrok http 3000Copy the HTTPS URL generated by ngrok (e.g., https://a1b2c3d4.ngrok.io).
Now, connect your bot in the Zoho Cliq Developer Console.
- Go to Zoho Cliq Developer Portal.
- Click Create Bot.
- Name: Cryptrix
- Unique Name:
cryptrix_bot - Access: Personal or Organization.
- Save.
You need to create 3 commands. For each command, select Execution Type as Webhook / URL.
- Command Name:
price - Hint:
Get price of a coin (e.g., BTC) - URL:
YOUR_NGROK_URL/price(e.g.,https://a1b2c3d4.ngrok.io/price) - Method: POST
- Command Name:
top - Hint:
Get top N coins - URL:
YOUR_NGROK_URL/top - Method: POST
- Command Name:
convert - Hint:
Convert crypto (e.g., 1 BTC USD) - URL:
YOUR_NGROK_URL/convert - Method: POST
- Go to any chat in Zoho Cliq.
- Type
/price BTC. - You should see a rich card with the current Bitcoin price!
- POST /price: Expects
textorargumentswith symbol (e.g., "ETH"). - POST /top: Expects
textorargumentswith number (e.g., "10"). - POST /convert: Expects
textorargumentswith amount, symbol, target (e.g., "100 DOGE USD").