# アクティビティフィードの取得

`GET /api/feed`

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

ログインユーザーが参加しているプロジェクトのアクティビティを新しい順に返します。

## パラメーター

| name | in | type | required | description |
| --- | --- | --- | --- | --- |
| `beforeId` | query | integer |  | ページ送り用のカーソルです。この ID より小さい ID のアクティビティだけを返します。前のページで最も小さかった `id` を渡してください。 |
| `limit` | query | integer |  | 返す件数 (1〜50)。省略すると 20 件です。 |
| `projectId` | query | integer |  | このプロジェクトのアクティビティだけを返します。省略すると、アクセスできるすべてのプロジェクトが対象です。 |
| `userId` | query | integer |  | このユーザーのアクティビティだけを返します。省略すると全員が対象です。 |

## リクエスト

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

## レスポンス

- 200: Activity feed
- 400: Invalid query parameters
- 401: Authentication is required
- 404: Project not found

## レスポンスの例

```json
{
  "activities": [
    {
      "id": 22395,
      "createdAt": 1793662619438,
      "model": "Note",
      "modelId": 187,
      "property": "description",
      "isMultiple": false,
      "action": "update",
      "message": "ノートの詳細を更新しました",
      "user": {
        "id": 1101,
        "name": "aiko",
        "fullName": "Aiko Tanaka",
        "avatarUrl": null,
        "state": "active",
        "extra": {
          "color": null
        }
      },
      "project": {
        "id": 288,
        "name": "Website renewal",
        "fullName": "Website renewal"
      },
      "ref": {
        "link": {
          "text": null,
          "path": null
        },
        "fromContent": null,
        "toContent": null,
        "content": null
      }
    },
    {
      "id": 22392,
      "createdAt": 1793662619383,
      "model": "NoteComment",
      "modelId": 36,
      "property": "comment",
      "isMultiple": false,
      "action": "update",
      "message": "コメントのcommentを更新しました",
      "user": {
        "id": 1101,
        "name": "aiko",
        "fullName": "Aiko Tanaka",
        "avatarUrl": null,
        "state": "active",
        "extra": {
          "color": null
        }
      },
      "project": {
        "id": 288,
        "name": "Website renewal",
        "fullName": "Website renewal"
      },
      "ref": {
        "link": {
          "text": "Release checklist (v1)",
          "path": "/p/288/note/187#comment-36"
        },
        "fromContent": "Looks good. Can we also add a rollback step?",
        "toContent": "Looks good. Can we also add a rollback step before the launch?",
        "content": "Looks good. Can we also add a rollback step? → Looks good. Can we also add a rollback step before the launch?"
      }
    }
  ]
}
```
