# 活动

# 创建活动

# 接口调用说明:

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

# 请求document

{
    "data": {
        "attributes": {
            "title": "api创建的活动",
            "content": "正文",
            "location": "地点",
            "started_at": "2022-12-01 12:12",
            "ended_at": "2022-12-31 12:12",
            "duration":100,
            "closed_at": "2022-12-31 12:11",
            "attend_start_at": "2022-12-31 12:12",
            "attend_end_at": "2022-12-31 12:13",
            "participant_count_limit": 11,
            "enable_random_extract": true,
            "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
                    }
                ]
            }
        }
    }
} 

# 参数说明:

参数 是否必须 默认值 说明
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

# 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"
				}
			}
		}
	},
	"included": [
		{
			"type": "category",
			"id": "e3ca3a968c4d11eb9efa966bfb362313",
			"attributes": {
				"name": "活动分类",
				"weight": -10
			}
		},
		{
			"type": "team",
			"id": "578f91d079c611ed8ee0f2ba6c6847f5",
			"attributes": {
				"name": "K吧2",
				"code": "k101390",
				"logo": "//static.lexiang-asset.net/build/img/default@2x-42e4b0a8.png",
				"type": 2,
				"is_secret": 0
			},
			"links": {
				"platform": "https://km.lexiangla.com/teams/k101390"
			}
		}
	]
}

# 参数说明

参数 说明
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吧

# 编辑活动

# 接口调用说明:

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
                    }
                ]
            }
        }
    }
} 

# 参数说明:

参数 是否必须 默认值 说明
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

# 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"
				}
			}
		}
	},
	"included": [
		{
			"type": "category",
			"id": "e3ca3a968c4d11eb9efa966bfb362313",
			"attributes": {
				"name": "活动分类",
				"weight": -10
			}
		},
		{
			"type": "team",
			"id": "578f91d079c611ed8ee0f2ba6c6847f5",
			"attributes": {
				"name": "K吧2",
				"code": "k101390",
				"logo": "//static.lexiang-asset.net/build/img/default@2x-42e4b0a8.png",
				"type": 2,
				"is_secret": 0
			},
			"links": {
				"platform": "https://km.lexiangla.com/teams/k101390"
			}
		}
	]
}

# 参数说明

参数 说明
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吧

# 获取活动列表

可以获取的活动列表展示在公司的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": "f2ae74bc0e7011eeb6b7de5381fd83xx",
            "attributes": {
                "title": "活动1",
                "summary": "",
                "logo": "",
                "location": "科技大厦1",
                "started_at": "2023-06-19 15:13:00",
                "ended_at": "2023-06-21 15:13:00",
                "duration":100,
                "created_at": "2023-06-19 15:14:36",
                "participant_count": 1,
                "participant_count_limit": 1,
                "privilege_type": 0,
                "closed_at": null,
                "app_source_type": "event"
            },
            "links": {
                "platform": "https://abc.lexiangla.com/events/f2ae74bc0e7011eeb6b7de5381fd83xx"
            },
            "relationships": {
                "owner": {
                    "data": {
                        "type": "staff",
                        "id": "lisi"
                    }
                },
                "category": {
                    "data": {
                        "type": "category",
                        "id": "f989f0c4045411eaae5f0a58ac1303xx"
                    }
                }
            }
        },
        {
            "type": "event",
            "id": "9fcea8de0e7011ee85973a9f1b55fdxx",
            "attributes": {
                "title": "活动2",
                "summary": "",
                "logo": "",
                "location": "科技大厦2",
                "started_at": "2023-06-19 15:11:00",
                "ended_at": "2023-06-21 15:11:00",
                "duration":100,
                "created_at": "2023-06-19 15:12:17",
                "participant_count": 1,
                "participant_count_limit": null,
                "privilege_type": 0,
                "closed_at": null,
                "app_source_type": "event"
            },
            "links": {
                "platform": "https://abc.lexiangla.com/events/9fcea8de0e7011ee85973a9f1b55fdxx"
            },
            "relationships": {
                "owner": {
                    "data": {
                        "type": "staff",
                        "id": "wangwu"
                    }
                },
                "category": {
                    "data": {
                        "type": "category",
                        "id": "e772137a09f011eab30d0a58ac1302xx"
                    }
                }
            }
        },
        {
            "type": "event",
            "id": "ce9143f20e6b11ee9c3aee7762def0xx",
            "attributes": {
                "title": "活动3",
                "summary": "123",
                "logo": "",
                "location": "但是",
                "started_at": "2023-06-19 14:37:00",
                "ended_at": "2023-06-20 14:37:00",
                "duration":100,
                "created_at": "2023-06-19 14:37:48",
                "participant_count": 0,
                "participant_count_limit": null,
                "privilege_type": 1,
                "closed_at": null,
                "app_source_type": "roadmap"
            },
            "links": {
                "platform": "https://abc.lexiangla.com/events/ce9143f20e6b11ee9c3aee7762def0xx"
            },
            "relationships": {
                "owner": {
                    "data": {
                        "type": "staff",
                        "id": "lisi"
                    }
                },
                "category": {
                    "data": {
                        "type": "category",
                        "id": "f989f0c4045411eaae5f0a58ac1303xx"
                    }
                },
                "roadmap": {
                    "data": {
                        "type": "roadmap",
                        "id": 3883
                    }
                }
            }
        }
    ],
    "links": {
        "first": "https://lxapi.lexiangla.com/cgi-bin/v1/events?list_type=all&per_page=3&page=1",
        "last": "https://lxapi.lexiangla.com/cgi-bin/v1/events?list_type=all&per_page=3&page=1369",
        "prev": null,
        "next": "https://lxapi.lexiangla.com/cgi-bin/v1/events?list_type=all&per_page=3&page=2"
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 1369,
        "path": "https://lxapi.lexiangla.com/cgi-bin/v1/events",
        "per_page": 3,
        "to": 3,
        "total": 4107
    },
    "included": [
        {
            "type": "staff",
            "id": "lisi",
            "attributes": {
                "name": "lisi",
                "english_name": null,
                "organization": "140 前端开发"
            }
        },
        {
            "type": "staff",
            "id": "wangwu",
            "attributes": {
                "name": "wangwu",
                "english_name": null,
                "organization": "43 产品经理"
            }
        },
        {
            "type": "category",
            "id": "f989f0c4045411eaae5f0a58ac1303xx",
            "attributes": {
                "name": "其他",
                "weight": 0
            }
        },
        {
            "type": "category",
            "id": "e772137a09f011eab30d0a58ac1302xx",
            "attributes": {
                "name": "分类",
                "weight": -11
            }
        },
        {
            "type": "roadmap",
            "id": "3883",
            "attributes": {
                "title": "项目",
                "checkpoint_count": 6,
                "content": "",
                "created_at": "2023-06-19 11:05:09",
                "cover": "https://km.lexiangla.net/assets/14c92f560e4e11ee9ce10eb333a356xx",
                "subject_type": "training",
                "status": 1
            }
        }
    ]
}

# 参数说明

参数 说明
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 所属部门

# 获取单个活动详情

# 接口调用说明:

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
                }
            }
        }
    },
    "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
            }
        }
    ]
}

# 参数说明

参数 说明
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 所属部门

# 获取活动参与成员

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

# 接口调用说明:

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
            }
        },
        {
            "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
            }
        }
    ]
}

# 参数说明

参数 说明
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 员工签到时间

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

# 接口调用说明:

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"
                    }
                }
            }
        }
    ],
    "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
            }
        }
    ]
}

# 参数说明

参数 说明
data.id 活动id
data.type 资源对象类型,为event,表示资源为活动
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