Create a message

Using this method you can create a message

post
Create a message

https://api.imber.live/message/
This endpoint allows you to create a message.
Request
Response
Request
Headers
Authentication
required
string
Authentication token
Body Parameters
urlInformation
optional
object
Required if type of message is Link (Field described in Table 3)
fileInformation
optional
object
Required if type of message is file (fields described in Table 2)
type
required
string
Type of message (Table 1)
workSpace
required
string
The id of the workspace which the message belongs to.
message
required
string
Message text
creatorType
required
string
contact, member or workSpace
creator
required
string
The ID of creator of this message (ID of member or contact)
roomId
required
string
The id of conversation which the message belongs to.
Response
200: OK
Message successfully created.
{
"success": true,
"data": {
"type": 0,
"_id": "600ead5b7d85be182a1a9d86",
"creator": "5fec142af3ef387502f440e5",
"creatorType": "user",
"message": "یا باید از یک اکانت استفاده کنیم ",
"workSpace": "5f00a44d8e844b5a746f90b3",
"roomId": "600eacdf7d85be182a1a9af0",
"organization": "5f00a44d8e844b5a746f90b1",
"createdAt": "2021-01-25T11:36:59.890Z",
"updatedAt": "2021-01-25T11:36:59.890Z",
"__v": 0
}
}
404: Not Found
Could not find a cake matching this query.
{ "message": "Ain't no cake like that."}

Types (Table 1)

Type

Description

0

Simple text

1

Photo

2

Video

3

File

4

Voice

5

Event

6

Link

7

Deleted

8

Map

9

Emoji

10

Form

11

Markdown

fileInformation (Table 2)

Field

Description

originalName

The original name of file to display

format

Type of file (png, jpg or ...)

fileSize

In KB

text

urlInformation (Table 3)

Filed

Description

url

The exact URL

favicon

The favicon of target website (use for link preview)

description

Description of website (use for link preview)

Note : When type of message is file or URL, the exact URL of Link of file should be placed also in message value