LoginSignup
0
0

More than 1 year has passed since last update.

ChatworkAPIで取得したトークルームオブジェクトのプロパティ

Posted at

GASのChatworkライブラリでは、トークルームなどの情報をオブジェクトで取得できる。

以下のコード。

const cw = ChatWorkClient.factory({token: api_token});
let rooms = cw.getRooms();
Logger.log(rooms);

上記を実行すると、以下のようなオブジェクトが渡される。

{
    room_id=2.72790963E8,
    unread_num=0.0,
    task_num=0.0,
    sticky=false,
    mytask_num=0.0,
    mention_num=0.0,
    role=member,
    message_num=95.0,
    type=group,
    last_update_time=1.656584449E9,
    name=サンプル,
    file_num=4.0,
    icon_path=https://appdata.chatwork.com/icon/ico_group.png}

プロパティはそれぞれ以下のような意味を持つ。

プロパティ名 意味
room_id トークルームのID。大体これがほしい。
unread_num 未読メッセージの数
task_num タスクの数
sticky ピン止めしてるかどうか
mytask_num 自分に割り当てあられたタスクの数
mention_num 未読のうちメンションされている数
role メンバー権限。{admin:管理者, menber:メンバー}
message_num 総メッセージ数
type トークルームの種類。{direct:個別チャット, group:グループ}
last_update_time 最終投稿日時。(リベラル値で取得される)
name トークルームの名前
file_num アップロードされたファイルの数
icon_path チャットに表示されるのアイコン画像のURL
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0