# 活动

# 创建活动

# 接口调用说明:

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

# 请求document

{
    "data": {
        "attributes": {
            "title": "api创建的活动",
            "content": "asdasdas",
            "location": "地点",
            "started_at": "2025-04-17 12:12",
            "ended_at": "2025-12-31 12:12",
            "duration": 100,
            "closed_at": "2025-12-31 12:11",
            "attend_start_at": "2025-04-17 12:12",
            "attend_end_at": "2025-12-31 12:13",
            "participant_count_limit": 11,
            "enable_random_extract": true,
            "privilege_type": 0
        },
        "relationships": {           
            "roadmap": {
                "data": {
                    "type": "roadmap",
                    "id": 2
                }
            },
            "privilege": {
                "data": [
                    {
                        "type": "staff",
                        "id": "1"
                    },
                    {
                        "type": "department",
                        "id": 1
                    },
                    {
                        "type": "contact_tag",
                        "id": 2
                    }
                ]
            },
            "session": {
                "data": [
                    {
                        "location": "地点1",
                        "started_at": "2025-04-17 12:12",
                        "ended_at": "2025-12-31 12:12",
                        "duration": 100,
                        "closed_at": "2025-12-31 12:11",
                        "attend_start_at": "2025-04-17 12:12",
                        "attend_end_at": "2025-12-31 12:13",
                        "participant_count_limit": 22,
                        "enable_random_extract": true
                    },
                    {
                        "location": "地点2",
                        "started_at": "2025-04-17 12:12",
                        "ended_at": "2026-01-31 12:12",
                        "duration": 100,
                        "closed_at": "2025-12-31 12:11",
                        "attend_start_at": "2025-04-17 12:12",
                        "attend_end_at": "2025-12-31 12:13",
                        "participant_count_limit": 33,
                        "enable_random_extract": true
                    }
                ]
            }
        }
    }
}

# 参数说明:

参数 是否必须 默认值 说明
data.attributes.title 活动名称
data.attributes.content 活动详情
data.attributes.location 活动地点
data.attributes.duration 受活动设置开关影响 活动时长
data.attributes.started_at 活动开始时间;格式:2022-12-01 00:00
data.attributes.ended_at 活动结束时间;格式:2022-12-01 00:00
data.attributes.closed_at 如果enable_random_extract为true,则为必填,反之为非必填 报名截止时间;格式:2022-12-01 00:00
data.attributes.attend_start_at 签到开始时间;格式:2022-12-01 00:00
data.attributes.attend_end_at 签到结束时间;格式:2022-12-01 00:00
data.attributes.participant_count_limit 限制上限人数,null:表示未开启人数限制;1 ~ n:表示上限人数
data.attributes.enable_random_extract participant_count_limit不为null时默认:false 报名方式;true:表示随机抽取;false:表示排队报名
data.attributes.privilege_type 0 0:表示活动公开;1:表示部分人可见,需要配合 privilege 参数使用;2:仅创建人可见
data.attributes.logo 活动图片(封面图片地址)
data.attributes.relationships.team 关联的资源对象,类型为team,表示活动所属K吧
data.attributes.relationships.privilege 关联的资源对象,类型为privilege,仅当privilege_type为1时有效,可传入多个资源staff,department,team,contact_tag对象
data.attributes.relationships.category 关联的资源对象,类型为category
data.attributes.relationships.session 活动场次信息,不传则根据入参活动信息默认创建第一个场次的信息

# SDK封装方法使用示例:


$attributes = [
    'title' => 'sdk创建活动',
    'location' => '地点',
    'started_at' => '2023-02-22 01:00',
    'ended_at' => '2023-02-23 12:00'
];
$options=[
    'content' => '活动详情',
    'closed_at' => '2023-02-22 23:00',
    'attend_start_at' => '2023-02-23 07:00',
    'attend_end_at' => '2023-02-23 12:00',
    'participant_count_limit' => 1,
    'enable_random_extract' => true ,
    'privilege_type' => 0,
    'logo' => '/img/group-building.png',
    'team_id' => 'cd73ede2026b11e8a3165254002b6735',
    'category_id' => 'f988df5e045411ea98f60a58ac130361',
    'privilege' =>[
        [
            'type' => 'staff',
            'id' => 'fwkt_zhangsan'
        ],
        [
            'type' => 'department',
            'id' => '114'
        ],
        [
            'type' => 'contact_tag',
            'id' => '65e225402a3a11eca818be0b64e7a200'
        ]
    ]

];
$Lxapi = new \Lexiangla\Openapi\Api(AppKey, AppSecret);
$response = $Lxapi->postEvent($staff_id, $attributes, $options);

# 响应document

