PUT /api/messages/:message_id/comments/:id

update an existing comment on a message. Only the comment owner can perform this operation

Success Response Code: 200

Params

Param name Description
message_id
optional

message to retrieve comments for


Value: Must be a Integer
id
optional

id of the referenced comment


Value: Must be a Integer
comment
optional

Value: Must be a Hash
comment[text]
required

text for the comment


Value: Must be a String
comment[attachment]
optional

file to attach to this comment. Should be sent as an HTTP multipart form


Value: Must be a File
comment[attachment_ids]
optional

existing attachment to be connected to this comment


Value: Must be an array of Integer

Response Fields

comment[id] unique id for the comment Integer
comment[text] comment body String
comment[url] url to access the comment String
comment[permalink_url] url to access the web form of this comment String
comment[user] information about the comment's author Hash<User>
comment[created_at] datetime stamp for when the comment was originally created DateTime
comment[editable] flag to notify clients if the comment is editable by the current user Boolean
comment[detetable] flag to notify clients if the comment is deletable by the current user Boolean
comment[likable] flag to notify clients if the comment is likable by the current user Boolean
comment[likes] likes for this comment Array<Like>
comment[likes_count] total number of likes for this comment Integer
comment[attachments] files attached to this comment Array<Attachment>
comment[external_resources] url links associated with this comment, which can include oembed data. Array<ExternalResource>

Example Curl Commands

curl -X PUT -v --basic -u "emily@socialcast.com:demo" https://demo.socialcast.com/api/messages/424/comments/87.json -H"Content-Type: application/json" -d'{"comment":{"text":"Updated comment!"}}'

Examples

