Docs home

Create Text/HTML Teaching Material

Adds a text or HTML page as a teaching material in a curriculum section. Send the HTML in `html_text`, or upload an HTML file instead.

POST/tutor/materials
Create Text/HTML 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":6174,"material_name":"Text Html Material","description":"<p>Text Html Description And Instructions</p>","material_source":"html_text","external_url":"","html_text":"<p>Hello this is Content For Text HTML&nbsp;</p>","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}'
{
  "code": 200,
  "message": "Teaching material created successfully",
  "material": {
    "material_id": 17493,
    "file_name": null,
    "description": "<p>Text Html Description And Instructions</p>",
    "material_name": "Text Html Material",
    "material_source": "html_text",
    "type": null,
    "external_url": null,
    "section_id": 6174,
    "is_drm": 0,
    "is_downloadable": null,
    "is_watermarked": null,
    "watermark_text": null,
    "is_enterprise_drm": 0,
    "display_index": 17493,
    "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. To upload an HTML file instead of html_text, add it as a file field named uploaded_file.

BodyJSONString
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.
html_textstring (HTML)One of html_text or uploaded_file
Page content. External images are copied into Edmingle.
uploaded_filefileOne of html_text or uploaded_file
An HTML (or plain text) file to show instead of html_text.

Set material_source to html_text 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: 17493
Example: <p>Text Html Description And Instructions</p>
Example: Text Html Material
Example: html_text
Example: 6174
Example: 0
Position in the section
Example: 17493
Always 4, teaching material
Example: 4

Notes: Sending both html_text and a file fails with "Please Provide HTML content or upload HTML file, not both". 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