change CONTENT_COMPLETIONTYPE_T via the API
(newbie here, please bear with me)
Dear all,
I have a widget running with some javascript. I can get info through the API (get the TOC, whoami etc.), I can change the Title of a Topic, it all works.
What I want to do, is change the CONTENT_COMPLETIONTYPE_T with an API call. In the TOC object, CompletionType exists for Topic X, but when I get the Topic, CompletionType isn't there. Also, when I do this call, Title gets changed to the dummy value as expected, there is no error or warning, but the update on CompletionType is ignored.
const updatedTopicData = {
...topicData,
Title: 'My Dummy Title',
CompletionType: '2'
};
const LE_API_VERSION = '1.85';
const updateResponse = await fetch('/d2l/api/le/' + LE_API_VERSION + '/' + orgUnitId + '/content/topics/' + topicId, {
method: 'PUT',
headers: {
'Content-Type': 'application/json'
},
credentials: 'include',
body: JSON.stringify(updatedTopicData)
});
Is this expected behaviour, as in: CompletionType updates are not supported (on the type Topic)? Is there another way to do this?
TIA!
Jules.
Answers
-
Hello Jules,
Changing a topic’s CompletionType via API is not currently supported.
- The TOC routes expose a
CompletionTypevalue so you can read a topic’s completion setting in context. - The Topic update route (
PUT /content/topics/{topicId}) does not include aCompletionTypefield in the writable schema, so the service ignores it if you send it.
If you would like this functionality added, I recommend posting your use case in the Brightspace Developer Community so the right team can review it and other developers can upvote it:
Kind regards,
- The TOC routes expose a
-
Hi Omar,
Thanks, this confirms my suspiscion.
Best wishes,
Jules.
