title: D2L API: Creating a new section
body: <p>I am working on building an app that accepts orgunitid and creates a new section associated with orgunitid. I'm using c#.</p>
  
  <p>Here is my code.</p>
  
  <pre><code>string orgUnitId = textBoxOrgUnitId.Text;
  string sectionCreateRoute = "/d2l/api/lp/1.0/" + orgUnitId + "/sections/";
  var client = new RestClient(host);
  var valenceAuthenticator = new D2L.Extensibility.AuthSdk.Restsharp.ValenceAuthenticator(userContext);
  var requestCreateSection = new RestRequest(sectionCreateRoute, Method.POST);
  valenceAuthenticator.Authenticate(client, requestCreateSection);
  </code></pre>
  
  <p>And, the JSON data I should provide will look like this.</p>
  
  <pre><code>{
  "Name": "Test Section",
  "Code": "" ,
  "Description": { "Content": "Test", "Type" : "HTML"  }
  }
  </code></pre>
  
  <p>How can I create a new section with this JSON data.</p>
  
  <p>Thanks,</p>
  
  <p>Phillip</p>
  
  <hr>
  
  <p>I've tried this code, but it still does not create a section.</p>
  
  <pre><code>string orgUnitId = textBoxOrgUnitId.Text;
  string sectionCreateRoute = "/d2l/api/lp/1.0/" + orgUnitId + "/sections/";
  var client = new RestClient(host);
  var valenceAuthenticator = new D2L.Extensibility.AuthSdk.Restsharp.ValenceAuthenticator(userContext);
  var requestCreateSection = new RestRequest(sectionCreateRoute, Method.POST);
  requestCreateSection.AddJsonBody(new
  {
      Name = "Section Test",
      Code = "156156",
      Description = new { Content = "Test", Type = "Html" }
  });
  valenceAuthenticator.Authenticate(client, requestCreateSection);
  </code></pre>