Certainly. This specific code is for creating a user (I just haven't gotten around to the course record yet), but I suspect the general idea is the same for the course. Note that in the code I reference an object named JSON.user that's a custom class I've set up to receive the JSON response from the API. I can post that too if you wish. Here is what I've used to create a user:
Public Function Create() As JSON.user
If IsValid() Then
Dim PostURL As String = URLBase + "/api/v1/accounts/1/users"
Dim u As JSON.user
Using client As New Net.WebClient
client.Headers.Add("Authorization", "Bearer " + Token)
Dim HTTPResponse As Byte() = client.UploadValues(PostURL, "POST", GetFormParameters())
Dim HTTPResponseString As String = (New Text.UTF8Encoding).GetString(HTTPResponse)
u = JsonConvert.DeserializeObject(Of JSON.user)(HTTPResponseString)
End Using
Return u
Else
Return Nothing
End If
End Function
Private Function GetFormParameters() As Specialized.NameValueCollection
Dim FormParameters As New Specialized.NameValueCollection
FormParameters.Add("pseudonym[sis_user_id]", UserID)
FormParameters.Add("pseudonym[unique_id]", LoginID)
FormParameters.Add("user[name]", FirstName + " " + LastName)
FormParameters.Add("user[short_name]", PreferredName + " " + LastName)
FormParameters.Add("user[sortable_name]", LastName + ", " + FirstName)
FormParameters.Add("communication_channel[type]", "email")
FormParameters.Add("communication_channel[address]", Email)
Return FormParameters
End Function