# 200 Created 状态码
    {
        "data": {
            "type": "event",
            "id": "fb245e2c779411ed99a3d248086140f2",
            "attributes": {
                "title": "api创建的活动",
                "content": "<p>正文</p>",
                "summary": "正文",
                "location": "地点",
                "logo": "/img/group-building.png",
                "privilege_type": 1,
                "closed_at": "2022-12-31 12:11:00",
                "started_at": "2022-12-01 12:12:00",
                "ended_at": "2022-12-31 12:12:00",
                "updated_at": "2023-12-25 17:25:06",
                "participant_count": 0,
                "attendee_count": 0,
                "participant_count_limit": 11,
                "created_at": "2022-12-09 15:42:07",
                "attend_method": "qrcode",
                "attend_location": "",
                "attend_start_at": "2022-12-31 12:12:00",
                "attend_end_at": "2022-12-31 12:13:00"
            },
            "links": {
                "platform": "https://km.lexiangla.com/teams/k101390/events/fb245e2c779411ed99a3d248086140f2"
            },
            "relationships": {
                "category": {
                    "data": {
                        "type": "category",
                        "id": "e3ca3a968c4d11eb9efa966bfb362313"
                    }
                },
                "team": {
                    "data": {
                        "type": "team",
                        "id": "578f91d079c611ed8ee0f2ba6c6847f5"
                    }
                },
                "sessions": {
                    "data": [
                        {
                            "type": "event_session",
                            "id": "77311b2a24c911f0a3cc727100565181"
                        },
                        {
                            "type": "event_session",
                            "id": "77316e2224c911f09f1f727100565181"
                        }
                    ]
                }
            }
        },
    "included": [
        {
            "type": "category",
            "id": "f989f0c4045411eaae5f0a58ac130361",
            "attributes": {
                "name": "其他",
                "weight": 0
            }
        },
        {
            "type": "event_session",
            "id": "77311b2a24c911f0a3cc727100565181",
            "attributes": {
                "event_id": "7730ac9424c911f08e36727100565181",
                "sequence": 1,
                "location": "地点1",
                "privilege_type": 0,
                "closed_at": "2025-12-31 12:11:00",
                "started_at": "2025-04-17 12:12:00",
                "ended_at": "2025-12-31 12:12:00",
                "duration": 100,
                "participant_count": 0,
                "attendee_count": 0,
                "participant_count_limit": 22,
                "created_at": "2025-04-29 15:13:35",
                "updated_at": "2025-04-29 15:13:35",
                "attend_method": "qrcode",
                "attend_location": "",
                "attend_start_at": "2025-04-17 12:12:00",
                "attend_end_at": "2025-12-31 12:13:00"
            }
        },
        {
            "type": "event_session",
            "id": "77316e2224c911f09f1f727100565181",
            "attributes": {
                "event_id": "7730ac9424c911f08e36727100565181",
                "sequence": 2,
                "location": "地点2",
                "privilege_type": 0,
                "closed_at": "2025-12-31 12:11:00",
                "started_at": "2025-04-17 12:12:00",
                "ended_at": "2026-01-31 12:12:00",
                "duration": 100,
                "participant_count": 0,
                "attendee_count": 0,
                "participant_count_limit": 33,
                "created_at": "2025-04-29 15:13:35",
                "updated_at": "2025-04-29 15:13:35",
                "attend_method": "qrcode",
                "attend_location": "",
                "attend_start_at": "2025-04-17 12:12:00",
                "attend_end_at": "2025-12-31 12:13:00"
            }
        }
    ]
}

# 参数说明

参数 说明
data.type 资源对象类型,event,表示资源为活动;session,表示活动场次信息
data.id 活动实体id
data.attributes.title 活动的名称
data.attributes.content 活动详情
data.attributes.summary 活动详情摘要
data.attributes.location 活动地点
data.attributes.logo 活动图片(封面图片地址)
data.attributes.privilege_type 0:表示活动公开;1:表示部分人可见;2:仅创建人可见
data.attributes.closed_at 报名截止时间
data.attributes.started_at 活动开始时间
data.attributes.ended_at 活动结束时间
data.attributes.participant_count 活动参与人数
data.attributes.attendee_count 签到人数
data.attributes.participant_count_limit 限制上限人数
data.attributes.created_at 活动创建时间
data.attributes.updated_at 活动的更新时间
data.attributes.attend_method 活动签到方式;qrcode:表示二维码签到
data.attributes.attend_location 活动签到地点(定位签到)
data.attributes.attend_start_at 活动签到开始时间
data.attributes.attend_end_at 活动签到截止时间
data.relationships.relationships.category 活动所属分类
data.relationships.relationships.team 活动所属K吧
data.relationships.relationships.session 活动场次信息
data.included.attributes.event_id 活动场次关联的活动id
data.included.attributes.sequence 活动第几场次

