Androidの 社区接口返回json格式

1. 根据名称搜索房间信息

/api/v1/directory

{
    "result": [{
        "_id": "GENERAL",
        "ts": "2021-04-08T08:09:12.657Z",
        "t": "c",
        "name": "gong1-gao4",
        "usersCount": 16,
        "default": true,
        "lastMessage": {
            "msg": "[py呵呵][py呵呵][py呵呵][py呵呵]",
            "_id": "1620813743435d91bd995-ce4a-47e8-a9f8-ad77d9b966b6",
            "rid": "GENERAL",
            "ts": "2021-05-12T10:02:22.120Z",
            "u": {
                "_id": "ovLcEhgzhYdbp8Go3",
                "username": "yatuizi",
                "username_color": "black"
            },
            "mentions": [],
            "channels": [],
            "_updatedAt": "2021-05-12T10:02:22.125Z"
        },
        "fname": "公告"
    }],
    "count": 1,
    "offset": 0,
    "total": 1,
    "success": true
}

2. 发送消息

/api/v1/method.call/sendMessage

文本消息发送
{
    "success": true,
    "message": "{
               \"msg\":\"result\",
               \"result\":{
                     \"msg\":\"切切切\",
                     \"extra\":{\"custom_emoji_id\":\"\",\"type\":\"message\"},
                     \"_id\":\"1622108033766994e7637-afc9-4142-8098-184c52196e97\",
                     \"rid\":\"EnW2tLmrFEqt9T234\",
                     \"ts\":{\"$date\":1622108034217},
                     \"u\":{\"_id\":\"kEkuexjZyq8CMptMf\",\"username\":\"13311919563\",
                                     \"username_color\":\"black\"},
                    \"mentions\":[],
                    \"channels\":[],
                    \"_updatedAt\":{\"$date\":1622108034224}
                   }
          }"
}
Http网址消息发送
{
    "success": true,
    "message": "{
               \"msg\":\"result\",
               \"result\": {
                         \"msg\":\"http://www.baidu.com\",
                         \"extra\":{\"custom_emoji_id\":\"\",\"type\":\"message\"},
                         \"_id\":\"16221088922085dab03db-7589-4a7c-93f0-728c2765a06a\",
                         \"rid\":\"EnW2tLmrFEqt9T234\",
                         \"ts\":{\"$date\":1622108892665},
                         \"u\":{\"_id\":\"kEkuexjZyq8CMptMf\",\"username\":\"13311919563\",
                                           \"username_color\":\"black\"},
                         \"urls\": [{  "url":"http://www.bilibili.com",
                                       "meta":{ "pageTitle":"哔哩哔哩 (゜-゜)つロ 干杯~-bilibili",
                                                      "description":"bilibili是国内知名的视......到许多欢乐。"},
                                       "headers":{"contentType":"text/html; charset=utf-8"},
                                       "parsedUrl":{"host":"www.bilibili.com","hash":null,"pathname":"/",
                                                           "protocol":"http:","port":null,"query":null,"search":null,
                                                          "hostname":"www.bilibili.com"}
                                 }],
                         \"mentions\":[],
                         \"channels\":[],
                         \"_updatedAt\":{\"$date\":1622108892673}
                    }
                }"
}
收藏表情,图片 -消息发送
{
    "message": "{
                \"msg\":\"result\",
                \"result\":{
                        \"msg\":\"\",
                        \"extra\":{\"type\":\"custom_emoji\",
                                      \"url\":\"http://pychat-dev.oss-cn-shanghai.aliyuncs.com/b845eec3e629902697810a5175082c20\",
                                      \"file_type\":\"image/jpeg\"},
                        \"_id\":\"1622112344736696b1ddd-67ef-4bd2-9f67-61a17bf3085b\",
                        \"rid\":\"EnW2tLmrFEqt9T234\",
                        \"ts\":{\"$date\":1622112345198},
                        \"u\":{\"_id\":\"kEkuexjZyq8CMptMf\",\"username\":\"13311919563\",
                               \"username_color\":\"black\"},
                        \"mentions\":[],
                        \"channels\":[],
                        \"_updatedAt\":{\"$date\":1622112345242}
                 }
          }",
    "success": true
}

3. 发送图片消息-上传图片

/api/v1/rooms.upload/EnW2tLmrFEqt9T234 (roomId)

