Filter and retrieve materials by file type within a specific unit offering.
Supported File Types:
- Documents: pdf, doc, docx, ppt, pptx, txt, odt, rtf, xls, xlsx, csv
- Images: jpg, jpeg, png, gif, bmp, tiff, svg, webp
- Videos: mp4, webm, avi, mov, wmv, flv, mkv
- Audio: mp3, wav, ogg, flac, aac, m4a
- Archives: zip, rar, 7z, tar, gz
- Code: html, css, js, py, java, cpp, c, php, json, xml
- Other: Most standard file types are supported
Note: Only non-executable and safe file types are allowed
Use Cases:
- Filter materials by type (e.g., only videos)
- Download all PDFs from a course
- Media gallery creation
- File type analytics
GET
/api/v1/materials/unit/{unitOfferingId}/type/{filetype}
curl \
--request GET 'http://localhost:3500/api/v1/materials/unit/987fcdeb-51a2-4567-9876-543210987654/type/pdf'
Response examples (200)
{
"unitOffering": {
"id": "string",
"code": "CS101"
},
"filetype": "pdf",
"materials": [
{
"id": "string",
"title": "string",
"originalName": "string",
"filetype": "string",
"fileUrl": "string",
"lessons": [
{
"id": "string",
"title": "string",
"topic": "string"
}
]
}
],
"totalMaterials": 8
}
Response examples (400)
{
"message": "string",
"error": "string",
"statusCode": 42.0
}