Examples

PATCH /api/v2/comments/49
{
  "data": {
    "id": "49",
    "type": "comments",
    "attributes": {
      "body": "new comment body"
    }
  }
}
200
{
  "data": {
    "id": "49",
    "type": "comments",
    "links": {
      "self": "http://test.host/api/v2/comments/49"
    },
    "attributes": {
      "body": "new comment body",
      "created-at": "2017-08-29T10:46:52.081+08:00",
      "body-updated-at": "2017-08-29T10:46:52.524+08:00",
      "updated-at": "2017-08-29T10:46:52.525+08:00",
      "anonymize": false,
      "likes-count": 0,
      "is-liked": false,
      "revisions-count": 1,
      "has-parent": false
    },
    "relationships": {
      "attachment": {
        "links": {
          "self": "http://test.host/api/v2/comments/49/relationships/attachment",
          "related": "http://test.host/api/v2/comments/49/attachment"
        }
      },
      "commentable": {
        "links": {
          "self": "http://test.host/api/v2/comments/49/relationships/commentable",
          "related": "http://test.host/api/v2/comments/49/commentable"
        }
      },
      "commenter": {
        "links": {
          "self": "http://test.host/api/v2/comments/49/relationships/commenter",
          "related": "http://test.host/api/v2/comments/49/commenter"
        }
      },
      "parent": {
        "links": {
          "self": "http://test.host/api/v2/comments/49/relationships/parent",
          "related": "http://test.host/api/v2/comments/49/parent"
        }
      },
      "children": {
        "links": {
          "self": "http://test.host/api/v2/comments/49/relationships/children",
          "related": "http://test.host/api/v2/comments/49/children"
        }
      },
      "commentable-insights": {
        "links": {
          "self": "http://test.host/api/v2/comments/49/relationships/commentable-insights",
          "related": "http://test.host/api/v2/comments/49/commentable-insights"
        }
      },
      "commentable-entities": {
        "links": {
          "self": "http://test.host/api/v2/comments/49/relationships/commentable-entities",
          "related": "http://test.host/api/v2/comments/49/commentable-entities"
        }
      },
      "comment-likes": {
        "links": {
          "self": "http://test.host/api/v2/comments/49/relationships/comment-likes",
          "related": "http://test.host/api/v2/comments/49/comment-likes"
        }
      },
      "comment-revisions": {
        "links": {
          "self": "http://test.host/api/v2/comments/49/relationships/comment-revisions",
          "related": "http://test.host/api/v2/comments/49/comment-revisions"
        }
      }
    }
  }
}

Params

Param name Description
id
required

Comment ID

Validations:

  • Must be an identifier, string from 1 to 128 characters containing only alphanumeric characters, space, underscore(_), hyphen(-) with no leading or trailing space.

data
required

Comment information

Validations:

  • Must be a Hash

data[type]
optional

Validations:

data[attributes]
optional

Validations:

  • Must be a Hash

data[attributes][body]
optional

Comment's body

Validations:

  • Must be a String