{
    "message": {
        "_id": "THDLkWtCBTjZkoanX",
        "rid": "EnW2tLmrFEqt9T234",
        "ts": "2021-05-27T10:25:53.402Z",
        "msg": "",
        "file": {
            "_id": "tunYKc5WSSGce8gE4",
            "name": "d0d52c23dd76b774.jpg",
            "type": "image/*"
        },
        "attachments": [{
            "title": "d0d52c23dd76b774.jpg",
            "type": "file",
            "title_link": "/file-upload/tunYKc5WSSGce8gE4/d0d52c23dd76b774.jpg",
            "title_link_download": true,
            "image_url": "/file-upload/tunYKc5WSSGce8gE4/d0d52c23dd76b774.jpg",
            "image_type": "image/*",
            "image_size": 29129,
            "image_preview": "/9j/2wBDAAYEBQYFBAYGBQYHBwYIChAKCgkJChQODwwQFxQYGBcUFhYaHSUfGhsjHBYWICwgIyYnKSopGR8tMC0oMCUoKSj/2wBDAQcHBwoIChMKChMoGhYaKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCj/wAARCAAUACADASIAAhEBAxEB/8QAGQAAAgMBAAAAAAAAAAAAAAAAAAMEBQcG/8QAJhAAAgICAgAEBwAAAAAAAAAAAQIAAwQFESESMWFxFCIkUVJykv/EABkBAAEFAAAAAAAAAAAAAAAAAAUAAgMEBv/EAB0RAAICAwADAAAAAAAAAAAAAAECAAMFERIGMUH/2gAMAwEAAhEDEQA/AEJq+R0kRkawAdpOv0W/0OeSCxpAHm5ElZmVojz9XTx7iJPIkD8NHnCuV6EzS/XL+MrsjXL38s0S3K0Dtx8XWD7iRrK9JYT4cur+hC1OeSDLsO5+TL6brERyGPXqZV3ZdzhuWPn9zCEydYG4esY8+45cdbquXZ+fRjEZFIqQlGcH9oQkqk7lNp//2Q=="
        }],
        "u": {
            "_id": "kEkuexjZyq8CMptMf",
            "username": "13311919563",
            "username_color": "black"
        },
        "_updatedAt": "2021-05-27T10:25:53.413Z"
    },
    "success": true
}

4. 收藏表情--上传图片

/api/steampy_commnuty/custom_emoji

{"success":true}

5. 收藏表情--查询列表

/api/steampy_commnuty/custom_emoji/list?uid=kEkuexjZyq8CMptMf&page=1&size=20

{
    "success": true,
    "data": {
        "list": [{
            "_id": "60af76a7928c9280fb29f2f0",
            "uid": "kEkuexjZyq8CMptMf",
            "emoji_id": {
                "_id": "60af76a7928c9280fb29f2ef",
                "data": "http://pychat-dev.oss-cn-shanghai.aliyuncs.com/67845aa485c4fe67e5effee4d1575c3c",
                "type": "image/jpeg",
                "hash": "67845aa485c4fe67e5effee4d1575c3c",
                "created_at": "2021-05-27T10:38:31.501Z",
                "updated_at": "2021-05-27T10:38:31.501Z",
                "__v": 0
            },
            "created_at": "2021-05-27T10:38:31.505Z",
            "updated_at": "2021-05-27T10:38:31.505Z",
            "__v": 0
        }],
        "count": 5
    }
}

6. 收藏表情--删除

/api/steampy_commnuty/custom_emoji/60af76a7928c9280fb29f2f0?uid=kEkuexjZyq8CMptMf

