Examples

POST /api/v2/message-groups
{
  "data": {
    "type": "message-groups",
    "attributes": {
      "group-chat": false,
      "chat-room-name": null,
      "updated-at": null,
      "has-unread-message": false
    },
    "relationships": {
      "accounts": {
        "data": [
          {
            "type": "accounts",
            "id": "1335"
          },
          {
            "type": "accounts",
            "id": "1336"
          }
        ]
      }
    }
  }
}
201
{
  "data": {
    "id": "2",
    "type": "message-groups",
    "links": {
      "self": "http://test.host/api/v2/message-groups/2"
    },
    "attributes": {
      "group-chat": false,
      "chat-room-name": null,
      "updated-at": "2017-08-29T10:51:06.760+08:00",
      "has-unread-message": false
    },
    "relationships": {
      "last-message": {
        "links": {
          "self": "http://test.host/api/v2/message-groups/2/relationships/last-message",
          "related": "http://test.host/api/v2/message-groups/2/last-message"
        }
      },
      "accounts": {
        "links": {
          "self": "http://test.host/api/v2/message-groups/2/relationships/accounts",
          "related": "http://test.host/api/v2/message-groups/2/accounts"
        }
      },
      "messages": {
        "links": {
          "self": "http://test.host/api/v2/message-groups/2/relationships/messages",
          "related": "http://test.host/api/v2/message-groups/2/messages"
        }
      }
    }
  }
}

Params

Param name Description
data
required

Message Group Information

Validations:

  • Must be a Hash

data[type]
required

Validations:

data[relationships]
required

Validations:

  • Must be a Hash

data[relationships][accounts]
required

Validations:

  • Must be a Hash

data[relationships][accounts][data]
required

Validations:

  • Must be an Array of nested elements

data[relationships][accounts][data][type]
required

Account type, which is `accounts`

Validations:

  • Must be a String

data[relationships][accounts][data][id]
required

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