DXNoteClient

This class is responsible for making requests to the note API.

You will need to enable the "Training" scope for your app in the developer dashboard before using the course API.

Properties

public static let shared: DXNoteClient

Singleton instance of DXNoteClient . You will access all the available DXNoteClient methods through this instance.

Methods

createNote

public func createNote(
    text: String,
    lessondId: String?,
    userId: String?,
    classId: String?,
    studentId: String?,
    courseId: String?,
    _ completion: @escaping (_ error: Error?, _ note: DXNote?) -> Void
  )

Creates a note.

The following parameters allow the API to automatically add additional metadata to a note:

  • if a lessonId is specified, the lesson's course ID is added.

  • if a classId is specified, the class's course ID is added.

  • if a studentId is specified, the student's user profile ID, class ID, and course IDs are added.

When adding notes for the MOTAR Training Dashboard, you must include a student ID and a lesson ID.

getNote

public func getNote(
    noteId: String,
    _ completion: @escaping (_ error: Error?, _ note: DXNote?) -> Void
  )

Retrieves a specific note by ID.

getNoteList

public func getNoteList(
    lessondId: String?,
    userId: String?,
    classId: String?,
    studentId: String?,
    courseId: String?,
    _ completion: @escaping (_ error: Error?, _ notes: [DXNote]?) -> Void
  )

Retrieves all notes from the specified category or categories.

deleteNote

public func deleteNote(
    noteId: String,
    _ completion: @escaping (_ error: Error?) -> Void
  )

Deletes a note by ID.

Last updated