At a high level, building a bot for Community.com requires connecting inbound member messages to your own chatbot logic, then sending the bot’s replies back through Community’s messaging APIs.
Basic Requirements
Your Community plan needs to include:
- Community Webhooks enabled
- Community API access
- Access to the Send Direct Message API
Get our developer docs here
Your own:
- Backend service or middleware layer to process messages
- Chatbot built using the OpenAI Platform API or similar (not ChatGPT)
Basic Flow
1. Receive Inbound Messages
Use Community’s inbound messages webhook to receive messages from members.
2. Store the Message
Store inbound messages in your own database to maintain a reliable record of each conversation. This enables you to manage context, history, rate limits, and bot behavior.
Pro tip: Some teams also consume outbound message events so the bot has full context of any campaigns or messages sent near the time of a member’s inbound message. This helps the bot respond more accurately and avoid redundant or conflicting replies.
3. Send the Message to Your Chatbot
Use the OpenAI Platform API at platform.openai.com (or a similar service) — not the ChatGPT consumer product. This is where you configure the bot’s instructions, connect your knowledge base, and define how it should respond.
4. Generate a Response
Your backend sends the inbound message and any relevant context to the chatbot to generate a reply.
5. Send the Response Back to the Member
Your backend formats the chatbot’s reply and sends it to the member using Community’s Send Direct Message API.
Important Considerations
Keep Messages Appropriate for Text
Bot responses must be optimized for SMS. Keep the following in mind:
- Keep responses short, conversational, and easy to read. Avoid long paragraphs or complex answers.
- Responses must be 400 characters or fewer. If a longer reply is necessary, break it into a sequence of messages, each within the 400-character limit.
Avoid TCPA Violations
The bot must not send prohibited marketing content, misleading language, or anything that could violate TCPA or other messaging compliance requirements. Keep responses informational, consent-aware, and tied directly to the member’s inbound message. If a member tries to take the conversation off-topic, redirect them appropriately.
Define When the Bot Should Respond
Be deliberate about when the bot responds and when it stays silent. Not every inbound message warrants a bot reply. Define clear entrance criteria, such as:
- Only respond to specific keywords or intents
- Only respond to direct questions
- Only respond during specific campaigns or workflows
Add Rate Limiting and Session Controls
Set boundaries on how much the bot can interact within a session:
- Maximum number of bot replies per member
- Maximum number of replies within a time window
- When to end a bot session
- When to stop responding or suppress further replies
Follow Standard Security Practices
Protect all API keys and credentials. Never expose them in client-side code, logs, or unsecured systems. Use secure backend services, environment variables, access controls, and monitoring.
Summary
Community sends a webhook on every inbound message to your backend. Your backend decides whether to route it to your chatbot, then formats and sends the response back to the member via Community’s Send Direct Message API.
The most important parts are keeping the experience text-friendly, compliant, secure, and intentional about when the bot should and should not respond.
Need to upgrade your plan to access this feature? Reach out to yourfriends@community.com or your account manager