Zoom ERP Chatbot is a Node.js application that integrates Zoom Team Chat with Oracle ERP systems. This chatbot allows users to query and interact with Oracle ERP data directly within Zoom, providing easy access to requisitions, purchase orders. It also allow to receive real-time financial alerts.
- Oracle ERP Integration: Access requisition, purchase order, and invoice data
- Secure Authentication: JWT-based authentication with Oracle systems
- Interactive UI: Form-based inputs for data queries
- Automated Notifications: Support for tax alerts and financial notifications
- Real-time Data Access: Get up-to-date information from Oracle ERP
- Backend: Node.js, Express.js
- Authentication: JWT, OAuth
- API Communication: Axios
- Scheduling: Node-schedule, node-cron
- Environment Management: Dotenv
- Cryptography: Crypto
- Body Parsing: Body-parser
- Local Development: ngrok (for tunneling)
- Node.js (v14 or higher)
- NPM (v6 or higher)
- Zoom Developer Account
- Oracle ERP instance with API access
- Oracle IDCS credentials
- ngrok (for local development and testing)
- Clone the repository:
git clone https://github.com/yourusername/Zoom-erp-chatbot.git
cd Zoom-erp-chatbot
- Install dependencies:
npm install
- Set up environment variables:
zoom_client_id=YOUR_ZOOM_CLIENT_ID
zoom_client_secret=YOUR_ZOOM_CLIENT_SECRET
zoom_bot_jid=YOUR_ZOOM_BOT_JID
zoom_verification_token=YOUR_ZOOM_VERIFICATION_TOKEN
Zoom_SECRECT_TOKEN=YOUR_ZOOM_SECRET_TOKEN
OracleAUDIENCE=https://identity.oraclecloud.com/
OracleAPP_ID=YOUR_ORACLE_APP_ID
OracleSUB=YOUR_ORACLE_SUB
OracleJTI=YOUR_ORACLE_JTI
OracleKID=YOUR_ORACLE_KID
OracleAppClienttID=YOUR_ORACLE_APP_CLIENT_ID
OracleAppClienttSecrect=YOUR_ORACLE_APP_CLIENT_SECRET
OracleScope=YOUR_ORACLE_SCOPE
oracleIDCS_Url=YOUR_ORACLE_IDCS_URL
β οΈ Do not store credentials in plain text on production environments
- Create a private_key.pem file in the root directory with your Oracle private key:
- Generate Public and Private Key
- Prepare JWT Token and Sign in with private key
- Prepare Pem File
- Define Confidential application in IDCS
- Add certificate to Setting β Trusted partner Certificate
- Generate Private Key:
- Use keytool JWK command in window Powershell to generate public and private key:
keytool -genkey -keyalg RSA -alias INTMSUSER -keystore "C:\Users\XXXX\Downloads\tmp\NewCertificate\IntegrationUserKey.jks" -storepass <*******> -validity 365 -keysize 2048
Details of Certificate
-
Enter the distinguished name.
-
What is your first and last name? [Unknown]: XXX User
-
What is the name of your organizational unit? [Unknown]: XXXXX Apps
-
What is the name of your organization? [Unknown]: XXXXX Inc.
-
What is the name of your City or Locality? [Unknown]: San Jose
-
What is the name of your State or Province? [Unknown]: CA
-
What is the two-letter country code for this unit? [Unknown]: US
-
Is CN=XXX User, OU=XXXXX Apps, O=XXXXX Inc., L=San Jose, ST=CA, C=US correct? [no]: yes
-
Export Private Key
keytool -exportcert -alias INTMSUSER -file "C:\Users\XXXXX\Downloads\tmp\NewCertificate\IntegrationUser.cer" -keystore "C:\Users\XXXXX\Downloads\tmp\NewCertificate\IntegrationUserKey.jks" -storepass <******>
- Generate Public Key
keytool -importkeystore -srckeystore "C:\Users\XXXX\Downloads\tmp\NewCertificate\IntegrationUserKey.jks" -srcstorepass Ora@21#34cle -srckeypass XXXX -srcalias INTMSUSER -destalias INTMSUSER -destkeystore "C:\Users\XXXXX\Downloads\tmp\NewCertificate\INTMSUSER.p12" -deststoretype PKCS12 -deststorepass <*******> -destkeypass <*********>
- Prepare JWT Token and Sign in with private key
openssl pkcs12 -in "C:\Users\XXXXX\Downloads\tmp\NewCertificate\INTMSUSER.p12" -nodes -nocerts -out "C:\Users\XXXXX\Downloads\tmp\NewCertificate\INTMSUSER.pem"
Note: Ensure your terminal is in the same folder when running below command so that all files are generated in same location
Generate a Public and Private Key Pair:
Use keytool JWK command to generate public and private key
Generate Private Key:
keytool -genkey -keyalg RSA -alias INTMSUSER -keystore "IntegrationUserKey.jks" -storepass '*********' -validity 365 -keysize 2048
Details of Certificate
-
Enter the distinguished name.
-
What is your first and last name? [Unknown]: XXX User
-
What is the name of your organizational unit? [Unknown]: XXXXX Apps
-
What is the name of your organization? [Unknown]: XXXXX Inc.
-
What is the name of your City or Locality? [Unknown]: San Jose
-
What is the name of your State or Province? [Unknown]: CA
-
What is the two-letter country code for this unit? [Unknown]: US
-
Is CN=XXX User, OU=XXXXX Apps, O=XXXXX Inc., L=San Jose, ST=CA, C=US correct? [no]: yes
-
Export Private Key
keytool -exportcert -alias INTMSUSER -file "IntegrationUser.cer" -keystore "IntegrationUserKey.jks" -storepass '*********'
- Generate Public Key
keytool -importkeystore -srckeystore "IntegrationUserKey.jks" -srcstorepass '***********' -srckeypass '***********' -srcalias INTMSUSER -destalias INTMSUSER -destkeystore "INTMSUSER.p12" -deststoretype PKCS12 -deststorepass '***********' -destkeypass '**********'
- Prepare PEM File
openssl pkcs12 -in "INTMSUSER.p12" -nodes -nocerts -out "INTMSUSER.pem"
- Enter Import Password: (Give same password as given all above '***********')
-
Define Trusted application in IDCS:
- Define trusted application in IDCS with OAuth configuration as JWT assertion and Client Credentials.
Note: In this screen only u will be get all below fields
- OracleAPP_ID=YOUR_ORACLE_APP_ID
- OracleAppClienttID=YOUR_ORACLE_APP_CLIENT_ID
- OracleAppClienttSecrect=YOUR_ORACLE_APP_CLIENT_SECRET
- OracleScope=YOUR_ORACLE_SCOPE
-
Add Certificate to Trusted partner
Import by uploading IntegrationUser.cer generated above to the trusted partner certificate
-----BEGIN PRIVATE KEY----- YOUR_PRIVATE_KEY_CONTENT -----END PRIVATE KEY-----
- Create a Chatbot app in the Zoom Marketplace
- Configure the bot endpoint URL to point to your server's /ERPBot endpoint
- Set up the verification token and client credentials
- Add the necessary scopes for chat interactions
- Create a service account in Oracle Identity Cloud Service
- Generate a public/private key pair for JWT authentication
- Configure the application in IDCS with appropriate scopes
- Set up API access to the required ERP modules
For local development and testing, you can use ngrok to expose your local server to the internet:
- Install ngrok if you haven't already:
npm install -g ngrok
- Start your application:
npm start
- In a separate terminal, start ngrok:
ngrok http 4000
- Use the ngrok URL (e.g., https://your-ngrok-url.ngrok.io) as your bot endpoint URL in the Zoom Marketplace configuration.
Zoom-erp-chatbot/
βββ ERPChatBotApp.js # Main application file
βββ OracleBotToken.js # Oracle authentication handling
βββ chatbotToken.js # Zoom chatbot token management
βββ OracleRestApi.js # Oracle REST API integration
βββ ZoomBotConvo.js # Conversation flow handling
βββ sendChat.js # Functions for sending Zoom messages
βββ BotHelperFunction.js # Helper functions
βββ OracleChatBotConstant.js # Constants and message templates
βββ generateChatBody.js # Chat message body generation
βββ zoomOAuth.js # Zoom OAuth functionality
βββ private_key.pem # Oracle private key (not committed)
βββ .env # Environment variables (not committed)
βββ env_template # Environment variables Template
βββ package.json # Project dependencies
npm start
The server will run on port 4000 by default or the port specified in the PORT environment variable.
Users can interact with the bot in Zoom Team Chat to:
- Query requisition information
- Look up purchase order details
- Check invoice status
/ERPBot
Main endpoint for receiving Zoom bot events and commands.
- Method: POST
- Authentication: Zoom signature verification
- Events Handled:
- endpoint.url_validation: Validates the Zoom endpoint
- bot_notification: Handles initial bot interactions
- interactive_message_actions: Processes user selections
- chat_message.submit: Handles form submissions
/authorize Endpoint for authorizing the bot in Zoom.
- Method: GET
- Redirects: To Zoom chat with the bot
- JWT Generation: Creates a JWT token using the Oracle private key
- Bearer Token: Exchanges the JWT for an OAuth bearer token
- Token Refresh: Automatically refreshes tokens before expiration
- Request Signing: Signs all requests to Oracle APIs with the bearer token
You will need to have admin permissions on your Zoom account to add and configure the Incoming Webhook Chatbot.
- Sign in to the Zoom App Marketplace as the account administrator.
- In the top right of the window, search for Incoming Webhook.
- In your search results, find the Incoming Webhook app and click it.
- Note: If the app is not pre-approved, contact your Zoom admin to approve this app for your account. Learn more about admin app approvals.
- Click Add.
- Confirm the permissions the app requires, then click Authorize.
- The Incoming Webhook app is now added.
- Sign in to the Zoom desktop app.
- Click the Team Chat tab.
- Under Apps, find and select Incoming Webhook, or select a chat channel from above that you would like to receive messages in.
- Enter one of the following commands to make a new connection:
- /inc connect : Creates a connection and responds with a 1:1 chat message with the following details:
- endpoint
- verification token
- example cURL requests
- /inc connect : Creates a connection and responds with a 1:1 chat message with the following details:
After you have created your connection, you can then start sending POST requests to the integration's endpoint. Ensure that your POST requests include verification token to the Authorization header. Note: The endpoint only accepts POST requests.
You can schedule your POST requests to be sent at a specific time using a tool like AWS Events based on AWS Lambda or Cron or any other tool. You can schedule your requests based on Json formatted data. (refer the example in code)
/FinopschatAlert
Endpoint for triggering Ops alerts to be sent to Zoom chats.
- Method: POST
- Body: { "alertType": "ApTaxTeamAlert" }
- Authentication: Zoom signature verification
For detailed instructions on creating and configuring Zoom Chatbots, see the Zoom's Incoming Webhook Chatbot.