ディスカッションを取得する

目次

ディスカッションを取得する

スペースIDを指定して、ディスカッションの一覧を取得します。

URL

クラウド版

https://sample.cybozu.com/g/api/v1/space/SPACE_ID/discussions

パスパラメーター
パラメーター名 説明
SPACE_ID ディスカッションを取得するスペースのID

HTTPメソッド

GET

利用できるバージョン

  • クラウド版Garoon

リクエスト

パラメーター

リクエストパラメーターは、URLクエリパラメーターとして送信してください。
ただし、 Garoon REST APIリクエストを送信するAPIを使って実行する場合は、リクエストボディとして指定できます。

パラメーター名 必須 説明
offset 数値 省略可 取得するディスカッションの先頭からスキップする数
省略すると、0が設定されます。
limit 数値 省略可 取得するディスカッション数の上限
最小値:1
最大値:1,000
省略すると、100が設定されます。
リクエストの例
ヘッダー
1
2
3
{
  "X-Cybozu-Authorization": "QWRtaW5pc3RyYXRvcjpjeWJvenU="
}

リクエストヘッダーの詳細は Garoon REST APIの共通仕様を参照してください。

レスポンス

プロパティ
プロパティ名 説明
discussions 配列(オブジェクト) ディスカッションの一覧
discussions[].id 文字列 ディスカッションのID
discussions[].title 文字列 ディスカッションのタイトル
discussions[].body 文字列 ディスカッションの本文
discussions[].isHtmlBody 真偽値 本文を書式編集(HTML形式)で保存するかどうか
  • true:HTML形式
  • false:プレーンテキスト
discussions[].creator[].id 文字列 作成者のGaroonユーザーID
discussions[].creator[].code 文字列 作成者のログイン名
discussions[].creator[].name 文字列 作成者の表示名
discussions[].updater[].id 文字列 更新者のGaroonユーザーID
discussions[].updater[].code 文字列 更新者のログイン名
discussions[].updater[].name 文字列 更新者の表示名
discussions[].createdAt 文字列 作成日時
discussions[].updatedAt 文字列 更新日時
hasNext 真偽値 次のディスカッションがあるかどうか
  • true:次のディスカッションがある
  • false:次のディスカッションがない
レスポンスの例
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
{
 "hasNext": false,
 "discussions": [
  {
    "id": "1",
    "title": "sample discussion1",
    "body": "",
    "isHtmlBody": false,
    "creator": {
      "id": "1",
      "code": "user1",
      "name": "user1"
    },
    "updater": {
      "id": "1",
      "code": "user1",
      "name": "user1"
    },
    "createdAt": "2024-07-31T06:49:53Z",
    "updatedAt": "2024-07-31T06:49:53Z"
  },
  {
    "id": "2",
    "title": "sample discussion2",
    "body": "",
    "isHtmlBody": false,
    "creator": {
      "id": "2",
      "code": "user2",
      "name": "user2"
    },
    "updater": {
      "id": "2",
      "code": "user2",
      "name": "user2"
    },
    "createdAt": "2024-07-31T06:50:22Z",
    "updatedAt": "2024-07-31T06:50:22Z"
  },
  {
    "id": "3",
    "title": "sample discussion3",
    "body": "sample",
    "isHtmlBody": false,
    "creator": {
      "id": "1",
      "code": "user1",
      "name": "user1"
    },
    "updater": {
      "id": "2",
      "code": "user2",
      "name": "user2"
    },
    "createdAt": "2024-07-31T06:50:37Z",
    "updatedAt": "2024-07-31T06:50:37Z"
  }
  ]
}    

サンプルコード

curlを使ったリクエスト
1
2
curl -X GET 'https://sample.cybozu.com/g/api/v1/space/1/discussions' \
  -H 'X-Cybozu-Authorization: QWRtaW5pc3RyYXRvcjpjeWJvenU='
Garoon REST APIリクエストを送信するAPIを使ったリクエスト
1
await garoon.api('/api/v1/space/1/discussions', 'GET', {});