Search code examples
desire2learnvalence

Desire2Learn Valence API Creating and updating sections?


I am working on integration with our university's SIS system and am stumbling a bit with the documentation related to creating and updating sections. http://docs.valence.desire2learn.com/res/enroll.html#Section.SectionData

I can use the route PUT /d2l/api/lp/(version)/(orgUnitId)/sections/ to create a default section named Section 1 with section code sec1 however when I try to update it or add an additional section with the routes: PUT /d2l/api/lp/(version)/(orgUnitId)/sections/(sectionId) (with the sectionId retrieved from my previous PUT) or POST /d2l/api/lp/(version)/(orgUnitId)/sections/

I am using the following block for my json data:

{
  "Name": "Section 1d",
  "Code": "Dan 101",
  "Description": {
    "Text": "",
    "Html": ""
  }
}

What am I missing in the syntax?

Thank You


Solution

  • It looks like your routes and your request are okay. Only one small change with the route. You need to use the RichTextInput field that is described in the documentation D2L Conventions

    Basically instead of:

    "Description": {
       "Text": "",
       "Html": ""
    }
    

    You need:

    "Description": {
       "Content": "",
       "Type": "" (Either Text or Html)
    }