Skip to main content

Request Parameters

Main Structure

client
string
required
Business identifier, please confirm with MarsMind Intelligence
signature
string
required
Signature, see algorithm below
timestamp
integer
required
Timestamp (Unix seconds)
message_info
object
required
Message details, see field definitions below

message_info Fields

msg_id
string
Unique message ID, required in assist_dialog scenario
group_id
string
Group chat ID, error 400 if both from_user_id and group_id are empty
group_name
string
Group chat name
from_user_id
string
required
Sender ID
from_user_nickname
string
Sender nickname
to_user_id
string
Receiver ID
to_user_nickname
string
Receiver nickname
at_list
string[]
List of @ user IDs (only supported by auto_dialog)
content
string
Message text content, at least one of content and files_info is required
message_type
integer
required
1 = Normal message, 2 = Quoted message
event_type
string
required
auto_dialog | assist_dialog | website_dialog | cmd_dialog
from_user_type
integer
1=Robot bound account 2=Customer 3=Customer Service 4=Robot message. Required for auto_dialog
create_timestamp
integer
required
Message creation time (Unix timestamp)
files_info
File[]
Attachment list, see table below. At least one of content and files_info is required
quote
object
Quoted message object, must contain msg_id, message_type. Required if message_type=2

files_info Structure

content
string
required
File address or base64 data
file_type
string
required
“image”/“document”/“voice”

Dialogue Scenario Description

auto_dialog (Automatic Dialogue)

  • event_type = auto_dialog
  • Provide send_url, MarsMind Intelligence automatically controls message logic
  • Supports text, images, files (unique type per request)
from_user_type filling suggestion:
  • Bound objects: Fill in 1 for all except the intelligent assistant’s own messages
  • Unbound objects: Fill in 2 for external customers, 3 for company personnel

assist_dialog (Assisted Dialogue)

  • event_type = assist_dialog
  • Return message processing results in real-time
  • If parameters are consistent with auto_dialog message, context will be reused

website_dialog (Website Dialogue)

  • event_type = website_dialog
  • Message returns results immediately and merges into context, send_url not supported

cmd_dialog (Command Control)

  • event_type = cmd_dialog
  • content is specific command, currently supports:
    • stop_auto_reply: Stop automatic reply (only valid in auto_dialog scenario)

Call Example

auto_dialog

curl -X POST http://127.0.0.1:7002/custom-im/chat-messages \
-H "Content-Type: application/json" \
-d '{
  "client": "test",
  "signature": "d97b383a532466b6c6c451e76a2ab57b",
  "timestamp": 1748584621,
  "message_info": {
    "content": "",
    "message_type": 1,
    "group_id": "98765@chatroom",
    "event_type": "auto_dialog",
    "from_user_id": "aa123",
    "from_user_type": 2,
    "msg_id": "9005",
    "create_timestamp": 1748584621,
    "files_info": [
      { "content": "https://example.com/img.png", "file_type": "image" }
    ]
  }
}'