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時間を設定

find message

GET 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

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"
        }
      }
    }
  }
}

search messages

GET 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

{
  "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"
  }
}

create message

POST 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

{
  "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"
        }
      }
    }
  }
}

update messages

PUT 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

{
  "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"
        }
      }
    }
  }
}

delete message

DELETE 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

Completed 204 No Content

GET 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

export

GET 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

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,"",""

最終更新