# 编辑活动

# 接口调用说明:

PUT https://lxapi.lexiangla.com/cgi-bin/v1/events/{event_id}

# 请求document

{
    "data": {
        "attributes": {
            "title": "api创建的活动",
            "content": "正文",
            "location": "地点",
            "started_at": "2022-12-01 12:12",
            "ended_at": "2022-12-31 12:12",
            "duration": 111,
            "closed_at": "2022-12-31 12:11",
            "attend_start_at": "2022-12-31 12:12",
            "attend_end_at": "2022-12-31 12:13",
            "privilege_type": 1,
            "logo": "/img/group-building.png"
        },
        "relationships": {
            "team": {
                "data": {
                    "type": "team",
                    "id": "21e6898e321b11e6a2f50800278acc25"
                }
            },
            "category": {
                "data": {
                    "type": "category",
                    "id": "e3ca3a968c4d11eb9efa966bfb362313"
                }
            },
            "privilege": {
                "data": [
                    {
                        "type": "staff",
                        "id": "1"
                    },
                    {
                        "type": "department",
                        "id": 1
                    },
                    {
                        "type": "contact_tag",
                        "id": 2
                    }
                ]
            },
            "session": {
                "data": [
                    {
                        "id": "xxxxxxxx",
                        "location": "地点1",
                        "started_at": "2025-04-17 12:12",
                        "ended_at": "2025-12-31 12:12",
                        "duration": 100,
                        "closed_at": "2025-12-31 12:11",
                        "attend_start_at": "2025-04-17 12:12",
                        "attend_end_at": "2025-12-31 12:13",
                        "participant_count_limit": 22,
                        "enable_random_extract": true
                    },
                    {
                        "location": "地点2",
                        "started_at": "2025-04-17 12:12",
                        "ended_at": "2026-01-31 12:12",
                        "duration": 100,
                        "closed_at": "2025-12-31 12:11",
                        "attend_start_at": "2025-04-17 12:12",
                        "attend_end_at": "2025-12-31 12:13",
                        "participant_count_limit": 33,
                        "enable_random_extract": true
                    }
                ]
            }
        }
    }
} 

# 参数说明:

参数 是否必须 默认值 说明
event_id 活动id
data.attributes.title 无,不传递则不更新 活动名称
data.attributes.content 无,不传递则不更新 活动详情
data.attributes.location 无,不传递则不更新 活动地点
data.attributes.duration 无,不传递则不更新 活动时长
data.attributes.started_at 无,不传递则不更新 活动开始时间;格式:2022-12-01 00:00
data.attributes.ended_at 无,不传递则不更新 活动结束时间;格式:2022-12-01 00:00
data.attributes.closed_at 如果enable_random_extract创建时为true,则为必填,反之为非必填 必填:默认值为创建时或新修改的时间;非必填:无,不传递则不更新 报名截止时间;格式:2022-12-01 00:00
data.attributes.attend_start_at 无,不传递则不更新 签到开始时间;格式:2022-12-01 00:00
data.attributes.attend_end_at 无,不传递则不更新 签到结束时间;格式:2022-12-01 00:00
data.attributes.privilege_type 无,不传递则不更新 0:表示活动公开;1:表示部分人可见,需要配合 privilege 参数使用;2:仅创建人可见
data.attributes.logo 无,不传递则不更新 活动图片(封面图片地址)
data.attributes.relationships.team 无,不传递则不更新 关联的资源对象,类型为team,表示活动所属K吧,如果需要取消关联k吧请将参数设置为:relationships: { team: null}
data.attributes.relationships.privilege 无,不传递则不更新 关联的资源对象,类型为privilege,仅当privilege_type为1时有效,可传入多个资源staff,department,team,contact_tag对象
data.attributes.relationships.category 无,不传递则不更新 关联的资源对象,类型为category
data.attributes.relationships.session 活动场次信息
data.attributes.relationships.session.date.id 无,不传递则视为新建场次 活动场次id

# SDK封装方法使用示例:

$attributes=[];
$options=[
    'title' => 'sdk编辑活动',
    'location' => '地点1',
    'content' => '活动详情1',
    'started_at' => '2023-02-20 01:00',
    'ended_at' => '2023-02-21 12:00',
    'closed_at' => '2023-02-20 07:00',
    'attend_start_at' => '2023-02-20 07:00',
    'attend_end_at' => '2023-02-21 12:00',
    'privilege_type' => 1,
    'logo' => '/img/group-building.png',
    'team_id' => null ,
    'category_id' => 'e3ca3a968c4d11eb9efa966bfb362313',
    /*'privilege' =>[
                [
                    'type' => 'staff',
                    'id' => 'lisi'
                ],
                [
                    'type' => 'department',
                    'id' => '1'
                ],
                [
                    'type' => 'contact_tag',
                    'id' => '65e225402a3a11eca818be0b64e7a200'
                ]
            ]
            */

];
$Lxapi = new \Lexiangla\Openapi\Api(AppKey, AppSecret);
$response = $Lxapi->putEvent($staff_id, $events_id, $attributes, $options);

