我想使用Valence Learning Framework API将文件上传到另一个用户的电子公文包中(由D2L UserId标识)。 我怎样才能做到这一点?
I'd like to use the Valence Learning Framework APIs to upload a file into the ePortfolio of another user (identified by D2L UserId). How can I do this?
最满意答案
您可以使用两个路由将ePortfolio软件包导入另一个用户的D2L电子公文包。 在这两种情况下,您使用的上传包必须符合ePortfolio在导出此类包时使用的格式。 并且,在这两种情况下,调用用户上下文必须具有为其他用户导入eP对象的权限。
POST / d2l / api / ep / {ver} / import / new
自ePortfolio v3.5.1起可用,此路由允许您将包导入您自己的电子公文包,或提供用于接收导入的用户列表。 它为您提供了一个或多个导入任务ID,您可以使用它们来检索导入任务的状态。
POST / d2l / api / ep / {ver} / import / newwithdetails
自ePortfolio v4.2.0起可用,此路由允许您将包导入您自己的电子公文包,或提供接收导入的用户列表; 它为您提供有关已启动任务的更多详细信息(包括用于获取状态的导入任务ID)。
注意 。 在这两种情况下,当前导入任务属于接收导入包的用户 ,而不仅仅是调用用户。 这意味着,如果您尝试将包导入另一个用户的电子档案袋,则必须使用该用户的调用用户上下文来查询导入任务的状态,或者是否愿意不了解导入任务的状态。
You can use two routes to import ePortfolio packages into another user's D2L ePortfolio. In both cases, the upload package you use must conform to the format ePortfolio uses when it exports such packages. And, in both cases, the calling user context must have permission to import eP objects for other users.
POST /d2l/api/ep/{ver}/import/new
Available since ePortfolio v3.5.1, this route allows you to import a package to your own ePortfolio, or provide a list of users to receive the import. It provides you back one or more import task IDs you may be able to use to retrieve the status of the import task.
POST /d2l/api/ep/{ver}/import/newwithdetails
Available since ePortfolio v4.2.0, this route allows you to import a package to your own ePortfolio, or provide a list of users to receive the import; it provides you back more details about the started tasks (including the import task ID for status-fetching purposes).
Note. In both these cases, currently the import task belongs to the user receiving the import package, and not solely the calling user. That means that, if you're trying to import a package to another user's ePortfolio, you either must use a calling user context for that user to inquire about the import task's status, or be willing to not have visibility into the import task's status.
更多推荐
发布评论