publ betaReference (MCP guide)
Open publ console

publ Reference

media_course_comment_apply

Create one plain-text channel comment, delete one discovered comment, or pin/unpin one session comment in C00007. Start with media_course_comments_get view management on the same target; a normal page does not supply the required revision.

Registration, guarded transport, task routing and exact navigation are connected in source.

Inputs and actions

The reader's OWNER/authorized DELEGATEE, exact C00007 installation, selected channel and LIVE_COACHING/Z00004 requirements also apply to changes. Content comments and course discussion have different resource and permission contracts; do not substitute one method for the other.

Field Contract
channelCode, pAppCode Exact selected channel and C00007.
target {kind:"class",seriesId} or {kind:"session",postId}, using the discovered positive safe integer.
expectedRevision The same target's management revision, exactly64 lowercase hexadecimal characters.
requestId Stable 8–80 ASCII letters, digits, underscores or hyphens for this one operation.
dryRun Boolean, default false. Start explicitly with true.
action.kind Required fields Effect and boundary
create content One plain-text comment of1–3000 UTF-16 code units, nonblank after whitespace checking. Supplied text is preserved. Authenticated channel author/profile/thumbnail are used; caller-supplied identity, files, image URLs or mediaSrc are not accepted.
delete commentId, confirmation:DELETE_COURSE_COMMENT Delete exactly one comment selected from management. There is no verified undelete or automatic restoration.

A commentId must be a positive safe integer in the selected management inventory. Unknown fields, editing, image attachments and bulk actions are not supported. This pair does not author course notices. Do not infer mutation support from broader source repository APIs.

Preparation, write and result

A fresh dry run validates the target, action, current context and management snapshot, returning MEDIA_RESOURCE_PLAN with the planned action and writesPerformed:false. It creates no journal and reserves no comment capacity. Review the plan, then use the same requestId, target, revision and action with dryRun:false. An intervening comment or parent change can cause REVISION_CONFLICT; reread management for a genuinely new intended change.

Real apply rechecks the complete bounded snapshot and current authorization before persisting the sent boundary and making one mutation request. Creation POSTs the selected parent's comments collection. Deletion DELETEs the exact comment. Session pin/unpin POSTs an empty body to the corresponding child route. The shared transport still requires HTTP200 with a data envelope. An empty204 deletion acknowledgement is initially uncertain; the original task can later observe absence of its known comment without repeating DELETE.

Creation requires an authoritative new receipt ID with matching parent/consumer, channel profile/author and requested plain-text/no-image/no-pin state. Matching text, a new list row or an increased count cannot replace a lost receipt. A persisted receipt is required for later identity-bound observation.

Readback must match the requested comment change and preserve the projected parent and every unrelated projected comment. Reaction counters and unknown source fields are outside that projection. A concurrent unrelated change can keep the result unconfirmed. Management remains bounded to1,000 comments; an inventory exceeding that bound cannot produce confirmed readback.

MEDIA_RESOURCE_OBSERVED with currentStateMatches:true means the requested state and preservation checks matched. It includes the comment (null after deletion), createdCommentId for creation, a fresh revision, bounded coverage and the exact verified screen. It retains causalityVerified:false, notificationDeliveryVerified:false and restorationSupported:false. A dispatching call reports writeRequestAttemptedThisCall:true and writesPerformedThisCall:null; do not reinterpret an attempted request as proof of a new causal effect. Observation-only follow-ups report writesPerformedThisCall:false.

MEDIA_RESOURCE_UNCONFIRMED is pending, not a successful save or an automatic rollback. Inspect the original task.

Recovery and limits

Use the returned taskId (the original requestId) with taskType:media-course-comment in task_status or task_resume, on the same connection/channel/storage.

  • Prepared status/resume perform no write. Only the identical currently valid apply may dispatch prepared work after fresh checks.
  • Sent and done tasks are observed through fresh parent/comment reads, including on identical apply retry. They never resend create, delete, pin or unpin. Read currentStateMatches and the result code; a stored done phase alone is not current confirmation.
  • A missing creation receipt remains unresolved. Do not adopt an ID by text or list difference, change the requestId to retry an uncertain write, or delete its journal. This workflow does not claim a cross-task target lock; a new ID is not safe recovery.
  • Older sent journals accepted by the former code-point validator remain readable by status/resume without sending their text again. New writes enforce the original3000 UTF-16-unit limit. Over-limit prepared text cannot dispatch unchanged; status explains the definitely-unsent boundary. Any revised intended request requires a fresh management revision and must not bypass an uncertain sent task.
  • Changed credentials, actor, profile, installation, extension or permissions can prevent recovery; switching context does not authorize adopting the task.

The single successful link uses the reader's exact class/session path. Page/filter selections are not applied by the URL. Pending/malformed/historical results have no successful destination. Deletion cannot restore the original ID; pin/unpin is an explicit new operation with a fresh management revision, not an automatic undo or notification reversal.

Input examples

Illustrative dry runs only. Replace IDs with discovered values and the all-zero revision with the same target's actual management revision. These examples execute no live operation.

Create a course comment after reading that class's management view:

{"channelCode":"selected-channel","pAppCode":"C00007","target":{"kind":"class","seriesId":101},"action":{"kind":"create","content":"Please review the learning objectives before starting."},"expectedRevision":"0000000000000000000000000000000000000000000000000000000000000000","requestId":"course-comment-create-001","dryRun":true}

Delete one observed class comment:

{"channelCode":"selected-channel","pAppCode":"C00007","target":{"kind":"class","seriesId":101},"action":{"kind":"delete","commentId":301,"confirmation":"DELETE_COURSE_COMMENT"},"expectedRevision":"0000000000000000000000000000000000000000000000000000000000000000","requestId":"course-comment-delete-001","dryRun":true}
{"channelCode":"selected-channel","pAppCode":"C00007","target":{"kind":"session","postId":201},"action":{"kind":"pin","commentId":302,"pinned":true},"expectedRevision":"0000000000000000000000000000000000000000000000000000000000000000","requestId":"course-comment-pin-001","dryRun":true}

This Reference does not close the course app's image/bulk/edit/notice or learner-facing gaps. See the workflow guide.