APIs - Set/Get Release Conditions

Glen.B.225
Glen.B.225 Posts: 3 🌱
edited June 2023 in K-12

Hi all,

In our organization, we make extensive use of the release conditions feature.

As an example, we have a module in a course offering that contains numerous topics, each of which is a weblink that points to a student's Google Drive folder. We manually add restrictions to each of these topics so that only the specific student can see this topic, containing his/her Google Drive folder link.

I searched the API documentation and found this page which talked about how to GET/PUT release conditions:

https://docs.valence.desire2learn.com/res/releaseconditions.html

We have tinkered with the information on this page for a while now, but we cannot get anything to work. We have tried applying the API actions to other Brightspace elements, such as units, surveys, and quizzes, and tried GETting the release conditions on these elements, but nothing works at all.

We already have created a number of automation programs to assist us in other Brightspace tasks (which make use of the D2L API), but this has always been the feature that we wanted to work, as this would considerably speed up our workflow.

It would be greatly appreciated if we can get confirmation that the release conditions API is completely working, or if someone could point us to the right direction.

Thank you.

Glen B

Tagged:

Answers

  • Hi @Glen.B.225

    Thank you for the question. I have just tried the Release Conditions API, and it seems to be working as expected. Here's what I tried -


    1. Manually added a release condition to a unit in Content.

    2. Fetched the data with - GET /d2l/api/lp/(version)/(orgUnitId)/conditionalRelease/conditions/(targetType)/(targetId)
    GET /d2l/api/lp/1.43/273204/conditionalRelease/conditions/contentObjects/873766

    3. Used the response data from the GET request as the JSON data for the PUT request to add the release condition to a Quiz and an Assignment.
    PUT /d2l/api/lp/(version)/(orgUnitId)/conditionalRelease/conditions/(targetType)/(targetId)
    PUT /d2l/api/lp/1.43/273204/conditionalRelease/conditions/quizzes/149816
    PUT /d2l/api/lp/1.43/273204/conditionalRelease/conditions/dropboxes/67167

    4. Verified that the conditions were indeed added.

    I hope that helps.

    Warm Regards,
    Ajith Joseph

  • Glen.B.225
    Glen.B.225 Posts: 3 🌱

    Hello Ajith,

    Thank you for your response. Unfortunately, we still cannot get it to work.

    As an example, I created a Test Survey and a Test Quiz in our Test Course Offering environment.

    I can retrieve the Test Survey topic details with no problems, as shown in this Postman screenshot.

    {{PATH}}/d2l/api/le/{{D2LVERSION}}/18277/content/topics/203871

    Now, trying to GET the release conditions with a URL structure similar to the one provided in the documentation and in your response.

    {{PATH}}/d2l/api/lp/{{D2LVERSION}}/18277/conditionalRelease/conditions/surveys/203871

    However, it says 404 Not Found.

    I tried the same thing with the Test Quiz.

    {{PATH}}/d2l/api/lp/{{D2LVERSION}}/18277/conditionalRelease/conditions/quizzes/203870

    Not found, too.

    Both the Test Quiz and Test Survey have a Group enrollment release condition, as shown:

    The D2L API version I am using is 1.9. I tried it with 1.43 (similar to your response), but still the same outcome.

    This is what we have been experiencing with the release conditions API for some time now, We were wondering if we were doing something wrong, or if we missed something out. Help would be greatly appreciated.

    Thank you.

    Glen B

  • Hello @Glen.B.225

    Thank you for providing the detailed information.

    May I suggest you to open a support ticket with us to further investigate this issue please?

    Kind Regards,

    Bharti

  • Glen.B.225
    Glen.B.225 Posts: 3 🌱

    Hello Bharti,

    Thank you for your response. Will open a support ticket.

    Glen B