# 响应document

# 200 Created 状态码
    {
        "data": {
            "type": "event",
            "id": "fb245e2c779411ed99a3d248086140f2",
            "attributes": {
                "title": "api创建的活动",
                "content": "<p>正文</p>",
                "summary": "正文",
                "location": "地点",
                "logo": "/img/group-building.png",
                "privilege_type": 1,
                "closed_at": "2022-12-31 12:11:00",
                "started_at": "2022-12-01 12:12:00",
                "ended_at": "2022-12-31 12:12:00",
                "participant_count": 0,
                "attendee_count": 0,
                "participant_count_limit": 11,
                "created_at": "2022-12-09 15:42:07",
                "updated_at": "2023-12-25 17:18:10",
                "attend_method": "qrcode",
                "attend_location": "",
                "attend_start_at": "2022-12-31 12:12:00",
                "attend_end_at": "2022-12-31 12:13:00"
            },
            "links": {
                "platform": "https://km.lexiangla.com/teams/k101390/events/fb245e2c779411ed99a3d248086140f2"
            },
            "relationships": {
                "category": {
                    "data": {
                        "type": "category",
                        "id": "e3ca3a968c4d11eb9efa966bfb362313"
                    }
                },
                "team": {
                    "data": {
                        "type": "team",
                        "id": "578f91d079c611ed8ee0f2ba6c6847f5"
                    }
                },
                "sessions": {
                    "data": [{
                            "type": "event_session",
                            "id": "3fe2117224a311f09aa73a4282d23cd4"
                        },
                        {
                            "type": "event_session",
                            "id": "3fe2b79424a311f0a4523a4282d23cd4"
                        }
                    ]
                }
            }
        },
        "included": [{
                "type": "category",
                "id": "e3ca3a968c4d11eb9efa966bfb362313",
                "attributes": {
                    "name": "活动分类",
                    "weight": -10
                }
            },
            {
                "type": "team",
                "id": "578f91d079c611ed8ee0f2ba6c6847f5",
                "attributes": {
                    "event_id": "0c4573ae24a311f0aad6de1574af50b1",
                    "sequence": 1,
                    "location": "地点1",
                    "privilege_type": 0,
                    "closed_at": "2025-12-31 12:11:00",
                    "started_at": "2025-04-17 12:12:00",
                    "ended_at": "2025-12-31 12:12:00",
                    "duration": 100,
                    "participant_count": 0,
                    "attendee_count": 0,
                    "participant_count_limit": 22,
                    "created_at": "2025-04-29 10:40:01",
                    "updated_at": "2025-04-29 10:40:01",
                    "attend_method": "qrcode",
                    "attend_location": "",
                    "attend_start_at": "2025-04-17 12:12:00",
                    "attend_end_at": "2025-12-31 12:13:00"
                }
            },
            {
                "type": "event_session",
                "id": "3fe2b79424a311f0a4523a4282d23cd4",
                "attributes": {
                    "event_id": "0c4573ae24a311f0aad6de1574af50b1",
                    "sequence": 2,
                    "location": "地点2",
                    "privilege_type": 0,
                    "closed_at": "2025-12-31 12:11:00",
                    "started_at": "2025-04-17 12:12:00",
                    "ended_at": "2026-01-31 12:12:00",
                    "duration": 100,
                    "participant_count": 0,
                    "attendee_count": 0,
                    "participant_count_limit": 33,
                    "created_at": "2025-04-29 10:40:01",
                    "updated_at": "2025-04-29 10:40:01",
                    "attend_method": "qrcode",
                    "attend_location": "",
                    "attend_start_at": "2025-04-17 12:12:00",
                    "attend_end_at": "2025-12-31 12:13:00"
                }
            }
        ]
    }

# 参数说明

