# Message object

## Fields

| Field             | Type     | Description | Editable |
| ----------------- | -------- | ----------- | -------- |
| content           | string   |             |          |
| kind              | string   |             |          |
| settings          | object   |             |          |
| status            | integer  |             |          |
| info              | object   |             |          |
| tags              | array    |             |          |
| created\_at       | datetime |             |          |
| deleted\_at       | datetime |             |          |
| updated\_at       | datetime |             |          |
| created\_at\_unix | integer  |             |          |
| deleted\_at\_unix | integer  |             |          |

## Filters

| Field               | Description                                                                                                                             |
| ------------------- | --------------------------------------------------------------------------------------------------------------------------------------- |
| id                  | ID                                                                                                                                      |
| kind                | 次の項目から選択 \[text, link, image, video, audio, location, sticker, action\_link, maltiple, rich\_content, stamp, contact, form, item, file] |
| room\_id            | RoomのID                                                                                                                                 |
| after\_created\_at  | 指定時刻より後に作成されたメッセージ。IntegerのUNIX時間を設定                                                                                                    |
| room\_kind          | 次の項目から選択 \[direct\_room, group\_room, support\_room]                                                                                    |
| before\_created\_at | 指定時刻より前に作成されたメッセージ。IntegerのUNIX時間を設定                                                                                                    |
| query               |                                                                                                                                         |
| start\_date         | 指定時刻の日付以降に作成されたメッセージ。IntegerのUNIX時間を設定                                                                                                  |
| end\_date           | 指定時刻の日付以前に作成されたメッセージ。IntegerのUNIX時間を設定                                                                                                  |