PUT 
{
  "comment": {
    "text": "updated"
  }
}
200
{
  "comment": {
    "id": 3,
    "url": "https://socialcast.socialcast.test/api/messages/41/comments/3",
    "user": {
      "id": 72,
      "first_name": "J'øhn67",
      "last_name": "D'øe67",
      "name": "J'øhn67 D'øe67",
      "html_name": "J&#39;øhn67 D&#39;øe67",
      "url": "https://socialcast.socialcast.test/users/72-j%C3%B8hn67d%C3%B8e67",
      "avatars": {
        "is_system_default": true,
        "id": null,
        "square16": "https://socialcast.socialcast.test/assets-test/v6/avatars/default_user_square16-3b951350d61d203ece2fa5dd274fa7bd35275e132c17310d9006514f8839c857.png",
        "square30": "https://socialcast.socialcast.test/assets-test/v6/avatars/default_user_square30-6db66ac25c338d1e548a68465e2723ff63367c2aafbcc01db24c83964056b892.png",
        "square45": "https://socialcast.socialcast.test/assets-test/v6/avatars/default_user_square45-16865426333e244c59076d4f2475b711ed1ff9d12c97f4cf354f373a0170a1fd.png",
        "square70": "https://socialcast.socialcast.test/assets-test/v6/avatars/default_user_square70-1708999e8f1fea583408d7fc64b2177f853e4123bea2ffcf35f4839c8697e0ba.png",
        "square140": "https://socialcast.socialcast.test/assets-test/v6/avatars/default_user_square140-7da7e1d98b33ef152280b1f653cfd80e2db24b01b625a72abc320673eea5af53.png"
      },
      "username": "Jøhn67Døe67",
      "active": true,
      "terminated": false,
      "inactive": false,
      "role": "member",
      "type": "User",
      "title": null,
      "out_of_office": false,
      "out_of_office_on": null,
      "back_in_office_on": null,
      "company_login": null
    },
    "text": "updated",
    "html_body": "<div class=\"markdown-body\"><p>updated</p></div>",
    "created_at": "2017-04-22T20:15:46-07:00",
    "updated_at": "2017-04-22T20:15:50-07:00",
    "attachments": [],
    "media_files": [],
    "permalink_url": "https://socialcast.socialcast.test/messages/41/comments/3",
    "editable": true,
    "deletable": true,
    "likable": false,
    "external_resources": [],
    "likes_count": 0,
    "likes": [],
    "recipients": [],
    "watchable": false,
    "watch": null,
    "tags": [],
    "thumbnail_url": null
  }
}
PUT 
{
  "comment": {
    "text": "updated"
  },
  "html_styling": "inline"
}
200
{
  "comment": {
    "id": 3,
    "url": "https://socialcast.socialcast.test/api/messages/41/comments/3",
    "user": {
      "id": 72,
      "first_name": "J'øhn67",
      "last_name": "D'øe67",
      "name": "J'øhn67 D'øe67",
      "html_name": "J&#39;øhn67 D&#39;øe67",
      "url": "https://socialcast.socialcast.test/users/72-j%C3%B8hn67d%C3%B8e67",
      "avatars": {
        "is_system_default": true,
        "id": null,
        "square16": "https://socialcast.socialcast.test/assets-test/v6/avatars/default_user_square16-3b951350d61d203ece2fa5dd274fa7bd35275e132c17310d9006514f8839c857.png",
        "square30": "https://socialcast.socialcast.test/assets-test/v6/avatars/default_user_square30-6db66ac25c338d1e548a68465e2723ff63367c2aafbcc01db24c83964056b892.png",
        "square45": "https://socialcast.socialcast.test/assets-test/v6/avatars/default_user_square45-16865426333e244c59076d4f2475b711ed1ff9d12c97f4cf354f373a0170a1fd.png",
        "square70": "https://socialcast.socialcast.test/assets-test/v6/avatars/default_user_square70-1708999e8f1fea583408d7fc64b2177f853e4123bea2ffcf35f4839c8697e0ba.png",
        "square140": "https://socialcast.socialcast.test/assets-test/v6/avatars/default_user_square140-7da7e1d98b33ef152280b1f653cfd80e2db24b01b625a72abc320673eea5af53.png"
      },
      "username": "Jøhn67Døe67",
      "active": true,
      "terminated": false,
      "inactive": false,
      "role": "member",
      "type": "User",
      "title": null,
      "out_of_office": false,
      "out_of_office_on": null,
      "back_in_office_on": null,
      "company_login": null
    },
    "text": "updated",
    "html_body": "<div class=\"markdown-body\" style=\"margin:0;padding:0;font-size:100%;vertical-align:baseline;border:0;outline:0;background:transparent\"><p style=\"margin:0;padding:0;font-size:100%;vertical-align:baseline;border:0;outline:0;background:transparent;margin-bottom:0.75em;margin-bottom:0\">updated</p></div>",
    "created_at": "2017-04-22T20:15:46-07:00",
    "updated_at": "2017-04-22T20:15:50-07:00",
    "attachments": [],
    "media_files": [],
    "permalink_url": "https://socialcast.socialcast.test/messages/41/comments/3",
    "editable": true,
    "deletable": true,
    "likable": false,
    "external_resources": [],
    "likes_count": 0,
    "likes": [],
    "recipients": [],
    "watchable": false,
    "watch": null,
    "tags": [],
    "thumbnail_url": null
  }
}
PUT 
{
  "comment": {
    "text": "updated"
  }
}
200
{
  "comment": {
    "id": 3,
    "url": "https://socialcast.socialcast.test/api/messages/41/comments/3",
    "user": {
      "id": 72,
      "first_name": "J'øhn67",
      "last_name": "D'øe67",
      "name": "J'øhn67 D'øe67",
      "html_name": "J&#39;øhn67 D&#39;øe67",
      "url": "https://socialcast.socialcast.test/users/72-j%C3%B8hn67d%C3%B8e67",
      "avatars": {
        "is_system_default": true,
        "id": null,
        "square16": "https://socialcast.socialcast.test/assets-test/v6/avatars/default_user_square16-3b951350d61d203ece2fa5dd274fa7bd35275e132c17310d9006514f8839c857.png",
        "square30": "https://socialcast.socialcast.test/assets-test/v6/avatars/default_user_square30-6db66ac25c338d1e548a68465e2723ff63367c2aafbcc01db24c83964056b892.png",
        "square45": "https://socialcast.socialcast.test/assets-test/v6/avatars/default_user_square45-16865426333e244c59076d4f2475b711ed1ff9d12c97f4cf354f373a0170a1fd.png",
        "square70": "https://socialcast.socialcast.test/assets-test/v6/avatars/default_user_square70-1708999e8f1fea583408d7fc64b2177f853e4123bea2ffcf35f4839c8697e0ba.png",
        "square140": "https://socialcast.socialcast.test/assets-test/v6/avatars/default_user_square140-7da7e1d98b33ef152280b1f653cfd80e2db24b01b625a72abc320673eea5af53.png"
      },
      "username": "Jøhn67Døe67",
      "active": true,
      "terminated": false,
      "inactive": false,
      "role": "member",
      "type": "User",
      "title": null,
      "out_of_office": false,
      "out_of_office_on": null,
      "back_in_office_on": null,
      "company_login": null
    },
    "text": "updated",
    "html_body": "<div class=\"markdown-body\"><p>updated</p></div>",
    "created_at": "2017-04-22T20:15:46-07:00",
    "updated_at": "2017-04-22T20:15:51-07:00",
    "attachments": [],
    "media_files": [],
    "permalink_url": "https://socialcast.socialcast.test/messages/41/comments/3",
    "editable": true,
    "deletable": true,
    "likable": false,
    "external_resources": [],
    "likes_count": 0,
    "likes": [],
    "recipients": [],
    "watchable": false,
    "watch": null,
    "tags": [],
    "thumbnail_url": null
  }
}