活动

获取活动列表

可以获取的活动列表展示在公司的OA主页,让乐享更好地服务公司

接口调用说明:

GET https://lxapi.lexiangla.com/cgi-bin/v1/events

参数说明:

支持分页参数和排序:(通用说明?

参数 是否必须 默认值 说明
sort -created_at 排序参数,支持按活动的created_at, ended_at排序
page 1 当前页数
per_page 20 每页返回的数量

SDK封装方法使用示例:

$Lxapi = new \Lexiangla\Openapi\Api(AppKey, AppSecret);
$response = $Lxapi->get('events', [
    'page'=> 1,
    'per_page' => 3,
    //'sort' => 'created_at',
]);

响应document

{
    "data":[
        {
            "type":"event",
            "id":"3d36c2ba9c6511e8808b5254009b5a66",
            "attributes":{
                "title":"8000家庭电脑免费维修清理",
                "logo":"",
                "location":"腾讯大厦",
                "started_at":"2018-08-24 14:18:00",
                "ended_at":"2018-08-31 14:18:00",
                "created_at":"2018-08-10 14:18:46",
                "participant_count":0,
                "participant_count_limit":null
            },
            "links":{
                "platform":"https://xxx.lexiangla.com/teams/K10/events/3d36c2ba9c6511e8808b5254009b5a66"
            },
            "relationships":{
                "owner":{
                    "data":{
                        "type":"staff",
                        "id":"StaffID1"
                    }
                },
                "team":{
                    "data":{
                        "type":"team",
                        "id":"fc59bc42781711e797c25254002b6735"
                    }
                },
                "category":{
                    "data":{
                        "type":"category",
                        "id":"1766b8c644e011e6960a525400f26262"
                    }
                }
            }
        },
        {
            "type":"event",
            "id":"3126265e9bad11e8b9365254009b5a66",
            "attributes":{
                "title":"周末一起夜跑吧",
                "logo":"",
                "location":"腾讯大厦",
                "started_at":"2018-08-01 16:21:00",
                "ended_at":"2018-08-15 16:21:00",
                "created_at":"2018-08-09 16:21:19",
                "participant_count":1,
                "participant_count_limit":null
            },
            "links":{
                "platform":"https://xxx.lexiangla.com/teams/k100281/events/3126265e9bad11e8b9365254009b5a66"
            },
            "relationships":{
                "owner":{
                    "data":{
                        "type":"staff",
                        "id":"StaffID2"
                    }
                },
                "team":{
                    "data":{
                        "type":"team",
                        "id":"06b09aee9bad11e896de5254009b5a66"
                    }
                },
                "category":{
                    "data":{
                        "type":"category",
                        "id":"1766b8c644e011e6960a525400f26262"
                    }
                }
            }
        },
        {
            "type":"event",
            "id":"8d5040ec994e11e8a9175254009b5a66",
            "attributes":{
                "title":"机器学习读书分享会",
                "logo":"https://xxx/assets/84ca31bc994e11e881775254009b5a66",
                "location":"腾讯大厦",
                "started_at":"2018-08-06 15:58:00",
                "ended_at":"2018-08-18 15:58:00",
                "created_at":"2018-08-06 15:58:49",
                "participant_count":0,
                "participant_count_limit":12
            },
            "links":{
                "platform":"https://xxx.lexiangla.com/teams/k100145/events/8d5040ec994e11e8a9175254009b5a66"
            },
            "relationships":{
                "owner":{
                    "data":{
                        "type":"staff",
                        "id":"StaffID3"
                    }
                },
                "team":{
                    "data":{
                        "type":"team",
                        "id":"c2d93650db2211e7b87d5254002b6735"
                    }
                },
                "category":{
                    "data":{
                        "type":"category",
                        "id":"1766b8c644e011e6960a525400f26262"
                    }
                }
            }
        }
    ],
    "links":{
        "first":"https://lxapi.lexiangla.com/cgi-bin/v1/events?filter=latest&per_page=3&page=1",
        "last":"https://lxapi.lexiangla.com/cgi-bin/v1/events?filter=latest&per_page=3&page=36",
        "prev":null,
        "next":"https://lxapi.lexiangla.com/cgi-bin/v1/events?filter=latest&per_page=3&page=2"
    },
    "meta":{
        "current_page":1,
        "from":1,
        "last_page":36,
        "path":"https://lxapi.lexiangla.com/cgi-bin/v1/events",
        "per_page":"3",
        "to":3,
        "total":108
    },
    "included":[
        {
            "type":"staff",
            "id":"StaffID1",
            "attributes":{
                "name":"张三",
                "english_name":"ThreeZhang",
                "organization":"运营组"
            }
        },
        {
            "type":"staff",
            "id":"StaffID2",
            "attributes":{
                "name":"李四",
                "english_name":"FourLee",
                "organization":"产品组"
            }
        },
        {
            "type":"staff",
            "id":"StaffID3",
            "attributes":{
                "name":"王二",
                "english_name":"TwoWang",
                "organization":"开发组"
            }
        },
        {
            "type":"team",
            "id":"fc59bc42781711e797c25254002b6735",
            "attributes":{
                "name":"team1"
            }
        },
        {
            "type":"team",
            "id":"06b09aee9bad11e896de5254009b5a66",
            "attributes":{
                "name":"team2"
            }
        },
        {
            "type":"team",
            "id":"c2d93650db2211e7b87d5254002b6735",
            "attributes":{
                "name":"team3"
            }
        },
        {
            "type":"category",
            "id":"1766b8c644e011e6960a525400f26262",
            "attributes":{
                "name":"其他"
            }
        }
    ]
}

参数说明

参数 说明
event.type 资源对象类型,为event,表示资源为活动
event.id 活动实体ID
event.links.platform 投票查看页面,可以直接跳转到乐享活动详情页面
event.title 活动的标题
event.logo 活动的封面图片地址
event.location 活动地点
event.started_at 活动的开始时间
event.ended_at 活动的截止时间
event.created_at 活动的创建时间
event.participant_count 活动的参数人数
event.participant_count_limit 活动的人数限制,为null表示没有限制
owner.id 活动的创建人ID
team.id 活动所属的K吧ID
category.id 活动所属的分类ID