change CONTENT_COMPLETIONTYPE_T via the API

Jules.A.9301
Jules.A.9301 Posts: 2 🔍

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

Tagged:

Answers

  • Omar.G.602
    Omar.G.602 Posts: 23 🤝🏼

    Hello Jules,

    Changing a topic’s CompletionType via API is not currently supported.

    • The TOC routes expose a CompletionType value so you can read a topic’s completion setting in context.
    • The Topic update route (PUT /content/topics/{topicId}) does not include a CompletionType field 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:
    https://community.d2l.com/brightspace/group/29-developers

    Kind regards,