Skip to main content

Get All Bots

info

Advanced API is available in the Business Plan

Retrieve a list of all bots associated with a specific customer.


GET
https://api.deadsimplechat.com/consumer/api/v2/bots?auth=<API_KEY>

Request​

GET /consumer/api/v2/bots

Query Parameters​

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

Responses​

Success Response​

A JSON object containing a list of bots associated with the customer.

FieldDescriptionData Type
successIndicates if the operation was successfulBoolean
botsAn array of bot objectsArray of Objects
Bot Object​
FieldDescriptionData Type
isAllowedInAllChatRoomsBot access to all chat roomsBoolean
enabledIs the bot enabledBoolean
_idUnique ID of the botString
nameName of the botString
webhookURLWebhook URLString
customerID of the customer associated with botString
createdDate the bot was createdTimestamp

HTTP Status: 200 OK

Body:

{
"success": true,
"bots": [
{
"isAllowedInAllChatRooms": false,
"enabled": true,
"_id": "653d69f2357917b517297b8d",
"name": "amazingbot",
"webhookURL": "https://your-webhook-url.com/handle-webhook",
"customer": "648e1fd181cea20bd8b1581b",
"created": "2023-10-28T20:07:14.598Z"
}
]
}

Error Responses​

  • Invalid API Key:

    HTTP Status: 401 Unauthorized

    Body:

    {
    "message": "Invalid auth token"
    }
  • No API Key Specified:

    HTTP Status: 401 Unauthorized

    Body:

    {
    "message": "Unauthorized, please pass the auth token"
    }
  • Endpoint not included in your plan:

    HTTP Status: 400 Bad Request

    Body:

    {
    "message": "This endpoint is not allowed in your current plan, please upgrade your plan to access this api"
    }

Code Examples​

curl​

curl "https://api.deadsimplechat.com/consumer/api/v2/bots?auth=<API_KEY>"

JavaScript (Fetch API)​

fetch("https://api.deadsimplechat.com/consumer/api/v2/bots?auth=<API_KEY>")
.then(response => response.json())
.then(data => console.log(data));