API to create chatroom

Using the following endpoint to create the chat room:

URL:

https://deadsimplechat.com/consumer/api/v1/chatroom?auth=<auth_token>

HTTP METHOD: POST

BODY:

{
	"name": "chatroom name",
	"description": "chat room description",
	"passwordProtected": false,
	"roomPassword": "password",
	"mainColor": "#hexcolor",
	"sidebarColor": "hexColor",
	"hideInviteButton": false,
	"preModeratedChatRoom": false,
	"customCSS": ""
}

Response:

{
    "success": true,
    "roomId": "FQAgkE2fA",
    "url": "https://deadsimplechat.com/FQAgkE2fA"
}

Javascript Code Sample:

$.ajax({
  method: "POST",
  url: " https://deadsimplechat.com/consumer/api/v1/chatroom?auth=replace_with_authtoken",
  data: {
	"name": "chatroom name",
	"description": "chat room description",
	"passwordProtected": false,
	"roomPassword": "password",
	"mainColor": "#f8f8f8",
	"sidebarColor": "#00000",
	"hideInviteButton": false,
	"preModeratedChatRoom": false,
	"customCSS": "#already-have-account span {display: none;}"
}).then(function(success) {
  console.log(success)
}).catch(function(ex) {
  console.log("Error", ex.responseJSON)
})

Customisation Options

You can pass the "customization" object to further customize the chatroom settings, these options are the same that are available in the customize tab of the chat room settings page.

{
  "name": "chatroom name",
  "description": "chat room description",
  "passwordProtected": false,
  "roomPassword": "password",
  "mainColor": "#hexcolor",
  "sidebarColor": "hexColor",
  "hideInviteButton": false,
  "preModeratedChatRoom": false,
  "customCSS": "",
  "customization": {
    "sidebarColor": "",
    "backgroundColor": "",
    "textColor": "",
    "fontFamily": "",
    "useCustomFont": "",
    "fontSize": "",
    "hideOnlineUsersList": "",
    "hideOnlineUserCounter": "",
    "hideEmojiPicker": "",
    "hideMarkdownSuggestions": "",
    "hideProfilePics": "",
    "hideClaimAndEditProfileButtons": "",
    "hideNotificationButton": "",
    "hideLoginFields": "",
    "hideHeader": "",
    "hideSidebar": "",
    "collapseSidebar": "",
    "sidebarTextColor": "",
    "chatMessageColor": "",
    "chatUnapprovedMessageBackgroundColor": "",
    "buttonColor": "",
    "buttonHoverColor": "",
    "buttonTextColor": "",
    "chatMessageFont": "",
    "usernameFont": "",
    "modalFont": "",
    "timestampFont": "",
    "sendButtonIconColor": "",
    "sendButtonBackgroundColor": "",
    "textareaBackgroundColor": "",
    "textareaBorderColor": "",
    "textareaFontSize": "",
    "chatMessageHoverColor": "",
    "usernameFontSize": "",
    "timestampFontSize": "",
    "sidebarHeadingTextColor": "",
    "headerBackgroundColor": "",
    "headerTextColor": "",
    "headerFontSize": "",
    "modalBackgroundColor": "",
    "modalFontColor": "",
    "modalHeadingFontSize": "",
    "modalLabelFontSize": ""
  }
}

Example

All the font-size values are in px.

{
  "name": "chatroom name",
  "description": "chat room description",
  "passwordProtected": false,
  "roomPassword": "password",
  "mainColor": "#hexcolor",
  "sidebarColor": "hexColor",
  "hideInviteButton": false,
  "preModeratedChatRoom": false,
  "customCSS": "",
  "customization": {
    "backgroundColor": "#b06d6d",
    "buttonColor": "#1a72d5",
    "buttonHoverColor": "#29609e",
    "buttonTextColor": "#f0ebeb",
    "chatMessageColor": "#c27a7a",
    "chatMessageFont": "Roboto",
    "chatMessageHoverColor": "#d4c9c9",
    "chatUnapprovedMessageBackgroundColor": "#cfcfbf",
    "collapseSidebar": true,
    "fontFamily": "Roboto",
    "fontSize": "12",
    "headerBackgroundColor": "#b06d6d",
    "headerFontSize": 20,
    "headerTextColor": "#dbbdbd",
    "hideClaimAndEditProfileButtons": true,
    "hideEmojiPicker": true,
    "hideHeader": true,
    "hideInviteUserButton": true,
    "hideLoginFields": true,
    "hideMarkdownSuggestions": true,
    "hideNotificationButton": true,
    "hideOnlineUserCounter": true,
    "hideOnlineUsersList": true,
    "hideProfilePics": true,
    "hideSidebar": true,
    "modalBackgroundColor": "#b06d6d",
    "modalFont": "Open Sans",
    "modalFontColor": "#dbbdbd",
    "modalHeadingFontSize": "12",
    "modalLabelFontSize": "12",
    "sendButtonBackgroundColor": "#bfe8cd",
    "sendButtonIconColor": "#ededed",
    "sidebarColor": "#d7d4e2",
    "sidebarHeadingTextColor": "#a39595",
    "sidebarTextColor": "#c0afaf",
    "textColor": "#dbbdbd",
    "textareaBackgroundColor": "#d2d0d0",
    "textareaBorderColor": "#2e2e2e",
    "textareaFontSize": "10",
    "timestampFont": "Roboto",
    "timestampFontSize": "13",
    "useCustomFont": false,
    "usernameFont": "Roboto",
    "usernameFontSize": "12"
  }
}
Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.

Still need help? Contact Us Contact Us