Search code examples
desire2learn

Can I upload a file into another user's Desire2Learn ePortfolio?


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?


Solution

  • 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.