Create Chat Room
https://api.deadsimplechat.com/consumer/api/v1/chatroom
Create Chat Room
This endpoint allows you to create a chat room
info
The auth
query parameter is your private key. You can find it in your Dashboard under Developer -> Private Key.
Parameters | Description | |
---|---|---|
Query | ||
auth | string | Dashboard->Developer-> Private Key is your auth. token |
Body | ||
customization | object | see below for details |
customCSS | string | Custom css you want to pass to the chat room |
defaultNotificationEnabled | string | "on" or "off". When on then notification sound is enabled by default, when off the notification sound is disabled by default |
fileSharingMode | string | blank or imageSharing or fileAndImageSharing. Can be blank if blank then fileSharing is disabled. If imageSharing then only images can be shared in the chatRoom, fileAndImageSharing then images and files can be shared in the chatRoom. |
chatRoomPermissionLevel | string | default is public. possible values: public provisioned_users memebers . public: anyone can join by typing the username. provisioned_users: only the users created via api or dashboard can join. members: only the users added as members can join. |
enableChnnels | string | "on" or "off". When on, channels are enabled in the chatroom. |
moderatorOnlyOneToOneChat | string | "on" or "off", When "on" only moderators can have 1-1 chat with participants |
enableOneToOneChat | string | "on" or "off", When "on" then One to One Private Chat is enabled in the Chatroom |
preModeratedChatRoom | string | "on" or "off", When it is "on" then Pre-Moderated Chat is enabled in the chat room |
roomPassword | string | if passwordProtected is on then this value becomes required. This is the password of the room |
passwordProtected | string | on or off |
description | string | description of the chat room |
name | string | name of the chatroom |
metadata | string | metadata field with a maximum length of 1000 characters |
Responses
200
JSON
{
"success": true,
"roomId": "bbNiVFoXm",
"url": "https://deadsimplechat.com/bbNiVFoXm"
}
404
JSON
{
"error": {
"_original": {
"name": "Sample Chat Room",
"description": "Chat Room Created using API",
"passwordProtected": "on",
"mainColor": "#FFFFF",
"sidebarColor": "#281576",
"hideInviteButton": false,
"preModeratedChatRoom": false,
"fileSharingMode": "imageSharing",
"enableLikeMessage": "on",
"customization": {
"chatMessageFont": "20px"
}
},
"details": [
{
"message": "\"roomPassword\" is required",
"path": [
"roomPassword"
],
"type": "any.required",
"context": {
"label": "roomPassword",
"key": "roomPassword"
}
}
]
}
}
customization
object can be passed to customize the chat room user interface, it has the following keys
JSON
customization: {
"sidebarColor": "",
"backgroundColor": "",
"textColor": "",
"fontFamily": "",
"useCustomFont": "",
"fontSize": "",
"hideOnlineUsersList": "", // boolean true/false
"hideOnlineUserCounter": "", // boolean true/false
"hideEmojiPicker": "", // boolean true/false
"hideMarkdownSuggestions": "", // boolean true/false
"hideProfilePics": "", // boolean true/false
"hideClaimAndEditProfileButtons": "", // boolean true/false
"hideNotificationButton": "", // boolean true/false
"hideLoginFields": "", // boolean true/false
"hideHeader": "", // boolean true/false
"hideSidebar": "", // boolean true/false
"hideUniqueUserIdentifierField": true, // boolean true/false
"hideAccessTokenField": true, // boolean true/false
"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": ""
}