# 受信トレイの一覧

`GET /api/inbox`

URL: https://repsona.com/ja/api/get-inbox

通知をタスク・ノートごとにまとめ、スレッドごとの最新の通知を返します。

## パラメーター

| name | in | type | required | description |
| --- | --- | --- | --- | --- |
| `status` | query | unread \| archived |  | 取得する通知の状態です。`unread` (未読) か `archived` (既読) を指定します。省略すると `unread` です。 |
| `page` | query | integer |  | ページ番号です。1 から始まり、1 ページに 10 スレッドが入ります。省略すると 1 です。 |
| `until_id` | query | integer |  | この値より小さい ID の通知だけを返します。ページを送っている間に新しい通知が届いても、ずれないようにするために使います。 |
| `mention_only` | query | boolean |  | `true` にすると、自分へのメンションの通知だけを返します。省略すると `false` です。 |

## リクエスト

```sh
curl -X GET "https://<space>.repsona.com/api/inbox" \
  -H "Authorization: Bearer $REPSONA_API_KEY"
```

## レスポンス

- 200: Threaded inbox notifications
- 401: Authentication is required

## レスポンスの例

```json
{
  "inboxNotifications": [
    {
      "id": 55,
      "status": "unread",
      "createdAt": 1793662651149,
      "activity": {
        "id": 22405,
        "createdAt": 1793662651133,
        "model": "TaskComment",
        "modelId": 74,
        "property": "comment",
        "isMultiple": false,
        "action": "create",
        "message": "コメントを作成しました",
        "user": {
          "id": 1128,
          "name": "mia",
          "fullName": "Mia Chen",
          "avatarUrl": null,
          "state": "active",
          "extra": {
            "color": null
          }
        },
        "project": {
          "id": 297,
          "name": "beta-launch",
          "fullName": "Beta Launch"
        },
        "ref": {
          "link": {
            "text": "Fix login redirect",
            "path": "/p/297/task/100443#comment-74"
          },
          "fromContent": null,
          "toContent": "Looks good to me. Shipping on Friday.",
          "content": "Looks good to me. Shipping on Friday."
        }
      },
      "reaction": {
        "targetType": "taskComment",
        "targetId": 74,
        "reactions": []
      },
      "subIds": []
    },
    {
      "id": 54,
      "status": "unread",
      "createdAt": 1793662651128,
      "activity": {
        "id": 22403,
        "createdAt": 1793662651116,
        "model": "TaskComment",
        "modelId": 73,
        "property": "comment",
        "isMultiple": false,
        "action": "create",
        "message": "コメントを作成しました",
        "user": {
          "id": 1128,
          "name": "mia",
          "fullName": "Mia Chen",
          "avatarUrl": null,
          "state": "active",
          "extra": {
            "color": null
          }
        },
        "project": {
          "id": 297,
          "name": "beta-launch",
          "fullName": "Beta Launch"
        },
        "ref": {
          "link": {
            "text": "Write release notes",
            "path": "/p/297/task/100441#comment-73"
          },
          "fromContent": null,
          "toContent": "Looks good to me. Shipping on Friday.",
          "content": "Looks good to me. Shipping on Friday."
        }
      },
      "reaction": {
        "targetType": "taskComment",
        "targetId": 73,
        "reactions": []
      },
      "subIds": []
    }
  ]
}
```
