Docs home

Create Audio Teaching Material

Uploads a file, such as an audio file, PDF, image, document or presentation, as a teaching material in a curriculum section. The file goes in the same request.

POST/tutor/materials
Create Audio Teaching Material
curl --request POST \
  --url 'https://<your-api-host>/nuSource/api/v1/tutor/materials' \
  --header 'APIKEY: <your-api-key>' \
  --header 'ORGID: <your-org-id>' \
  --form 'JSONString={
  "section_id": "370496",
  "material_name": "Interview",
  "file_name": "Sanak.mp3",
  "description": "<p><br></p>",
  "material_source": "file",
  "is_downloadable": true,
  "external_url": "",
  "html_text": "",
  "type": "audio/mpeg",
  "max_views": -1,
  "external_video_play": 0,
  "is_prerequisite": 0,
  "platform_type": 1,
  "is_drm": 0,
  "is_enterprise_drm": 0,
  "language_id": null,
  "is_videocrypt_drm": 0,
  "is_scorm": 0,
  "isscorm_withanalytics": 0,
  "vdocipher_video_id_for_direct_upload": null
}' \
  --form 'uploaded_file='
{
  "code": 200,
  "message": "Teaching material created successfully",
  "material": {
    "material_id": 1617738,
    "file_name": "Sanak.mp3",
    "description": "<p><br></p>",
    "material_name": "Interview",
    "material_source": "file",
    "type": "audio/mpeg",
    "external_url": null,
    "section_id": "370496",
    "is_drm": 0,
    "is_downloadable": true,
    "is_watermarked": null,
    "watermark_text": null,
    "is_enterprise_drm": 0,
    "display_index": 1617738,
    "resource_type": 4
  }
}

Access: Institute admins and tutors of the course the section belongs to. Custom roles need the manage-curriculum permission and must also be an admin or a tutor of that course.

Request body: form-data with one field, JSONString, containing this JSON, plus the file in a field named uploaded_file:

BodyJSONString
uploaded_filefilerequired
The file. Allowed: PDF, Word, Excel, PowerPoint, MP3/WAV/OGG/M4A audio, MP4/WebM/OGG/MPEG/FLV video, JPEG/PNG/GIF images, ZIP, EPUB, HTML, text, CSV and SRT. Up to 1 GB.
section_idintegerrequired
Curriculum section to add the material to. Must be in your institute, otherwise "Invalid Section ID".
material_namestringrequired
Name shown to learners. Letters, digits, spaces and common punctuation.
material_sourcestringrequired
Kind of material: file (uploaded file or video), external_url (link), html_text (text/HTML page), feedback_form, lti (external LTI tool) or vimeo (existing Vimeo video by ID).
descriptionstring (HTML)
Description or instructions shown with the material. External images in it are copied into Edmingle.
1 makes learners finish this material before they can open later items. Default 0.
Purpose unclear from code; it is stored with the material. The web app sends 1.
file_namestring
Original file name, up to 250 characters.
typestring
MIME type, for example audio/mpeg. The stored type is detected from the file itself.
true lets learners download the file.
max_viewsinteger
How many times each learner may open it. -1 (default) means unlimited.
1 adds a text watermark. PDFs only; ignored for other files.
Watermark text when is_watermarked is 1. Default NV.

Set material_source to file for this request.

Response200application/json
codeinteger
Example: 200
messagestring
Example: Teaching material created successfully
materialobject
Show child attributesHide child attributes
Use it in later calls
Example: 1617738
Example: Sanak.mp3
Example: <p><br></p>
Example: Interview
Example: file
Example: audio/mpeg
Example: 370496
Example: 0
Example: true
Position in the section
Example: 1617738
Always 4, teaching material
Example: 4

Notes: For audio files the duration is read from the file and stored. File names that are too long are rejected. Upload fails with "Uploaded file should be [...]" for other file types, or "File Upload failed! Try again" if storage fails. For videos, prefer "Create Normal Video Teaching Material", which uploads straight to the video host. If the section is already published in a batch, enrolled learners get a "New Material Added" push notification. Errors: "Invalid Section ID" (section not found or not in your institute), and a tutor-only error if you are not an admin or tutor of the course. Rate limit: 30 requests per 1 minute; going over locks you out for 30 minutes.

Updated yesterday

Ask AI