Skip to main content

Enable Bot In Chat Room

info

Advanced API is available in the Business Plan

This endpoint allows you to enable a bot in a specific chat room.


POST
https://api.deadsimplechat.com/consumer/api/v2/bot/:botId/chatroom/:roomId/enable

Request

POST /consumer/api/v2/bot/:botId/chatroom/:roomId/enable

Query Parameters

ParameterDescriptionData TypeRequired
authGo to Dashboard -> Developer -> Private Key is your authStringYes

Path Parameters

ParameterDescriptionData Type
botIdUnique identifier for the botString
roomIdUnique identifier for the chat roomString

Responses

Success Response

A JSON object containing the following fields:

FieldDescriptionData Type
successIndicates if the bot was successfully enabled in the chat roomBoolean
botStatusObject containing the new status of the botObject

HTTP Status: 200 OK

Body:

{
"success": true,
"botStatus": {
"status": "ENABLED"
}
}

Error Responses

  • Invalid API Key or Unauthorized Access:

    HTTP Status: 401 Unauthorized

    Body:

    {
    "success": false,
    "message": "bot not found, or you do not have permission to modify the bot"
    }

    or

    {
    "success": false,
    "message": "chatRoom not found or you do not have the permission to access"
    }
  • Server Error:

    HTTP Status: 400 Bad Request

    Body:

    {
    "message": "Error message describing the reason"
    }

Code Examples

curl

curl -X POST "https://api.deadsimplechat.com/consumer/api/v2/bot/BOT_ID/chatroom/ROOM_ID/enable?auth=API_KEY"

JavaScript (Fetch API)

fetch(`https://api.deadsimplechat.com/consumer/api/v2/bot/${botId}/chatroom/${roomId}/enable?auth=${apiKey}`, {
method: 'POST'
})