投票

获取投票列表

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

接口调用说明:

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

参数说明:

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

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

SDK封装方法使用示例:

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

响应document

{
    "data":[
        {
            "type":"survey",
            "id":"47ba342c9ba411e8ba725254009b5a66",
            "attributes":{
                "title":"中秋福利--月饼邮寄地址统计",
                "summary":"",
                "created_at":"2018-08-09 15:17:31",
                "ended_at":"2018-08-25 15:09:00",
                "read_count":21,
                "type":"normal",
                "comment_count":0,
                "participant_count":0,
                "privilege_type":0
            },
            "links":{
                "platform":"https://xxx.lexiangla.com/teams/k100251/surveys/47ba342c9ba411e8ba725254009b5a66"
            },
            "relationships":{
                "owner":{
                    "data":{
                        "type":"staff",
                        "id":"StaffID1"
                    }
                },
                "team":{
                    "data":{
                        "type":"team",
                        "id":"e61097f08e4411e88d675254009b5a66"
                    }
                }
            }
        },
        {
            "type":"survey",
            "id":"ad74752693dd11e88b8b5254009b5a66",
            "attributes":{
                "title":"课程学习意见反馈采集",
                "summary":"",
                "created_at":"2018-07-30 17:48:14",
                "ended_at":null,
                "read_count":8,
                "type":"normal",
                "comment_count":2,
                "participant_count":1,
                "privilege_type":0
            },
            "links":{
                "platform":"https://xxx.lexiangla.com/teams/k100145/surveys/ad74752693dd11e88b8b5254009b5a66"
            },
            "relationships":{
                "owner":{
                    "data":{
                        "type":"staff",
                        "id":"StaffID2"
                    }
                },
                "team":{
                    "data":{
                        "type":"team",
                        "id":"c2d93650db2211e7b87d5254002b6735"
                    }
                }
            }
        },
        {
            "type":"survey",
            "id":"5447ec3a93dd11e8941c5254009b5a66",
            "attributes":{
                "title":"xxx公示意见采集",
                "summary":"",
                "created_at":"2018-07-30 17:45:44",
                "ended_at":null,
                "read_count":8,
                "type":"normal",
                "comment_count":1,
                "participant_count":1,
                "privilege_type":0
            },
            "links":{
                "platform":"https://xxx.lexiangla.com/teams/K10/surveys/5447ec3a93dd11e8941c5254009b5a66"
            },
            "relationships":{
                "owner":{
                    "data":{
                        "type":"staff",
                        "id":"StaffID3"
                    }
                },
                "team":{
                    "data":{
                        "type":"team",
                        "id":"fc59bc42781711e797c25254002b6735"
                    }
                }
            }
        }
    ],
    "links":{
        "first":"https://lxapi.lexiangla.com/cgi-bin/v1/surveys?filter=hot&date_range=30&per_page=3&page=1",
        "last":"https://lxapi.lexiangla.com/cgi-bin/v1/surveys?filter=hot&date_range=30&per_page=3&page=21",
        "prev":null,
        "next":"https://lxapi.lexiangla.com/cgi-bin/v1/surveys?filter=hot&date_range=30&per_page=3&page=2"
    },
    "meta":{
        "current_page":1,
        "from":1,
        "last_page":21,
        "path":"https://lxapi.lexiangla.com/cgi-bin/v1/surveys",
        "per_page":"3",
        "to":3,
        "total":63
    },
    "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":"e61097f08e4411e88d675254009b5a66",
            "attributes":{
                "name":"team1"
            }
        },
        {
            "type":"team",
            "id":"c2d93650db2211e7b87d5254002b6735",
            "attributes":{
                "name":"team2"
            }
        },
        {
            "type":"team",
            "id":"fc59bc42781711e797c25254002b6735",
            "attributes":{
                "name":"team3"
            }
        }
    ]
}

参数说明

参数 说明
survey.type 资源对象类型,为survey,表示资源为投票
survey.id 投票实体ID
survey.links.platform 投票查看页面,可以直接跳转到乐享投票详情页面
survey.title 投票的标题
survey.summary 投票的摘要内容
survey.created_at 投票的创建时间
survey.ended_at 投票的截止时间
survey.read_count 投票的访问量
survey.type 投票的类型
survey.comment_count 投票的评论数量
survey.participant_count 投票的参数人数
survey.privilege_type 投票的公开情况,0为公开,1位非公开
relationships.owner 投票的创建人
relationships.team 投票所属的K吧