API reports "Resource not found" when trying to a create course section in a course offering

Alistair.Y.947
Alistair.Y.947 Posts: 1 🌱

We have a course offering created by the API but Brightspace reports its endpoint does not exist. When POSTing to its endpoint to create the section the API reports "Resource not found". The course offering exists and the API can find it.

Tagged:

Answers

  • Karim.M.508
    Karim.M.508 Posts: 21

    Hi @Alistair.Y.947

    This sounds like a situation where the course offering exists but might not be fully initialized in Brightspace yet, especially if it was just created via the API.

    Here’s a structured way to troubleshoot this:

    Confirm Course Offering Exists

    Make sure the course offering exists and the ID you're using is correct.

    • GET /d2l/api/lp/(version)/courses/{orgUnitId}
    • If this call succeeds, the course exists.

    https://docs.valence.desire2learn.com/res/course.html#actions

    Common Causes of “Resource Not Found” when Creating a Section

    1. Using the Wrong OrgUnitId in the Endpoint

    Ensure that the endpoint you’re POSTing to is:

    POST /d2l/api/lp/(version)/(orgUnitId)/sections/

    https://docs.valence.desire2learn.com/res/groups.html#id2

    2. Course Offering is Not “Activated” Internally Yet

    Sometimes, when a course is created via the API, there's a short delay before it's fully ready for further API operations like creating sections.

    Suggestions:

    • Add a short delay (e.g., 2–5 seconds) after creating the course before POSTing to create a section.
    • Or perform a GET to confirm it's accessible before the POST.

    If you've already confirmed these steps and it's still failing, feel free to submit a support ticket for further investigation.

    Thanks.