> ## Documentation Index
> Fetch the complete documentation index at: https://developer.box.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Tasks リソース

ユーザーはタスクを使用することで、ファイルのコラボレータに対して、ファイルのレビューや作業の一部の完了をリクエストできます。タスクは、開発者がファイル中心のワークフローを作成するために使用できます。

## Task

タスクを使用すると、Boxでファイル中心のワークフローを実現できます。ユーザーはファイルに関連するタスクを作成し、タスクを完了するために他のユーザーに割り当てることができます。

<Accordion title="属性と例">
  | プロパティ                        | 型                                                    | 必須  | 説明                                                                                                                                                                                                                      |
  | ---------------------------- | ---------------------------------------------------- | --- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
  | `id`                         | `string`                                             | いいえ | このタスクの一意の識別子。                                                                                                                                                                                                           |
  | `type`                       | `enum<string>`                                       | いいえ | 値は常に`task`になります。 使用可能なオプション: `task`.                                                                                                                                                                                    |
  | `item`                       | [ファイル (Mini)](/ja/reference/files-resources#-mini)   | いいえ | タスクに関連付けられたファイル。                                                                                                                                                                                                        |
  | `due_at`                     | `string`                                             | いいえ | タスクの期限。                                                                                                                                                                                                                 |
  | `action`                     | `enum<string>`                                       | いいえ | タスク担当者が実行するように求められるタスクのタイプ。 使用可能なオプション: `review`, `complete`.                                                                                                                                                           |
  | `message`                    | `string`                                             | いいえ | タスクに含めるメッセージ。                                                                                                                                                                                                           |
  | `task_assignment_collection` | [タスク割り当て](/ja/reference/task-assignments-resources#) | いいえ | タスクに関連付けられたタスク割り当てオブジェクトのコレクション。                                                                                                                                                                                        |
  | `is_completed`               | `boolean`                                            | いいえ | タスクが完了しているかどうか。                                                                                                                                                                                                         |
  | `created_by`                 | [ユーザー (Mini)](/ja/reference/users-resources#-mini)   | いいえ | タスクを作成したユーザー。                                                                                                                                                                                                           |
  | `created_at`                 | `string`                                             | いいえ | タスクオブジェクトが作成された日時。                                                                                                                                                                                                      |
  | `completion_rule`            | `enum<string>`                                       | いいえ | タスクが完了と見なされる前にそのタスクを完了する必要がある担当者を定義します。 - `all_assignees` - タスクが完了と見なされるには、すべての担当者がそのタスクをレビューまたは承認する必要があります。 - `any_assignee` - いずれか1人の担当者がタスクをレビューまたは承認すれば、タスクが完了と見なされます。 使用可能なオプション: `all_assignees`, `any_assignee`. |

  ```json 例 theme={null}
  {
    "id": "11446498",
    "type": "task",
    "item": {
      "id": "12345",
      "etag": "1",
      "type": "file",
      "sequence_id": "3",
      "name": "Contract.pdf",
      "sha1": "85136C79CBF9FE36BB9D05D0639C70C265C18D37",
      "file_version": {
        "id": "12345",
        "type": "file_version",
        "sha1": "134b65991ed521fcfe4724b7d814ab8ded5185dc"
      }
    },
    "due_at": "2012-12-12T10:53:43-08:00",
    "action": "review",
    "message": "Legal review",
    "task_assignment_collection": {
      "total_count": 100,
      "entries": [
        {
          "id": "11446498",
          "type": "task_assignment",
          "item": {
            "id": "12345",
            "etag": "1",
            "type": "file",
            "sequence_id": "3",
            "name": "Contract.pdf",
            "sha1": "85136C79CBF9FE36BB9D05D0639C70C265C18D37",
            "file_version": {
              "id": "12345",
              "type": "file_version",
              "sha1": "134b65991ed521fcfe4724b7d814ab8ded5185dc"
            }
          },
          "assigned_to": {
            "id": "11446498",
            "type": "user",
            "name": "Aaron Levie",
            "login": "ceo@example.com"
          },
          "message": "Please review",
          "completed_at": "2012-12-12T10:53:43-08:00",
          "assigned_at": "2012-12-12T10:53:43-08:00",
          "reminded_at": "2012-12-12T10:53:43-08:00",
          "resolution_state": "incomplete",
          "assigned_by": {
            "id": "11446498",
            "type": "user",
            "name": "Aaron Levie",
            "login": "ceo@example.com"
          }
        }
      ]
    },
    "is_completed": true,
    "created_by": {
      "id": "11446498",
      "type": "user",
      "name": "Aaron Levie",
      "login": "ceo@example.com"
    },
    "created_at": "2012-12-12T10:53:43-08:00",
    "completion_rule": "all_assignees"
  }
  ```
</Accordion>

## Tasks

タスクのリスト。

<Accordion title="属性と例">
  | プロパティ         | 型                      | 必須  | 説明                                                                           |
  | ------------- | ---------------------- | --- | ---------------------------------------------------------------------------- |
  | `total_count` | `integer`              | いいえ | コレクション全体の最後のエントリのオフセットに1を加算した値。コレクション内のエントリの合計数は、`total_count`よりも少ない場合があります。 |
  | `entries`     | array of [Task](#task) | いいえ | タスクのリスト。                                                                     |

  ```json 例 theme={null}
  {
    "total_count": 5000,
    "entries": [
      {
        "id": "11446498",
        "type": "task",
        "item": {
          "id": "12345",
          "etag": "1",
          "type": "file",
          "sequence_id": "3",
          "name": "Contract.pdf",
          "sha1": "85136C79CBF9FE36BB9D05D0639C70C265C18D37",
          "file_version": {
            "id": "12345",
            "type": "file_version",
            "sha1": "134b65991ed521fcfe4724b7d814ab8ded5185dc"
          }
        },
        "due_at": "2012-12-12T10:53:43-08:00",
        "action": "review",
        "message": "Legal review",
        "task_assignment_collection": {
          "total_count": 100,
          "entries": [
            {
              "id": "11446498",
              "type": "task_assignment",
              "item": {
                "id": "12345",
                "etag": "1",
                "type": "file",
                "sequence_id": "3",
                "name": "Contract.pdf",
                "sha1": "85136C79CBF9FE36BB9D05D0639C70C265C18D37",
                "file_version": {
                  "id": "12345",
                  "type": "file_version",
                  "sha1": "134b65991ed521fcfe4724b7d814ab8ded5185dc"
                }
              },
              "assigned_to": {
                "id": "11446498",
                "type": "user",
                "name": "Aaron Levie",
                "login": "ceo@example.com"
              },
              "message": "Please review",
              "completed_at": "2012-12-12T10:53:43-08:00",
              "assigned_at": "2012-12-12T10:53:43-08:00",
              "reminded_at": "2012-12-12T10:53:43-08:00",
              "resolution_state": "incomplete",
              "assigned_by": {
                "id": "11446498",
                "type": "user",
                "name": "Aaron Levie",
                "login": "ceo@example.com"
              }
            }
          ]
        },
        "is_completed": true,
        "created_by": {
          "id": "11446498",
          "type": "user",
          "name": "Aaron Levie",
          "login": "ceo@example.com"
        },
        "created_at": "2012-12-12T10:53:43-08:00",
        "completion_rule": "all_assignees"
      }
    ]
  }
  ```
</Accordion>