参数 说明
data.type 资源对象类型,为event,表示资源为活动
data.id 活动实体id
data.attributes.title 活动的名称
data.attributes.content 活动详情
data.attributes.summary 活动详情摘要
data.attributes.location 活动地点
data.attributes.logo 活动图片(封面图片地址)
data.attributes.privilege_type 0:表示活动公开;1:表示部分人可见;2:仅创建人可见
data.attributes.closed_at 报名截止时间
data.attributes.started_at 活动开始时间
data.attributes.ended_at 活动结束时间
data.attributes.participant_count 活动参与人数
data.attributes.attendee_count 签到人数
data.attributes.participant_count_limit 限制上限人数
data.attributes.created_at 活动创建时间
data.attributes.updated_at 活动的更新时间
data.attributes.attend_method 活动签到方式;qrcode:表示二维码签到
data.attributes.attend_location 活动签到地点(定位签到)
data.attributes.attend_start_at 活动签到开始时间
data.attributes.attend_end_at 活动签到截止时间
data.relationships.relationships.category 活动所属分类
data.relationships.relationships.team 活动所属K吧
data.relationships.relationships.session 活动场次信息
data.included.attributes.event_id 活动场次关联的活动id
data.included.attributes.sequence 活动第几场次

# 获取活动列表

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

# 接口调用说明:

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

# 参数说明:

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

支持时间范围过滤

参数 是否必须 默认值 说明
sort -created_at 排序参数,支持按活动的created_at, ended_at排序
list_type public public:公开可见的活动;all:全部活动;
page 1 当前页数
per_page 20 每页返回的数量
category_id 分类id
team_id K吧id
filter[started_at][since] 活动的开始时间:开始日期(包含)。格式:2023-03-08

当时间格式为:2023-03-08 12:00:01 时间筛选从此刻开始(包含前s)
filter[started_at][until] 活动的开始时间:结束日期(不包含)。格式:2023-03-09

当时间格式为:2023-03-09 12:00:05 时间筛选从此刻结束(不包含前s)
filter[ended_at][since] 活动的截止时间:开始日期(包含)。格式:2023-03-08

当时间格式为:2023-03-08 12:00:01 时间筛选从此刻开始(包含前s)
filter[ended_at][until] 活动的截止时间:结束日期(不包含)。格式:2023-03-09

当时间格式为:2023-03-09 12:00:05 时间筛选从此刻结束(不包含前s)
filter[updated_at][since] 活动的更新时间:开始日期(包含)。格式:2023-03-08

当时间格式为:2023-03-08 12:00:01 时间筛选从此刻开始(包含前s)
filter[updated_at][until] 活动的更新时间:结束日期(不包含)。格式:2023-03-09

当时间格式为:2023-03-09 12:00:05 时间筛选从此刻结束(不包含前s)

# 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": "58fa83601b7f11f09e3292caf815ea85",
        "attributes": {
            "title": "alex-api修改活动",
            "content": "<p>asdasdas</p>",
            "summary": "asdasdas",
            "location": "地点",
            "logo": "",
            "privilege_type": 0,
            "closed_at": "2025-12-31 12:11:00",
            "started_at": "2025-04-17 12:12:00",
            "ended_at": "2025-12-31 12:12:00",
            "duration": 100,
            "read_count": 5,
            "participant_count": 0,
            "attendee_count": 0,
            "participant_count_limit": 66,
            "created_at": "2025-04-17 19:30:21",
            "updated_at": "2025-04-18 17:15:35",
            "attend_method": "qrcode",
            "attend_location": "",
            "attend_start_at": "2025-04-17 12:12:00",
            "attend_end_at": "2025-12-31 12:13:00",
            "app_source_type": "event"
        },
        "links": {
            "platform": "https://km.lexiangla.net/events/58fa83601b7f11f09e3292caf815ea85"
        },
        "relationships": {
            "owner": {
                "data": {
                    "type": "staff",
                    "id": "v_adandxu"
                }
            },
            "category": {
                "data": {
                    "type": "category",
                    "id": "f989f0c4045411eaae5f0a58ac130361"
                }
            },
            "sessions": {
                "data": [
                    {
                        "type": "event_session",
                        "id": "5cfa34c6201411f089cb1e6424b27d63"
                    }
                ]
            }
        }
    },
    "included": [
        {
            "type": "staff",
            "id": "v_adandxu",
            "attributes": {
                "name": "v_adandxu",
                "english_name": "",
                "organization": "43 产品经理"
            }
        },
        {
            "type": "category",
            "id": "f989f0c4045411eaae5f0a58ac130361",
            "attributes": {
                "name": "其他",
                "weight": 0
            }
        },
        {
            "type": "event_session",
            "id": "5cfa34c6201411f089cb1e6424b27d63",
            "attributes": {
                "event_id": "58fa83601b7f11f09e3292caf815ea85",
                "sequence": 1,
                "location": "地点",
                "privilege_type": 0,
                "closed_at": "2025-12-31 12:11:00",
                "started_at": "2025-04-17 12:12:00",
                "ended_at": "2025-12-31 12:12:00",
                "duration": 100,
                "participant_count": 0,
                "attendee_count": 0,
                "participant_count_limit": 66,
                "created_at": "2025-04-17 19:30:21",
                "updated_at": "2025-04-18 17:15:35",
                "attend_method": "qrcode",
                "attend_location": "",
                "attend_start_at": "2025-04-17 12:12:00",
                "attend_end_at": null
            }
        }
    ]
}


