OpenFolia

Edit one’s own comment

PATCH
/change-sets/{changeSetId}/comments/{commentId}

Replaces the comment’s text; it stays on its block, in its thread, and is marked edited (meta.editedAt). The earlier text is not kept: a comment.edit audit event records that it was edited, never the text. The same text changes nothing and is not audited. Only the comment’s author, while they may comment on its module (as the change set’s author, or a reviewer holding content.review in a role that covers it): 403 for anyone else who sees the comment, and 404, exactly like a missing one, for anyone who does not. Only on an open change set (draft, in-review or approved). Nobody may edit or delete another person’s comment, admins included. Needs the content.read permission.

Authorization

bearer
headerAuthorizationBearer <JWT>

A service account's token (ccms_sat_…, issued by POST /service-accounts/{id}/tokens), or, for local use and demo mode, the server's shared CCMS_API_TOKEN.

Path Parameters

changeSetId*string

The change set’s ID (a UUID). One that names no change set, malformed or not, is 404.

Formatuuid
commentId*string

The comment’s ID (a UUID). One that names no comment of this change set, malformed or not, is 404.

Formatuuid

Header Parameters

X-Ccms-User?string

Demo mode only (CCMS_AUTH_MODE=demo): the user ID to act as. The bearer token is still required; without demo mode the header is refused (400).

Request Body

application/vnd.api+json
  1. body
data*

Response Body

application/vnd.api+json
  1. response
data*
Example Request
curl -X PATCH 'http://localhost:3000/change-sets/497f6eca-6276-4993-bfeb-53cbbbba6f08/comments/497f6eca-6276-4993-bfeb-53cbbbba6f08' \  -H 'Content-Type: application/vnd.api+json' \  -d '{  "data": {    "type": "Comment",    "id": "string",    "attributes": {      "body": "string"    }  }}'
Example Response
{  "data": {    "type": "Comment",    "id": "string",    "attributes": {      "subject": {        "type": "module",        "lang": "string",        "moduleId": "string"      },      "blockId": "string",      "body": "string",      "author": {        "kind": "user",        "id": "string"      },      "commit": "string",      "createdAt": "2019-08-24T14:15:22Z",      "resolvedAt": "2019-08-24T14:15:22Z",      "resolvedBy": {        "kind": "user",        "id": "string"      }    },    "relationships": {      "changeSet": {        "data": {          "type": "ChangeSet",          "id": "string"        }      },      "thread": {        "data": {          "type": "Comment",          "id": "string"        }      }    },    "meta": {      "orphaned": true,      "deleted": true,      "editedAt": "2019-08-24T14:15:22Z"    }  }}