# 下载记录

# 获取下载记录列表

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

# 接口调用说明:

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": "0c7fd3d2005511efa2570eb19a9d09fe",
            "attributes": {
                "created_at": "2024-04-22 11:04:35"
            },
            "relationships": {
                "target": {
                    "data": {
                        "type": "file",
                        "id": "4cdb00a8fe4011ee8e97aa842dfe1297"
                    }
                },
                "owner": {
                    "data": {
                        "type": "staff",
                        "id": "zhangsan"
                    }
                },
                "doc": {
                    "data": {
                        "type": "doc",
                        "id": "4cedc6defe4011eebfa7aa842dfe1297"
                    }
                }
            }
        },
        {
            "type": "download_log",
            "id": "b19cd5ba005311efb1f356e572b73633",
            "attributes": {
                "created_at": "2024-04-22 10:54:53"
            },
            "relationships": {
                "target": {
                    "data": {
                        "type": "attachment",
                        "id": "c20341fefd4d11eeb7c79effc2b17922"
                    }
                },
                "owner": {
                    "data": {
                        "type": "staff",
                        "id": "lisi"
                    }
                },
                "doc": {
                    "data": {
                        "type": "doc",
                        "id": "c5b7fc68fd4d11ee92e49effc2b17922"
                    }
                }
            }
        }
    ],
    "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=2852",
        "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": 2852,
        "path": "https://lxapi.lexiangla.com/cgi-bin/v1/download-logs",
        "per_page": 2,
        "to": 2,
        "total": 5703
    },
    "included": [
        {
            "type": "file",
            "id": "4cdb00a8fe4011ee8e97aa842dfe1297",
            "attributes": {
                "name": "txt",
                "like_count": 0,
                "favorite_count": 0,
                "signature": "",
                "file_type": "txt"
            }
        },
        {
            "type": "attachment",
            "id": "c20341fefd4d11eeb7c79effc2b17922",
            "attributes": {
                "name": "uploadNodestination.txt",
                "downloadable": 0,
                "attachment_type": "txt"
            }
        },
        {
            "type": "staff",
            "id": "zhangsan",
            "attributes": {
                "name": "zhangsan",
                "english_name": null,
                "organization": "555"
            }
        },
        {
            "type": "staff",
            "id": "lisi",
            "attributes": {
                "name": "lisi",
                "english_name": null,
                "organization": "666 "
            }
        },
        {
            "type": "doc",
            "id": "4cedc6defe4011eebfa7aa842dfe1297",
            "attributes": {
                "name": "txt",
                "privilege_type": 0,
                "is_star": 0,
                "created_at": "2024-04-19 19:31:01",
                "read_count": 2,
                "comment_count": 0,
                "allow_comment": 1,
                "updated_at": "2024-04-19 19:31:01",
                "recommended_at": null,
                "picture_url": "",
                "edited_at": "2024-04-19 19:31:01",
                "only_team": null,
                "tags": []
            },
            "links": {
                "platform": "https://km.lexiangla.com/docs/4cedc6defe4011eebfa7aa842dfe1297"
            },
            "relationships": {
                "target": {
                    "data": {
                        "type": "file",
                        "id": "4cdb00a8fe4011ee8e97aa842dfe1297"
                    }
                }
            }
        },
        {
            "type": "doc",
            "id": "c5b7fc68fd4d11ee92e49effc2b17922",
            "attributes": {
                "name": "aaa",
                "privilege_type": 0,
                "is_star": 0,
                "created_at": "2024-04-18 14:34:56",
                "read_count": 2,
                "comment_count": 0,
                "allow_comment": 1,
                "updated_at": "2024-04-18 14:35:12",
                "recommended_at": null,
                "picture_url": "",
                "edited_at": "2024-04-18 14:35:12",
                "only_team": null,
                "tags": [
                    "lx1",
                    "lx2",
                    "lx3"
                ]
            },
            "links": {
                "platform": "https://km.lexiangla.com/docs/c5b7fc68fd4d11ee92e49effc2b17922"
            },
            "relationships": {
                "target": {
                    "data": {
                        "type": "document",
                        "id": "c5a99ceafd4d11eeaef59effc2b17922"
                    }
                }
            }
        }
    ]
}

# 参数说明:

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