# ユーザーの期間内に予定のあるタスク一覧

`GET /api/user/{userId}/task/upcoming`

URL: https://repsona.com/ja/api/get-user-userid-task-upcoming

指定したユーザーが担当またはボール保持しているタスクのうち、開始日から期限までの範囲が指定した期間に重なるものを、開始日順に返します。

## パラメーター

| name | in | type | required | description |
| --- | --- | --- | --- | --- |
| `userId` | path | integer | 必須 | ユーザーの ID です。 |
| `start` | query | integer | 必須 | 期間の始まりです。エポックミリ秒で指定します。 |
| `end` | query | integer | 必須 | 期間の終わりです。その時刻を含み、エポックミリ秒で指定します。 |

## リクエスト

```sh
curl -X GET "https://<space>.repsona.com/api/user/{userId}/task/upcoming" \
  -H "Authorization: Bearer $REPSONA_API_KEY"
```

## レスポンス

- 200: Tasks the user is responsible for or holds the ball on, ordered by start date
- 400: Invalid range
- 401: Authentication is required
- 404: User not found

## レスポンスの例

```json
{
  "tasks": [
    {
      "id": 100441,
      "name": "Write release notes",
      "projectName": "Beta Launch",
      "project": {
        "id": 297,
        "name": "beta-launch",
        "avatarUrl": null
      },
      "ancestorNames": [],
      "status": null,
      "owner": {
        "id": 1126,
        "name": "reon",
        "fullName": "Reon Walls",
        "avatarUrl": null,
        "color": null
      },
      "tags": [],
      "dueDate": 1793749051067,
      "priority": null,
      "latestComment": {
        "id": 78,
        "comment": "Release notes draft is ready for review.",
        "user": {
          "id": 1126,
          "name": "reon",
          "fullName": "Reon Walls",
          "avatarUrl": null,
          "color": null
        }
      }
    },
    {
      "id": 100443,
      "name": "Fix login redirect",
      "projectName": "Beta Launch",
      "project": {
        "id": 297,
        "name": "beta-launch",
        "avatarUrl": null
      },
      "ancestorNames": [],
      "status": null,
      "owner": {
        "id": 1126,
        "name": "reon",
        "fullName": "Reon Walls",
        "avatarUrl": null,
        "color": null
      },
      "tags": [],
      "dueDate": 1793835451067,
      "priority": null,
      "latestComment": {
        "id": 74,
        "comment": "Looks good to me. Shipping on Friday.",
        "user": {
          "id": 1128,
          "name": "mia",
          "fullName": "Mia Chen",
          "avatarUrl": null,
          "color": null
        }
      }
    }
  ]
}
```