# 参数说明

参数 说明
data.type 资源对象类型,为event,表示资源为活动
data.id 活动实体id
data.links.platform 活动查看页面,可以直接跳转到乐享活动详情页面
data.title 活动的标题
data.attributes.logo 活动的封面图片地址
data.attributes.location 活动地点
data.attributes.duration 活动时长
data.attributes.started_at 活动的开始时间
data.attributes.ended_at 活动的截止时间
data.attributes.created_at 活动的创建时间
data.attributes.summary 活动详情摘要
data.attributes.closed_at 活动报名截止时间
data.attributes.participant_count 活动的参数人数
data.attributes.participant_count_limit 活动的人数限制,为null表示没有限制
data.attributes.app_source_type 应用来源:event,活动;roadmap项目
data.attributes.privilege_type 活动的公开情况,0表示公开,1表示非公开,2表示仅创建者可见
data.relationships.owner.id 活动的创建人id
data.relationships.team.id 活动所属的K吧id
data.relationships.category.id 活动所属的类型id
data.included.staff.organization 所属部门
data.relationships.session 活动场次信息
data.included.attributes.event_id 活动场次关联的活动id
data.included.attributes.sequence 活动第几场次

# 获取单个活动详情

# 接口调用说明:

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

# SDK封装方法使用示例:

$Lxapi = new \Lexiangla\Openapi\Api(AppKey, AppSecret);
$response = $Lxapi->get('events/'. $events_id);

# 响应document

# 200 OK 状态码

{
    "data": {
        "type": "event",
        "id": "ce9143f20e6b11ee9c3aee7762defxxx",
        "attributes": {
            "title": "活动",
            "content": "<p>123</p>",
            "summary": "xx",
            "location": "xxx科技大厦",
            "logo": "",
            "privilege_type": 1,
            "closed_at": null,
            "started_at": "2023-06-19 14:37:00",
            "duration": 111,
            "ended_at": "2023-06-20 14:37:00",
            "participant_count": 0,
            "attendee_count": 0,
            "participant_count_limit": null,
            "created_at": "2023-06-19 14:37:48",
            "updated_at": "2023-12-25 15:30:48",
            "attend_method": "qrcode",
            "attend_location": "",
            "attend_start_at": null,
            "attend_end_at": null,
            "app_source_type": "roadmap"
        },
        "links": {
            "platform": "https://abc.lexiangla.com/events/ce9143f20e6b11ee9c3aee7762defxx7"
        },
        "relationships": {
            "owner": {
                "data": {
                    "type": "staff",
                    "id": "lisi"
                }
            },
            "category": {
                "data": {
                    "type": "category",
                    "id": "f989f0c4045411eaae5f0a58ac1303xx"
                }
            },
            "roadmap": {
                "data": {
                    "type": "roadmap",
                    "id": 3883
                }
            },
            "sessions": {
                "data": [
                    {
                        "type": "event_session",
                        "id": "3fe2117224a311f09aa73a4282d23cd4"
                    },
                    {
                        "type": "event_session",
                        "id": "3fe2b79424a311f0a4523a4282d23cd4"
                    }
                ]
            }
        }
    },
    "included": [
        {
            "type": "staff",
            "id": "lisi",
            "attributes": {
                "name": "lisi",
                "english_name": null,
                "organization": "43 产品经理"
            }
        },
        {
            "type": "category",
            "id": "f989f0c4045411eaae5f0a58ac1303xx",
            "attributes": {
                "name": "其他",
                "weight": 0
            }
        },
        {
            "type": "roadmap",
            "id": "3883",
            "attributes": {
                "title": "项目",
                "checkpoint_count": 6,
                "content": "",
                "created_at": "2023-06-19 11:05:09",
                "cover": "https://abc.lexiangla.com/assets/14c92f560e4e11ee9ce10eb333a356xx",
                "subject_type": "training",
                "status": 1
            }
        },
        {
            "type": "event_session",
            "id": "3fe2117224a311f09aa73a4282d23cd4",
            "attributes": {
                "event_id": "0c4573ae24a311f0aad6de1574af50b1",
                "sequence": 1,
                "location": "地点1",
                "privilege_type": 0,
                "closed_at": "2025-12-31 12:11:00",
                "started_at": "2025-04-17 12:12:00",
                "ended_at": "2025-12-31 12:12:00",
                "duration": 100,
                "participant_count": 0,
                "attendee_count": 0,
                "participant_count_limit": 22,
                "created_at": "2025-04-29 10:40:01",
                "updated_at": "2025-04-29 10:40:01",
                "attend_method": "qrcode",
                "attend_location": "",
                "attend_start_at": "2025-04-17 12:12:00",
                "attend_end_at": "2025-12-31 12:13:00"
            }
        }
    ]
}

