Our course team has a custom app that generates pages from template files and then creates corresponding modules and topics within a course in D2L. This is great for new courses we launch as course designers can play around with the structure of the course in the place we track video and other page information.
A new feature I am looking to build is the ability to update pages. This would be beneficial for future iterations of an existing course as videos, resources, or other page content may change moving forward. The PUT /topic/(topicId)/file API looks promising for this use case. Using it, I am able to update the topic contents as intended.
However, on the backend in the “Manage Files” section of the course, if the file is named the same, it will create a copy each time this API is called (e.g. Page, Page - Copy, Page - Copy (1), Page - Copy (2), etc.). This is explained in the API documentation with the note that “the existing content topic file will not be removed by this action”.
Is there a parameter, or different API route, I can use to overwrite the existing file in place? When creating the topic with POST /modules/(moduleId)/structure/, the default behavior appears to be to overwrite an existing file with the same name (with a parameter renameFileIfExists that can be set to true to not overwrite the file; much like the PUT method). Is this feature available for the PUT method (e.g. renameFileIfExists=false)?