{"success":true}
上传单独图片,消息返回JSON
{
    "msg": "",
    "itemType": 2,
    "pinned": false,
    "attachments": [
        {
            "audioSize": 0,
            "title_link_download": true,
            "image_size": 95609,
            "image_url": "/file-upload/ryXFeN7RYeuxx6kyA/steampy_chat_emotion975db486-9eef-4fda-a1ff-0f8860e50a6e.jpg",
            "image_preview": "/9j/2wBDAAYEBQYFBAYGBQYHBwYIChAKCgkJChQODwwQFxQYGBcUFhYaHSUfGhsjHBYWICwgIyYnKSopGR8tMC0oMCUoKSj/2wBDAQcHBwoIChMKChMoGhYaKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCj/wAARCAAgABIDASIAAhEBAxEB/8QAGQAAAgMBAAAAAAAAAAAAAAAAAAUGBwgE/8QAIxAAAgEEAgICAwAAAAAAAAAAAQMCAAQFERIhIjEGkRMVcf/EABYBAQEBAAAAAAAAAAAAAAAAAAIDAf/EABwRAQEAAgIDAAAAAAAAAAAAAAEAAhESEwQxUf/aAAwDAQACEQMRAD8Am/xzOpymKRclYH5I+RJpki3w1k0XMUQLZ+zv1Wa8JlMghK7VT2nXQEfQFS5eRyqLCVwgybMDRiDvVF8nAdI0OzddpytnvpwA/tFZuln8oZEkvBJ9aoqvbhbyfl2YNX66SpIZHmw8Z8x0RUour63s1mNpEAyHeqrVN5JjATI6FMGX5K+IPZ6qLgSAPRO5ZMbPjH6op1bfCWut1M2fOAl9iit4yv/Z",
            "title_link": "/file-upload/ryXFeN7RYeuxx6kyA/steampy_chat_emotion975db486-9eef-4fda-a1ff-0f8860e50a6e.jpg",
            "title": "steampy_chat_emotion975db486-9eef-4fda-a1ff-0f8860e50a6e.jpg",
            "type": "file",
            "videoSize": 0,
            "image_type": "image/*",
            "timestamp": 0
        }
    ],
    "synced": false,
    "unread": false,
    "parseUrls": false,
    "rid": "EnW2tLmrFEqt9T234",
    "file": {
        "name": "steampy_chat_emotion975db486-9eef-4fda-a1ff-0f8860e50a6e.jpg",
        "_id": "ryXFeN7RYeuxx6kyA",
        "type": "image/*"
    },
    "channels": [],
    "u": {
        "_id": "G3yN4DtYqfsuGtseg",
        "username": "userXb"
    },
    "mentions": [],
    "groupable": false,
    "_id": "fg6pdqxqKiCTogt24",
    "_updatedAt": {
        "$date": 1622019128502
    },
    "ts": {
        "$date": 1622019128492
    }
}
引用---上传单独图片,消息返回JSON
{
    "msg": "[ ](http://100/channel/xin1-shou3-hu4-zhu4?msg=1622020960777ab1a5d78-f526-41c7-b7a9-c2a76b0a30dc) bnnnnmm",
    "itemType": 2,
    "pinned": false,
    "attachments": [
        {
            "audioSize": 0,
            "author_icon": "/avatar/userXb",
            "author_name": "userXb",
            "attachments": [],
            "title_link_download": false,
            "image_size": 0,
            "message_link": "http://100/channel/xin1-shou3-hu4-zhu4?msg=1622020960777ab1a5d78-f526-41c7-b7a9-c2a76b0a30dc",
            "text": "",
            "videoSize": 0,
            "timestamp": 0,
            "ts": {
                "$date": 1622020959991
            }
        }
    ],
    "synced": false,
    "unread": false,
    "parseUrls": false,
    "rid": "WMJcJCheatPQoQBGx",
    "urls": [
        {
            "ignoreParse": true,
            "url": "http://100/channel/xin1-shou3-hu4-zhu4?msg=1622020960777ab1a5d78-f526-41c7-b7a9-c2a76b0a30dc"
        }
    ],
    "channels": [],
    "u": {
        "_id": "kEkuexjZyq8CMptMf",
        "username": "13311919563"
    },
    "extra": {
        "type": "custom_emoji"
    },
    "mentions": [],
    "groupable": false,
    "_id": "16220242923434f4a10f8-206a-4a32-b6f6-990a111880cd",
    "_updatedAt": {
        "$date": 1622024287642
    },
    "ts": {
        "$date": 1622024287576
    }
}

7. 消息列表

/api/v1/method.call/loadHistory

普通文本消息
1624855161(1).jpg
{
    "message": {
        "msg": "result",
        "id": "14",
        "result": {
            "messages": [{
                "_id": "sgz3R6WYxuSB3FG5e",
                "rid": "H8jzbwpxkAYT4C7Du",
                "msg": "1222222",
                "ts": {
                    "$date": 1624853804378
                },
                "u": {
                    "_id": "kEkuexjZyq8CMptMf",
                    "username": "13311919563",
                    "username_color": "black",
                    "name": "李元芳来了"
                },
                "mentions": [],
                "channels": [],
                "_updatedAt": {
                    "$date": 1624853804391
                }
            }],
            "unreadNotLoaded": 0
        }
    },
    "success": true
}
创建讨论串消息
1624857799(1).jpg
{
    "message": {
        "msg": "result",
        "id": "14",
        "result": {
            "messages": [{
                "_id": "53wSMvBLDQahDyk2J",
                "t": "discussion-created",
                "rid": "H8jzbwpxkAYT4C7Du",
                "ts": {
                    "$date": 1624853826296
                },
                "msg": "1222222",
                "u": {
                    "_id": "G3yN4DtYqfsuGtseg",
                    "username": "userXb",
                    "name": "松下问童子"
                },
                "groupable": false,
                "drid": "n2H637AiXxdAp3sWp",
                "attachments": [{
                    "text": "1222222",
                    "author_name": "13311919563",
                    "author_icon": "/avatar/13311919563",
                    "message_link": "/channel/a1-gen1-ting2-ren2-ju4-ji2-di4?msg=sgz3R6WYxuSB3FG5e",
                    "ts": {
                        "$date": 1624853804378
                    }
                }],
                "_updatedAt": {
                    "$date": 1624853826418
                },
                "dcount": 1,
                "dlm": {
                    "$date": 1624853826303
                }
            }],
            "unreadNotLoaded": 0
        }
    },
    "success": true
}

一级标题

二级标题

五级标题
  • 列表第一项
  • 列表第二项
  1. 有序列表第一项
  2. 有序列表第二项
    标题
    [图片上传失败...(image-bb222b-1622027165745)]
    斜体
    粗体

引用段落

代码块

你可能感兴趣的:(Androidの 社区接口返回json格式)