# 参数说明

参数 说明
data.id 活动id
data.type 资源对象类型,为event,表示资源为活动
data.links.platform 活动查看页面,可以直接跳转到乐享活动详情页面
data.attributes.title 活动的标题
data.attributes.logo 活动的封面图片地址
data.attributes.location 活动地点
data.attributes.duration 活动时长
data.attributes.started_at 活动的开始时间
data.attributes.ended_at 活动的截止时间
data.attributes.attend_start_at 活动签到开始时间
data.attributes.attend_end_at 活动签到截止时间
data.attributes.attend_method 活动签到方式
data.attributes.attend_location 活动签到地点
data.attributes.created_at 活动的创建时间
data.attributes.updated_at 活动的更新时间
data.attributes.summary 活动详情摘要
data.attributes.content 活动详情
data.attributes.closed_at 活动报名截止时间
data.attributes.participant_count 活动的参数人数
data.attributes.participant_count_limit 活动的人数限制,为null表示没有限制
data.attributes.app_source_type 应用来源:event,活动;roadmap项目
data.attributes.privilege_type 活动的公开情况,0表示公开,1表示非公开,2表示仅创建者可见
data.relationships.owner.id 活动的创建人id
data.relationships.team.id 活动所属的K吧id
data.relationships.category.id 活动所属的类型id
data.included.staff.organization 所属部门
data.relationships.session 活动场次信息
data.included.attributes.event_id 活动场次关联的活动id
data.included.attributes.sequence 活动第几场次

# 获取活动参与成员

获取单个活动的参与人员接口

# 接口调用说明:

GET https://lxapi.lexiangla.com/cgi-bin/v1/events/{event_id}/participants

# 参数说明:

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

参数 是否必须 默认值 说明
event_id 活动id
page 1 当前页数
per_page 500 每页返回的数量,最大值2000

# SDK封装方法使用示例:

$Lxapi = new \Lexiangla\Openapi\Api(AppKey, AppSecret);
$response = $Lxapi->get('events/event_id/participants');

# 响应document

{
    "data": [
        {
            "type": "staff",
            "id": "zhangssan",
            "attributes": {
                "name": "test209",
                "english_name": null,
                "organization": "开发组 ",
                "is_joined": "已报名",
                "joined_at": "2019-11-04 16:44:26",
                "is_attended": "否",
                "attended_at": null,
                "session_id": "5bc41464201411f0ac331e6424b27d63",
                "sequence": 1
            }
        },
        {
            "type": "staff",
            "id": "lisi",
            "attributes": {
                "name": "lisi01",
                "english_name": null,
                "organization": "策划组",
                "is_joined": "已报名",
                "joined_at": "2019-11-04 16:46:52",
                "is_attended": "否",
                "attended_at": null,
                "session_id": "5bc41464201411f0ac331e6424b27d63",
                "sequence": 1
            }
        }
    ]
}

# 参数说明

参数 说明
data.id 员工id
data.attributes.name 员工姓名
data.attributes.english_name 员工英文姓名
data.attributes.organization 员工组织
data.attributes.is_joined 员工报名状态
data.attributes.joined_at 员工报名时间
data.attributes.is_attended 员工签到状态
data.attributes.attended_at 员工签到时间
data.attributes.session_id 活动场次id
data.attributes.sequence 活动第几场次

# 获取单个成员报名活动列表

# 接口调用说明:

GET https://lxapi.lexiangla.com/cgi-bin/v1/staffs/{staff_id}/events

# 参数说明:

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

参数 是否必须 默认值 说明
staff_id 员工id

# SDK封装方法使用示例:

$Lxapi = new \Lexiangla\Openapi\Api(AppKey, AppSecret);
$response = $Lxapi->get('staffs/' . $staff_id . '/events');

# 响应document

