Event: init_user
Initialize user session with business information to start generating posts.
Request Data:
{
"business_id": "123",
"access_token": "your_jwt_token"
}Success Response: ack event
{
"msg": "User info received"
}Error Response: error event
{
"msg": "Init failed: [error_details]"
}Notes:
- Must be called before any other operations
- Stores user business information in session
- Required for authentication with backend services
Event: generate_request
Generate a new social media post based on specified preferences.
Request Data:
{
"message": "write me a post about social media",
"approximate_words": 100,
"hashtags": true,
"emojis": true,
"required_words": ["innovation", "technology"],
"forbidden_words": ["boring", "outdated"]
}Parameters:
message(string, required): The content prompt for post generationapproximate_words(number): Target word count for the posthashtags(boolean): Whether to include hashtagsemojis(boolean): Whether to include emojisrequired_words(array of strings): Words that must appear in the postforbidden_words(array of strings): Words to avoid in the post
Response Flow:
bot_typingevent with "....." - indicates processingbot_messageevent with generated post JSON
Success Response: bot_message event
{
"title": "Generated Post Title",
"description": "Generated post content..."
}Error Response: error event
{
"msg": "No message received" // if message field is empty
}
// or
{
"msg": "Generate failed: [error_details]"
}Event: toggle_hashtags
Add or remove hashtags from the last generated post.
Request Data:
{} // Empty objectResponse Flow:
bot_typingevent with "....." - indicates processingbot_messageevent with updated post
Success Response: bot_message event
{
"title": "Same Title",
"description": "Updated content with/without hashtags..."
}Error Response: error event
{
"msg": "No post generated yet"
}Notes:
- Requires a post to be generated first using
generate_request - Toggles the current hashtag state (adds if missing, removes if present)
Event: toggle_emojis
Add or remove emojis from the last generated post.
Request Data:
{} // Empty objectResponse Flow:
bot_typingevent with "....." - indicates processingbot_messageevent with updated post
Success Response: bot_message event
{
"title": "Same Title",
"description": "Updated content with/without emojis..."
}Error Response: error event
{
"msg": "No post generated yet"
}Notes:
- Requires a post to be generated first using
generate_request - Toggles the current emoji state (adds if missing, removes if present)
Event: publish_post
Send the generated post to backend for publishing to social media platforms.
Request Data:
{
"access_token": "your_jwt_token"
}Success Response: ack event
{
"msg": "Post sent to backend for publishing"
}Error Response: error event
{
"msg": "No post to publish" // if no post was generated
}
// or
{
"msg": "Publish failed: [error_details]"
}Notes:
- Requires a post to be generated first
- Sends post along with all generation preferences to backend
- Does not directly publish - sends to backend for processing
- Always start with:
init_user - Then generate:
generate_request - Optionally modify:
toggle_hashtags,toggle_emojis - Finally publish:
publish_post
Each step must complete successfully before proceeding to the next.