下载记录

获取下载记录列表

可以获取乐享平台上所有上传附件和文档的下载记录

接口调用说明:

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

SDK封装方法使用示例:

$Lxapi = new \Lexiangla\Openapi\Api(AppKey, AppSecret);
$response = $Lxapi->get('download-logs', [
    'per_page'=>2, 
    'page'=>1, 
    'include'=>'target,owner'
]);

响应document

200 OK 状态码
{
    "data":[
        {
            "type":"download_log",
            "id":"f59de3063c9311e8b64995597300a871",
            "attributes":{
                "created_at":"2018-04-10 15:51:21"
            },
            "relationships":{
                "target":{
                    "data":{
                        "type":"file",
                        "id":"10a18f022c2411e8802db53e40a56056"
                    }
                },
                "owner":{
                    "data":{
                        "type":"staff",
                        "id":"StaffID1"
                    }
                }
            }
        },
        {
            "type":"download_log",
            "id":"64d8df663c9211e8a6d56f2588dac9b6",
            "attributes":{
                "created_at":"2018-04-10 15:40:08"
            },
            "relationships":{
                "target":{
                    "data":{
                        "type":"file",
                        "id":"10a18f022c2411e8802db53e40a56056"
                    }
                },
                "owner":{
                    "data":{
                        "type":"staff",
                        "id":"StaffID2"
                    }
                }
            }
        }
    ],
    "included":[
        {
            "type":"file",
            "id":"10a18f022c2411e8802db53e40a56056",
            "attributes":{
                "name":"投票结果"
            }
        },
        {
            "type":"staff",
            "id":"StaffID1",
            "attributes":{
                "name":"张三",
                "english_name":"ThreeZhang",
                "organization":"运营组"
            }
        },
        {
            "type":"staff",
            "id":"StaffID2",
            "attributes":{
                "name":"李四",
                "english_name":"FourLee",
                "organization":"产品组"
            }
        }
    ],
    "links":{
        "first":"https://lxapi.lexiangla.com/cgi-bin/v1/download-logs?per_page=2&page=1",
        "last":"https://lxapi.lexiangla.com/cgi-bin/v1/download-logs?per_page=2&page=23",
        "prev":null,
        "next":"https://lxapi.lexiangla.com/cgi-bin/v1/download-logs?per_page=2&page=2"
    },
    "meta":{
        "current_page":1,
        "from":1,
        "last_page":23,
        "path":"https://lxapi.lexiangla.com/cgi-bin/v1/download-logs",
        "per_page":"2",
        "to":2,
        "total":45
    }
}

参数说明:

参数 说明
download_log.type 资源对象类型,必须为 download_log,表示下载记录
download_log.id 单个下载记录的唯一标识
download_log.created_at 成员执行下载操作的时间
download_log.target 关联的资源对象,类型为 file、attachment,表示下载的文件类型
file 表示文档,attachment 表示附件
download_log.owner 关联的资源对象,类型为 staff,表示执行下载操作的成员
file.id 文档ID
file.name 文档名
attachment.id 附件ID
attachment.name 附件名
owner.id 成员ID
owner.name 成员名
owner.english_name 成员英文名