Create a message

Using this method you can create a message

Create a message

POST https://api.imber.live/message/

This endpoint allows you to create a message.

Headers

NameTypeDescription

Authentication

string

Authentication token

Request Body

NameTypeDescription

urlInformation

object

Required if type of message is Link (Field described in Table 3)

fileInformation

object

Required if type of message is file (fields described in Table 2)

type

string

Type of message (Table 1)

workSpace

string

The id of the workspace which the message belongs to.

message

string

Message text

creatorType

string

contact, member or workSpace

creator

string

The ID of creator of this message (ID of member or contact)

roomId

string

The id of conversation which the message belongs to.

{
    "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
    }
}

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

Last updated