用户消息中心接口-用于接收其他用户发送给用户消息

GET /users/:id/messages
参数 类型 是否必须 说明
Access-Token 字符型 必须 用户token

Url-Parameters

参数名字 类型 是否必须 说明
id 整型 必须 用户id

消息分类,post帖子通知,group星球通知,apply星球验证消息,home消息主页面

Parameters

参数 类型 是否必须 默认值 范围 说明
offset 整型 可选 0 正整数 当前起始数
limit 整型 可选 20 正整数 每页数量
type 字符型 可选 home home、apply、group、post 消息分类

Response

200 详细见下方
204 当前没有帖子通知
400
{
    "error": "用户消息获取失败!"
}

422 
{
    "error": "参数不符合要求"
}

Response--1

{
    "data": [
        {
            "user": {
                "id": "58",
                "name": "xiaochao_php"
            },
            "post": {
                "id": "5",
                "title": "test",
                "reply_floor": "14",
                "page": 1
            },
            "message": {
                "id": "13",
                "image_url": "http:\/\/7xlx4u.com1.z0.glb.clouddn.com\/o_1b34pfog9v161kdlkkm1kt41f697.jpg?imageView2\/1\/w\/100\/h\/100"
            }
        },
        ...
    ],
    "paging": {
        first: "http://api.com/users/:id/messages?offset=0&limit=5",
        previous: "http://api.com/users/:id/messages?offset=5&limit=5",
        next: "http://api.com/users/:id/messages?offset=10&limit=5",
        final: "http://api.com/users/:id/messages?offset=35&limit=5"
    }
}

Response--2

{ 
   "data": [
        {
            "content": "叶寻退出了sdfdddc",
            "user": {
                "id": "46",
                "name": "叶寻"
            },
            "group": {
                "id": "16",
                "name": "sdfdddc"
            },
            "message": {
                "id": "28",
                "type": "4",
                "status": "1",
                "image_url": "http:\/\/7xlx4u.com1.z0.glb.clouddn.com\/o_1aqt96pink2kvkhj13111r15tr7.jpg?imageView2\/1\/w\/100\/h\/100"
            }
        },
        ...
    ],
    paging: {
        first: "http://api.com/users/:id/messages?offset=0&limit=5",
        previous: "http://api.com/users/:id/messages?offset=5&limit=5",
        next: "http://api.com/users/:id/messages?offset=10&limit=5",
        final: "http://api.com/users/:id/messages?offset=35&limit=5",
    }
}

Response--3

{
    "data": [
        {
            "user": {
                "id": "58",
                "name": "xiaochao_php"
            },
            "group": {
                "id": "358",
                "name": "私密星球_666"
            },
            "message": {
                "id": "22",
                "status": "1",
                "image_url": "http:\/\/7xlx4u.com1.z0.glb.clouddn.com\/o_1b34pfog9v161kdlkkm1kt41f697.jpg?imageView2\/1\/w\/100\/h\/100",
                "text": "24531"
            }
        },
        ...
    ],
    paging: {
        first: "http://api.com/users/:id/messages?offset=0&limit=5",
        previous: "http://api.com/users/:id/messages?offset=5&limit=5",
        next: "http://api.com/users/:id/messages?offset=10&limit=5",
        final: "http://api.com/users/:id/messages?offset=35&limit=5",
    }

}

Response--4

{
    "data": {
        "group": {
            "content": "叶寻退出了sdfdddc",
            "user": {
                "id": "46",
                "name": "叶寻"
            },
            "group": {
                "id": "16",
                "name": "sdfdddc"
            },
            "message": {
                "id": "28",
                "type": "4",
                "status": "1",
                "image_url": "http:\/\/7xlx4u.com1.z0.glb.clouddn.com\/o_1aqt96pink2kvkhj13111r15tr7.jpg?imageView2\/1\/w\/100\/h\/100"
            }
        },
        "apply": {
            "user": {
                "id": "58",
                "name": "xiaochao_php"
            },
            "group": {
                "id": "358",
                "name": "私密星球_666"
            },
            "message": {
                "id": "22",
                "status": "1",
                "image_url": "http:\/\/7xlx4u.com1.z0.glb.clouddn.com\/o_1b34pfog9v161kdlkkm1kt41f697.jpg?imageView2\/1\/w\/100\/h\/100",
                "text": "24531"
            }
        },
        "post": {
            "user": {
                "id": "3",
                "name": "午安网"
            },
            "post": {
                "id": "1",
                "title": "通过接口编辑",
                "reply_floor": "4",
                "page": 1
            },
            "message": {
                "id": "16",
                "image_url": "http:\/\/7xlx4u.com1.z0.glb.clouddn.com\/o_1aqt96pink2kvkhj13111r15tr7.jpg?imageView2\/1\/w\/100\/h\/100"
            }
        }
    },
    paging: {
        first: "http://api.com/users/:id/messages?offset=0&limit=5",
        previous: "http://api.com/users/:id/messages?offset=5&limit=5",
        next: "http://api.com/users/:id/messages?offset=10&limit=5",
        final: "http://api.com/users/:id/messages?offset=35&limit=5",
    }
}

results matching ""

    No results matching ""