Skip to main content
View as Markdown

Attachment Assets (Non-Media File Attachments) - Content Management

Attachment Assets (Non-Media File Attachments)​

The attachment_attachmentAsset service attaches supplementary files to media entries (shown as "Related Files" in KMC).

ActionDescription
attachment_attachmentAsset.addCreate an attachment asset on an entry
attachment_attachmentAsset.setContentUpload content to the attachment
attachment_attachmentAsset.updateUpdate attachment metadata
attachment_attachmentAsset.getGet attachment by ID
attachment_attachmentAsset.listList attachments for an entry
attachment_attachmentAsset.deleteDelete an attachment
attachment_attachmentAsset.getUrlGet download URL
attachment_attachmentAsset.serveServe attachment file directly
# Step 1: Create the attachment asset
curl -X POST "$KALTURA_SERVICE_URL/service/attachment_attachmentAsset/action/add" \
-d "ks=$KALTURA_KS" \
-d "format=1" \
-d "entryId=$KALTURA_ENTRY_ID" \
-d "attachmentAsset[objectType]=KalturaAttachmentAsset" \
-d "attachmentAsset[title]=Slide Deck" \
-d "attachmentAsset[format]=3" \
-d "attachmentAsset[fileExt]=pdf"

# Step 2: Upload the file using an upload token
curl -X POST "$KALTURA_SERVICE_URL/service/attachment_attachmentAsset/action/setContent" \
-d "ks=$KALTURA_KS" \
-d "format=1" \
-d "id=$ATTACHMENT_ASSET_ID" \
-d "contentResource[objectType]=KalturaUploadedFileTokenResource" \
-d "contentResource[token]=$UPLOAD_TOKEN_ID"

# List attachments for an entry
curl -X POST "$KALTURA_SERVICE_URL/service/attachment_attachmentAsset/action/list" \
-d "ks=$KALTURA_KS" \
-d "format=1" \
-d "filter[entryIdEqual]=$KALTURA_ENTRY_ID"

# Get direct download URL
curl -X POST "$KALTURA_SERVICE_URL/service/attachment_attachmentAsset/action/getUrl" \
-d "ks=$KALTURA_KS" \
-d "format=1" \
-d "id=$ATTACHMENT_ASSET_ID"

Attachment format types:

ValueNameDescription
1TEXTPlain text files
2MEDIAMedia files not for transcoding (supplementary media)
3DOCUMENTDocuments (PDF, DOCX, PPTX, etc.)
4JSONStructured JSON data

Business scenario -- supplementary materials: An e-learning platform attaches PDF handouts, exercise files, and code samples to each video lecture. Learners download these via attachmentAsset.serve or attachmentAsset.getUrl.