Examples

PATCH /api/v2/messages/56
{
  "data": {
    "id": "56",
    "type": "messages",
    "attributes": {
      "content": "Test message.",
      "created-at": "2017-08-29 10:48:31 +0800",
      "is-read": true,
      "is-system-message": false
    },
    "relationships": {
      "sender": {
        "data": {
          "type": "senders",
          "id": "662"
        }
      }
    }
  }
}
200
{
  "data": {
    "id": "56",
    "type": "messages",
    "links": {
      "self": "/api/v2/messages/56"
    },
    "attributes": {
      "content": "Test message.",
      "created-at": "2017-08-29T10:48:31.682+08:00",
      "is-read": true,
      "is-system-message": false
    },
    "relationships": {
      "attachment": {
        "links": {
          "self": "/api/v2/messages/56/relationships/attachment",
          "related": "/api/v2/messages/56/attachment"
        }
      },
      "message-group": {
        "links": {
          "self": "/api/v2/messages/56/relationships/message-group",
          "related": "/api/v2/messages/56/message-group"
        }
      },
      "sender": {
        "links": {
          "self": "/api/v2/messages/56/relationships/sender",
          "related": "/api/v2/messages/56/sender"
        }
      }
    }
  }
}

Params

Param name Description
id
required

Message 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.

attributes
optional

Validations:

  • Must be a Hash

attributes[is-read]
optional

Update the is-read status

Validations:

  • Must be one of: true, false.