タスクAPI (/tasks)
概要
タスクAPIを使用すると、標準のGET、PUT、POST、およびDELETEアクションを実行できます。 独自のエンドポイントを介して、プロジェクトまたはグループに関連付けられているタスクにアクセスすることもできます。 /projects/{project_id}/tasks および /user_groups/{user_group_id}/tasks.
詳細については、統合のベストプラクティスを参照してください。
アクション
タスクAPIでは以下の操作が可能です。
| 動詞 | パス | アクション | Description |
|---|---|---|---|
| POST | /api/user_groups /: user_group_id/tasks | 作成 | グループタスクを作成 |
| POST | /api/projects /: project_id/tasks | 作成 | プロジェクトタスクを作成 |
| POST | /api/tasks | 作成 | タスクを作成 |
| DELETE | /api/projects /: project_id/tasks /: id | 削除 | プロジェクトタスクを削除 |
| DELETE | /api/tasks /: id | 削除 | タスクを削除 |
| GET | /api/user_groups /: user_group_id/tasks | インデックス | グループタスクを照会 |
| GET | /api/projects /: project_id/tasks | インデックス | プロジェクトタスクを照会 |
| GET | /api/tasks | インデックス | タスクを照会 |
| GET | /api/user_groups /: user_group_id/tasks /: id | 表示 | グループタスクを表示 |
| GET | /api/projects /: project_id/tasks /: id | 表示 | プロジェクトタスクを表示 |
| GET | /api/tasks /: id | 表示 | タスクを表示 |
| PATCH | /api/user_groups /: user_group_id/tasks /: id | 更新 | グループタスクを更新 |
| PUT | /api/user_groups /: user_group_id/tasks /: id | 更新 | グループタスクを更新 |
| PATCH | /api/projects /: project_id/tasks /: id | 更新 | プロジェクトタスクを更新 |
| PUT | /api/projects /: project_id/tasks /: id | 更新 | プロジェクトタスクを更新 |
| PATCH | /api/tasks /: id | 更新 | タスクを更新 |
| PUT | /api/tasks /: id | 更新 | タスクを更新 |
| POST | /api/quote_requests /: quote_request_id/tasks | 作成 | ソーシングイベントにタスクを追加。 |
| DELETE | /api/quote_requests /: quote_request_id/tasks /: id | 削除 | ソーシングイベントからタスクを削除。 |
| GET | /api/quote_requests /: quote_request_id/tasks | Index | ソーシングイベントに関連付けられたタスクを取得。 |
| GET | /api/quote_requests /: quote_request_id/tasks /: id | 表示 | ソーシングイベントに関連付けられたタスクの詳細を取得。 |
| PATCH | /api/quote_requests /: quote_request_id/tasks /: id | 更新 | ソーシングイベントに関連付けられたタスクを更新。 |
| PUT | /api/quote_requests /: quote_request_id/tasks /: id | 更新 | ソーシングイベントに関連付けられたタスクを更新。 |
Elements
タスクAPIでは、次の要素を使用できます。
| 要素 | Description | 必須フィールド? | 一意? | 許容値 | Api_Inフィールド? | Api_Outフィールド? | データタイプ |
|---|---|---|---|---|---|---|---|
| 作成日時 | CoupaがYYY-MM-DDTHH:MM:SS+HH:MMZの形式で自動的に作成します | yes | datetime | ||||
| created-by | 作成したユーザー | yes | ユーザー | ||||
| 説明 | 説明 | yes | yes | テキスト | |||
| due-date | 期日 | yes | yes | datetime | |||
| duration | duration | yes | yes | float | |||
| ID | Coupaの一意の識別子 | yes | 整数 | ||||
| linkable | タスクが紐づけられている関連付け。 使用できる値はUserGroup/Projectです | yes | yes | タスク | |||
| linkable-id | タスクが紐づけられているユーザーグループまたはプロジェクトのID | yes | yes | 整数 | |||
| linkable-type | 紐づけられたオブジェクトの種類。タスクはユーザーグループまたはプロジェクトに紐づけることができます | yes | yes | string(255) | |||
| 所有者 | 所有者 | yes | yes | ユーザー | |||
| owner-id | タスクが割り当てられているユーザーID | yes | yes | 整数 | |||
| パーセンテージ | パーセンテージ | 0~100 | yes | yes | 整数 | ||
| quote-task-attributes | ソーシングイベントタスクの追加属性 | yes | yes | QuoteTaskAttributes | |||
| resolved-at | タスクが解決された日時(形式: YYYY-MM-DDTHH:MM:SS+HH:MMZ) | yes | datetime | ||||
| resolved-by | タスクを解決したユーザー | yes | ユーザー | ||||
| start-date | 開始日 | yes | yes | datetime | |||
| ステータス | タスクのステータス | yes | yes | string(255) | |||
| task-id | 編集不可の一意な識別子。 これは自動生成され、 ローダーでタスクを更新するための一意の識別子として使用されます | yes | 整数 | ||||
| title | title | yes | yes | yes | string(255) | ||
| updated-at | CoupaがYYY-MM-DDTHH:MM:SS+HH:MMZの形式で自動的に作成します | yes | datetime | ||||
| updated-by | 更新したユーザー | yes | ユーザー |
ソーシングイベントに関連付けられたタスクを取得
- メソッド
GET
/api/quote_requests/10163/tasks- cURLリクエスト例
curl -- location 'https ://<your-instance>.com/api/quote_requests/10163/tasks '\-- header' Accept: application/xml '\-- header 'Accept: application/json '\-- header' Accept: application/octet - stream '- レスポンス例
<?xml version="1.0" encoding="UTF-8"?> <tasks type="array"> <task> <id type="integer">179</id> <created-at type="dateTime">2025-04-25T13:55:52-04:00</created-at> <updated-at type="dateTime">2025-04-25T13:55:52-04:00</updated-at> <title>Send request for quotes </title> <description nil="true"/> <status>pending</status> <owner-id nil="true"/> <due-date nil="true"/> <duration nil="true"/> <percentage type="integer">0</percentage> <linkable-id type="integer">10163</linkable-id> <linkable-type>QuoteRequest</linkable-type> <resolved-at nil="true"/> <owner nil="true"/> <resolved-by nil="true"/> <created-by> <id type="integer">207</id> <login>email@company.com</login> <employee-number nil="true"/> </created-by> <updated-by> <id type="integer">207</id> <login>email@company.com</login> <employee-number nil="true"/> </updated-by> </task> <task> <id type="integer">180</id> <created-at type="dateTime">2025-04-25T13:55:59-04:00</created-at> <updated-at type="dateTime">2025-04-25T13:55:59-04:00</updated-at> <title>Choose supplier</title> <description nil="true"/> <status>pending</status> <owner-id nil="true"/> <due-date nil="true"/> <duration nil="true"/> <percentage type="integer">0</percentage> <linkable-id type="integer">10163</linkable-id> <linkable-type>QuoteRequest</linkable-type> <resolved-at nil="true"/> <owner nil="true"/> <resolved-by nil="true"/> <created-by> <id type="integer">207</id> <login>email@company.com</login> <employee-number nil="true"/> </created-by> <updated-by> <id type="integer">207</id> <login>email@company.com</login> <employee-number nil="true"/> </updated-by> </task> </tasks>
ソーシングイベントにタスクを追加
- メソッド
POST
/api/quote_requests/10163/tasks- リクエスト本文
{" title ":" 10163の新規タスク"," quote_task_attributes ":{" phase ":" setup "}," percentage ": 0}- cURLリクエスト例
curl -- location 'https ://<your-instance>.com/api/quote_requests/10163/tasks '\-- header' Accept: application/xml '\-- header 'Accept: application/json '\-- header' Accept: application/octet - stream '\-- header 'Content - Type: application/json '\-- header' Authorization :•••• '\-- data '{" title ":" New Task for 10163 "," quote_task_attributes ":{" phase ":" setup "}," percentage ": 0 }'