{
    "data": [
        {
            "type": "event",
            "id": "f90cf57ce01c11eda700d6b35742d49f",
            "attributes": {
                "title": "活动",
                "content": "",
                "summary": "",
                "location": "beijing",
                "logo": "https://xxx.lexiangla.com/assets/f6925ddce01c11edb170d6b35742d49f",
                "privilege_type": 0,
                "closed_at": null,
                "started_at": "2023-04-20 16:17:00",
                "ended_at": "2023-04-22 16:17:00",
                "duration": 10,
                "participant_count": 1,
                "attendee_count": 0,
                "participant_count_limit": null,
                "created_at": "2023-04-21 16:17:36",
                "updated_at": "2023-12-25 09:32:26",
                "attend_method": "qrcode",
                "attend_location": "",
                "attend_start_at": null,
                "attend_end_at": null
            },
            "links": {
                "platform": "https://xxx.lexiangla.com/teams/k101471/events/f90cf57ce01c11eda700d6b35742d49f"
            },
            "relationships": {
                "team": {
                    "data": {
                        "type": "team",
                        "id": "2771363ede7f11ed965d6eccbfd63822"
                    }
                },
                "owner": {
                    "data": {
                        "type": "staff",
                        "id": "zhangsan"
                    }
                },
                "category": {
                    "data": {
                        "type": "category",
                        "id": "f989f0c4045411eaae5f0a58ac130361"
                    }
                },
            "sessions": {
                "data": [
                    {
                        "type": "event_session",
                        "id": "3fe2117224a311f09aa73a4282d23cd4"
                    }
                ]
            }
            }
        }
    ],
    "links": {
        "first": "https://lxapi.lexiangla.com/cgi-bin/v1/staffs/zhangsan/events?per_page=1&page=1",
        "last": "https://lxapi.lexiangla.com/cgi-bin/v1/staffs/zhangsan/events?per_page=1&page=64",
        "prev": null,
        "next": "https://lxapi.lexiangla.com/cgi-bin/v1/staffs/zhangsan/events?per_page=1&page=2"
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 64,
        "path": "https://lxapi.lexiangla.com/cgi-bin/v1/staffs/zhangsan/events",
        "per_page": 1,
        "to": 1,
        "total": 64
    },
    "included": [
        {
            "type": "team",
            "id": "2771363ede7f11ed965d6eccbfd63822",
            "attributes": {
                "name": "K吧",
                "code": "k101471",
                "logo": "//static.lexiang-asset.com/build/img/default@2x-42e4b0a8.png",
                "type": 2,
                "is_secret": 1
            },
            "links": {
                "platform": "https://xxx.lexiangla.com/teams/k101471"
            }
        },
        {
            "type": "staff",
            "id": "zhangsan",
            "attributes": {
                "name": "zhangsan",
                "english_name": null,
                "organization": "43 产品经理"
            }
        },
        {
            "type": "category",
            "id": "f989f0c4045411eaae5f0a58ac130361",
            "attributes": {
                "name": "其他",
                "weight": 0
            }
        },
        {
            "type": "event_session",
            "id": "371ff4c6240f11f085ea0604c638bd11",
            "attributes": {
                "event_id": "371f5c78240f11f0b6390604c638bd11",
                "sequence": 2,
                "location": "测试2",
                "privilege_type": 0,
                "closed_at": "2025-04-28 17:05:00",
                "started_at": "2025-04-28 00:00:00",
                "ended_at": "2025-04-30 23:59:00",
                "duration": 4319,
                "participant_count": 18,
                "attendee_count": 0,
                "participant_count_limit": null,
                "created_at": "2025-04-28 17:00:21",
                "updated_at": "2025-04-28 17:00:56",
                "attend_method": "qrcode",
                "attend_location": "",
                "attend_start_at": null,
                "attend_end_at": null
            }
        }
    ]
}

# 参数说明

参数 说明
data.id 活动id
data.type 资源对象类型,event,表示资源为活动;session,表示活动场次信息
data.links.platform 活动查看页面,可以直接跳转到乐享活动详情页面
data.attributes.title 活动的标题
data.attributes.logo 活动的封面图片地址
data.attributes.content 活动详情
data.attributes.location 活动地点
data.attributes.duration 活动时长
data.attributes.summary 活动详情摘要
data.attributes.started_at 活动的开始时间
data.attributes.ended_at 活动的截止时间
data.attributes.attend_start_at 活动签到开始时间
data.attributes.attend_end_at 活动签到截止时间
data.attributes.attend_method 活动签到方式
data.attributes.attend_location 活动签到地点
data.attributes.created_at 活动的创建时间
data.attributes.updated_at 活动的更新时间
data.attributes.closed_at 活动报名截止时间
data.attributes.participant_count 活动的参数人数
data.attributes.participant_count_limit 活动的人数限制,为null表示没有限制
data.attributes.privilege_type 活动的公开情况,0表示公开,1表示非公开,2表示仅创建者可见
data.relationships.owner.id 活动的创建人id
data.relationships.team.id 活动所属的K吧id
data.relationships.category.id 活动所属的类型id
data.relationships.session 活动场次信息
included.attributes.event_id 活动场次关联的活动id
included.attributes.sequence 活动第几场次