[![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/23ad71d472b2b38669f3)

## find message

<mark style="color:blue;">`GET`</mark> `https://{YOUR_OKSKY_DOMAIN}/rapi/v1/messages/{:id}`

#### Headers

| Name           | Type   | Description              |
| -------------- | ------ | ------------------------ |
| X-Access-Token | string | set you access token     |
| Content-Type   | string | application/vnd.api+json |
| Accept         | string | application/vnd.api+json |

{% tabs %}
{% tab title="200 " %}

```
HTTP/1.1 200 OK
Content-Type: application/vnd.api+json

{
  "data": {
    "id": "1",
    "type": "messages",
    "links": {
      "self": "https://{YOUR_OKSKY_DOMAIN}/rapi/v1/messages/1"
    },
    "attributes": {
      "content": "first message",
      "kind": "text",
      "settings": {},
      "status": "posted",
      "info": {},
      "tags": [],
      "created_at": "2018-11-19T13:47:40.865+09:00",
      "deleted_at": null,
      "updated_at": "2018-11-19T13:47:40.865+09:00",
      "created_at_unix": 1542602860,
      "deleted_at_unix": null
    },
    "relationships": {
      "room": {
        "links": {
          "self": "https://{YOUR_OKSKY_DOMAIN}/rapi/v1/messages/1/relationships/room",
          "related": "https://{YOUR_OKSKY_DOMAIN}/rapi/v1/messages/1/room"
        },
        "data": {
          "type": "rooms",
          "id": "1"
        }
      },
      "user": {
        "links": {
          "self": "https://{YOUR_OKSKY_DOMAIN}/rapi/v1/messages/1/relationships/user",
          "related": "https://{YOUR_OKSKY_DOMAIN}/rapi/v1/messages/1/user"
        },
        "data": {
          "type": "users",
          "id": "2"
        }
      }
    }
  }
}
```

{% endtab %}
{% endtabs %}

## search messages

<mark style="color:blue;">`GET`</mark> `https://{YOUR_OKSKY_DOMAIN}/rapi/v1/messages`

#### Headers

| Name           | Type   | Description              |
| -------------- | ------ | ------------------------ |
| X-Access-Token | string | set you access token     |
| Content-Type   | string | application/vnd.api+json |
| Accept         | string | application/vnd.api+json |

{% tabs %}
{% tab title="200 " %}

```
{
  "data": [
    {
      "id": "1",
      "type": "messages",
      "links": {
        "self": "https://{YOUR_OKSKY_DOMAIN}/rapi/v1/messages/1"
      },
      "attributes": {
        "content": "first message",
        "kind": "text",
        "settings": {},
        "status": "posted",
        "info": {},
        "tags": [],
        "created_at": "2018-11-19T13:47:40.865+09:00",
        "deleted_at": null,
        "updated_at": "2018-11-19T13:47:40.865+09:00",
        "created_at_unix": 1542602860,
        "deleted_at_unix": null
      },
      "relationships": {
        "room": {
          "links": {
            "self": "https://{YOUR_OKSKY_DOMAIN}/rapi/v1/messages/1/relationships/room",
            "related": "https://{YOUR_OKSKY_DOMAIN}/rapi/v1/messages/1/room"
          },
          "data": {
            "type": "rooms",
            "id": "1"
          }
        },
        "user": {
          "links": {
            "self": "https://{YOUR_OKSKY_DOMAIN}/rapi/v1/messages/1/relationships/user",
            "related": "https://{YOUR_OKSKY_DOMAIN}/rapi/v1/messages/1/user"
          },
          "data": {
            "type": "users",
            "id": "2"
          }
        }
      }
    },
    {
      "id": "2",
      "type": "messages",
      "links": {
        "self": "https://{YOUR_OKSKY_DOMAIN}/rapi/v1/messages/2"
      },
      "attributes": {
        "content": "Message Content",
        "kind": "text",
        "settings": {},
        "status": "posted",
        "info": {},
        "tags": [],
        "created_at": "2018-11-19T14:01:17.850+09:00",
        "deleted_at": null,
        "updated_at": "2018-11-19T14:35:31.354+09:00",
        "created_at_unix": 1542603677,
        "deleted_at_unix": null
      },
      "relationships": {
        "room": {
          "links": {
            "self": "https://{YOUR_OKSKY_DOMAIN}/rapi/v1/messages/2/relationships/room",
            "related": "https://{YOUR_OKSKY_DOMAIN}/rapi/v1/messages/2/room"
          },
          "data": {
            "type": "rooms",
            "id": "1"
          }
        },
        "user": {
          "links": {
            "self": "https://{YOUR_OKSKY_DOMAIN}/rapi/v1/messages/2/relationships/user",
            "related": "https://{YOUR_OKSKY_DOMAIN}/rapi/v1/messages/2/user"
          },
          "data": {
            "type": "users",
            "id": "1"
          }
        }
      }
    }
  ],
  "meta": {
    "record_count": 2
  },
  "links": {
    "first": "https://{YOUR_OKSKY_DOMAIN}/rapi/v1/messages?page%5Bnumber%5D=1&page%5Bsize%5D=25",
    "last": "https://{YOUR_OKSKY_DOMAIN}/rapi/v1/messages?page%5Bnumber%5D=1&page%5Bsize%5D=25"
  }
}
```

{% endtab %}
{% endtabs %}

## create message

<mark style="color:green;">`POST`</mark> `https://{YOUR_OKSKY_DOMAIN}/rapi/v1/messages`

#### Headers

| Name           | Type   | Description              |
| -------------- | ------ | ------------------------ |
| X-Access-Token | string | set you access token     |
| Content-Type   | string | application/vnd.api+json |
| Accept         | string | application/vnd.api+json |

#### Request Body

| Name | Type   | Description |
| ---- | ------ | ----------- |
| data | object |             |

{% tabs %}
{% tab title="200 " %}

```
{
  "data": {
    "id": "3",
    "type": "messages",
    "links": {
      "self": "https://{YOUR_OKSKY_DOMAIN}/rapi/v1/messages/3"
    },
    "attributes": {
      "content": "textt",
      "kind": "text",
      "settings": {},
      "status": "posted",
      "info": {},
      "tags": [],
      "created_at": "2018-11-20T10:06:25.393+09:00",
      "deleted_at": null,
      "updated_at": "2018-11-20T10:06:25.393+09:00",
      "created_at_unix": 1542675985,
      "deleted_at_unix": null
    },
    "relationships": {
      "room": {
        "links": {
          "self": "https://{YOUR_OKSKY_DOMAIN}/rapi/v1/messages/3/relationships/room",
          "related": "https://{YOUR_OKSKY_DOMAIN}/rapi/v1/messages/3/room"
        },
        "data": {
          "type": "rooms",
          "id": "1"
        }
      },
      "user": {
        "links": {
          "self": "https://{YOUR_OKSKY_DOMAIN}/rapi/v1/messages/3/relationships/user",
          "related": "https://{YOUR_OKSKY_DOMAIN}/rapi/v1/messages/3/user"
        },
        "data": {
          "type": "users",
          "id": "1"
        }
      }
    }
  }
}
```

{% endtab %}
{% endtabs %}

## update messages

<mark style="color:orange;">`PUT`</mark> `https://{YOUR_OKSKY_DOMAIN}/rapi/v1/messages/{:id}`

#### Headers

| Name           | Type   | Description              |
| -------------- | ------ | ------------------------ |
| X-Access-Token | string | set you access token     |
| Content-Type   | string | application/vnd.api+json |
| Accept         | string | application/vnd.api+json |

#### Request Body

| Name | Type   | Description |
| ---- | ------ | ----------- |
| data | object |             |

{% tabs %}
{% tab title="200 " %}

```
{
  "data": {
    "id": "1",
    "type": "messages",
    "links": {
      "self": "https://{YOUR_OKSKY_DOMAIN}/rapi/v1/messages/1"
    },
    "attributes": {
      "content": "first message",
      "kind": "text",
      "settings": {},
      "status": "posted",
      "info": {},
      "tags": [],
      "created_at": "2018-11-19T13:47:40.865+09:00",
      "deleted_at": null,
      "updated_at": "2018-11-19T13:47:40.865+09:00",
      "created_at_unix": 1542602860,
      "deleted_at_unix": null
    },
    "relationships": {
      "room": {
        "links": {
          "self": "https://{YOUR_OKSKY_DOMAIN}/rapi/v1/messages/1/relationships/room",
          "related": "https://{YOUR_OKSKY_DOMAIN}/rapi/v1/messages/1/room"
        },
        "data": {
          "type": "rooms",
          "id": "1"
        }
      },
      "user": {
        "links": {
          "self": "https://{YOUR_OKSKY_DOMAIN}/rapi/v1/messages/1/relationships/user",
          "related": "https://{YOUR_OKSKY_DOMAIN}/rapi/v1/messages/1/user"
        },
        "data": {
          "type": "users",
          "id": "2"
        }
      }
    }
  }
}
```

{% endtab %}
{% endtabs %}

## delete message

<mark style="color:red;">`DELETE`</mark> `https://{YOUR_OKSKY_DOMAIN}/rapi/v1/messages/{:id}`

#### Headers

| Name           | Type   | Description              |
| -------------- | ------ | ------------------------ |
| X-Access-Token | string | set you access token     |
| Content-Type   | string | application/vnd.api+json |
| Accept         | string | application/vnd.api+json |

{% tabs %}
{% tab title="204 " %}

```
Completed 204 No Content
```

{% endtab %}
{% endtabs %}

## search

<mark style="color:blue;">`GET`</mark> `https://{YOUR_OKSKY_DOMAIN}/rapi/v1/messages/search`

#### Headers

| Name           | Type   | Description              |
| -------------- | ------ | ------------------------ |
| X-Access-Token | string | set you access token     |
| Content-Type   | string | application/vnd.api+json |
| Accept         | string | application/vnd.api+json |

{% tabs %}
{% tab title="200 " %}

```
```

{% endtab %}
{% endtabs %}

## export

<mark style="color:blue;">`GET`</mark> `https://{YOUR_OKSKY_DOMAIN}/rapi/v1/messages/export`

#### Headers

| Name           | Type   | Description              |
| -------------- | ------ | ------------------------ |
| X-Access-Token | string | set you access token     |
| Content-Type   | string | application/vnd.api+json |
| Accept         | string | application/vnd.api+json |

{% tabs %}
{% tab title="200 " %}

```
id,content,room_name,room_id,created_at,posted_at,user_id,user_name,kind,src_url,tags_all
1,a,kiwi-barren-cabbage-1-wbbRxtFEf9E,3,2018/11/08 17:53,2018/11/08 17:53,2,1811081753033735,text,"",""
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.ok-sky.com/resources-api/resources-object/message-object.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
