创建会话消息接口[单条]

  • 接口说明: 创建会话消息[单条]
  • 接口地址: /api/dialog/message
  • 请求方式: POST

请求参数

参数名称类型是否必须描述
dataobject基础数据
typestring数据类型,固定值 dialog_message
attributesobject数据属性
attributes. dialog_idint会话 ID
attributes. message_textstring消息内容,传消息内容时可以不传附件
attributes. attachment_idint附件 ID,传附件时可以不传消息内容

请求示例

  1. {
  2. "data": {
  3. "type": "dialog_message",
  4. "attributes": {
  5. "dialog_id": 1,
  6. "message_text": "消息内容123"
  7. }
  8. }
  9. }

返回说明

  • 成功,http 状态码 201
  • 失败,http 状态码 500

返回结果

关联数据模型字段释义请参见相应文档

参数名称类型出现要求描述
dataobject基础数据
typestring数据类型
idint消息 id
attributesobject数据属性
attributes. user_idint发送人 uid
attributes. dialog_idint会话 id
attributes. summarystring消息摘要40个字
attributes. message_textstring消息内容
attributes. message_text_htmlstring解析后的消息内容
attributes.updated_atdatetime更新时间
attributes.created_atdatetime创建时间

返回示例

  1. {
  2. "data": {
  3. "type": "dialog_message",
  4. "id": "5",
  5. "attributes": {
  6. "user_id": 1,
  7. "dialog_id": 1,
  8. "message_text": "消息内容123",
  9. "updated_at": "2020-02-18T17:09:54+08:00",
  10. "created_at": "2020-02-18T17:09:54+08:00"
  11. }
  12. }
  13. }