What does the PUT /d2l/api/le/(version)/(orgUnitId)/content/topics/(topicId)/file want? If a w...

I am building an app using react and the "superagent-d2l-session-auth" npm library
the route method looks like this (feel free to take it)
----- (Typescript)
callPutRoute = (apiData:any, orgUnitId:string, topicId:string, fileString:string) => {
return new Promise((resolve, reject) => {
var request = require('superagent'),
auth = require('superagent-d2l-session-auth')();
let route = this.routeTemplate.replace("[API_VER]", apiData.LE_version)
route = route.replace("[ORG_UNIT_ID]", orgUnitId)
route = route.replace("[TOPIC_ID]", topicId)
let reqData = fileString // lets assume this is a bunch of html
// is it like widget data where I need this format "{Data:fileString}"?
// do I use on the the templates here? https://docs.valence.desire2learn.com/basic/fileupload.html#simple-uploads
request
.put(route)
.use(auth)
.set('Content-Type', 'multipart/mixed;boundary=xxBOUNDARYxx') // is this required?
.send(reqData)
.end((err:any, response:any) => {
if (err !== null) {
console.error("PUT replaceTopicFile call failed");
console.log(err);
return reject(err);
}
console.log("PUT replaceTopicFile call success");
console.log(response.body);
resolve(response.body);
});
});
}
---------
Categories
- All Categories
- 6 Thought Leadership
- 7 Known and Fixed Issues
- 6 Product Roadmap
- 553 Archived
- 10 Accessibility
- 28 Community Corner
- 2 Welcome
- Updates
- Member Spotlights
- 4 Events
- 242 Development
- 746 Customer Enablement
- Evaluate - Assess Student Learning
- Get Comfortable with Brightspace
- Communicate - Engage with Your Students
- 1 Create - Set up your Brightspace course
- Action - Add or create student activities
- 26 Partners
- 8 Product News
- 2022
- 2022 Release Notes
- 2021 Release Notes
- 4 Training
- andycat