@@ -627,6 +627,7 @@ components:
627
627
required :
628
628
- organization_id
629
629
- plugin_id
630
+ - plugin_type
630
631
- compatible_input_data_types
631
632
- created_datetime
632
633
- updated_datetime
@@ -635,12 +636,16 @@ components:
635
636
$ref : " #/components/schemas/OrganizationId"
636
637
plugin_id :
637
638
$ref : " #/components/schemas/PluginId"
639
+ plugin_type :
640
+ $ref : " #/components/schemas/PluginType"
638
641
plugin_name :
639
642
$ref : " #/components/schemas/PluginName"
640
643
description :
641
644
$ref : " #/components/schemas/PluginDescription"
642
645
annotation_editor_url :
643
646
$ref : " #/components/schemas/AnnotationEditorUrl"
647
+ task_assignment_url :
648
+ $ref : " #/components/schemas/TaskAssignmentUrl"
644
649
compatible_input_data_types :
645
650
$ref : " #/components/schemas/PluginCompatibleInputDataTypes"
646
651
created_datetime :
@@ -652,14 +657,19 @@ components:
652
657
PutOrganizationPluginRequest :
653
658
type : object
654
659
required :
660
+ - plugin_type
655
661
- compatible_input_data_types
656
662
properties :
663
+ plugin_type :
664
+ $ref : " #/components/schemas/PluginType"
657
665
plugin_name :
658
666
$ref : " #/components/schemas/PluginName"
659
667
description :
660
668
$ref : " #/components/schemas/PluginDescription"
661
669
annotation_editor_url :
662
670
$ref : " #/components/schemas/AnnotationEditorUrl"
671
+ task_assignment_url :
672
+ $ref : " #/components/schemas/TaskAssignmentUrl"
663
673
compatible_input_data_types :
664
674
$ref : " #/components/schemas/PluginCompatibleInputDataTypes"
665
675
last_updated_datetime :
@@ -669,6 +679,15 @@ components:
669
679
example : " 12345678-abcd-1234-abcd-1234abcd5678"
670
680
description : |
671
681
プラグインID。[値の制約についてはこちら。](#section/API-Convention/APIID)
682
+ PluginType :
683
+ type : string
684
+ enum :
685
+ - custom_annotation_editor
686
+ - custom_task_assignment
687
+ description : |
688
+ プラグイン種別。
689
+ * `custom_annotation_editor` - カスタムアノテーションエディタ用のプラグインを表します。
690
+ * `custom_task_assignment` - カスタムタスク割当用のプラグインを表します。
672
691
PluginName :
673
692
type : string
674
693
example : " foo-bar"
@@ -688,12 +707,14 @@ components:
688
707
example : ["custom"]
689
708
description : |
690
709
プラグインが対応している入力データです。
710
+ プラグイン種別がカスタムアノテーションエディタの場合のみ有効です。
691
711
AnnotationEditorUrl :
692
712
type : string
693
713
example : " https://example.com/my/editors?p={projectId}&t={taskId}"
694
714
description : |
695
715
カスタムアノテーションエディタでタスクを開くための URL です。
696
716
プラグインを使用するプロジェクトのタスク一覧などで使用されます。
717
+ プラグイン種別がカスタムアノテーションエディタの場合のみ有効です。
697
718
698
719
この URL には、タスクを特定するための以下のパラメータを必ず埋め込んでください。
699
720
@@ -704,6 +725,57 @@ components:
704
725
705
726
* `{inputDataId}`: アノテーション一覧などから、特定の入力データにフォーカスした状態でタスクを開くときなどに指定します。
706
727
* `{annotationId}`: アノテーション一覧などから、特定のアノテーションにフォーカスした状態でタスクを開くときなどに指定します。
728
+ TaskAssignmentUrl :
729
+ type : string
730
+ example : " https://example.com/my/editors?p={projectId}&t={taskId}"
731
+ description : |
732
+ 「カスタムタスク割当API」のURLです。
733
+ プラグイン種別がカスタムタスク割当の場合のみ有効です。
734
+
735
+ #### カスタムタスク割当APIについて。
736
+
737
+ * 独自のアルゴリズムで作業者にタスクを割当するAPIです。
738
+ * AnnoFabから提供されるものではなく、第三者 (ユーザー様) が用意します。
739
+ * 作業者がタスク一覧やアノテーションエディタのタスク取得ボタンを押すと、指定したURLに複数の情報 (※1) と共にHTTPリクエスト (POST) が送られます。
740
+ * カスタムタスク割当APIでは、AnnoFabで提供しているAPI (※2) を使用して作業者にタスクを割当してください。
741
+ * タスクの割当に成功した場合は以下のHTTPレスポンスを返却してください。
742
+ * レスポンスヘッダ: `Access-Control-Allow-Origin: https://annofab.com`
743
+ * レスポンスボディ: 割当した単一のタスク
744
+ * ステータスコード: 200
745
+ * 作業者に割当できるタスクがない場合は以下のHTTPレスポンスを返却してください。
746
+ * レスポンスヘッダ: `Access-Control-Allow-Origin: https://annofab.com`
747
+ * レスポンスボディ: `{"errors": [{"error_code": "MISSING_RESOURCE"}]}`
748
+ * ステータスコード: 404
749
+ * 作業者の認証トークンの期限が切れている場合があります。その場合は以下のHTTPレスポンスを返却してください。
750
+ * レスポンスヘッダ: `Access-Control-Allow-Origin: https://annofab.com`
751
+ * レスポンスボディ: `{"errors": [{"error_code": "EXPIRED_TOKEN"}]}`
752
+ * ステータスコード: 401
753
+
754
+ #### Preflightリクエストについて。
755
+
756
+ * AnnoFabからカスタムタスク割当APIへCross-OriginなHTTPリクエストを送信するより前に、ブラウザの仕様により「Preflightリクエスト」と呼ばれるHTTPリクエストが送られます。
757
+ * カスタムタスク割当を利用するためには、カスタムタスク割当APIとは別に「Preflightリクエスト対応API」を用意する必要があります。
758
+ * 以下の要件を満たす「Preflightリクエスト対応API」を用意してください。
759
+ * URL: カスタムタスク割当APIと同じURL
760
+ * HTTPメソッド: OPTIONS
761
+ * レスポンスヘッダ:
762
+ * `Access-Control-Allow-Origin: https://annofab.com`
763
+ * `Access-Control-Allow-Headers: Content-Type`
764
+ * レスポンスボディ: 空(から)
765
+ * ステータスコード: 200
766
+
767
+ ※1 以下の情報が送られます。
768
+
769
+ * HTTPボディ (JSON形式)
770
+ * `authorization_token` : 作業者の認証トークン。AnnoFabのAPIを利用する際に使用します。
771
+ * `project_id` : タスクの割当リクエストが行われたプロジェクトのID。
772
+ * `phase` : 作業者が割当を要求したタスクフェーズ。このフェーズのタスクを割当してください。
773
+
774
+ ※2 例えば以下のAPIがあります。(詳しい情報はAPIドキュメントを参照してください)
775
+
776
+ * `getMyAccount` : 作業者のアカウント情報を取得できます。
777
+ * `getTasks` : プロジェクトのタスクを取得できます。
778
+ * `assignTasks` : 作業者にタスクを割当することができます。
707
779
708
780
MyOrganization :
709
781
type : object
@@ -1011,6 +1083,14 @@ components:
1011
1083
AWS IAMロール。ビジネスプランでのS3プライベートストレージの認可で使います。
1012
1084
[S3プライベートストレージの認可の設定についてはこちら](/docs/faq/#m0b240)をご覧ください。
1013
1085
example : " arn:aws:iam::123456789012:role/AnnoFabPrivateStorageAccessor"
1086
+ plugin_id :
1087
+ $ref : " #/components/schemas/PluginId"
1088
+ description : |
1089
+ カスタムアノテーションエディタのプラグインID。カスタムプロジェクトの場合は必須です。
1090
+ custom_task_assignment_plugin_id :
1091
+ $ref : " #/components/schemas/PluginId"
1092
+ description : |
1093
+ `task_assignment_type`に`custom`を設定している場合のみ、カスタムタスク割当のプラグインIDを設定してください。
1014
1094
ProjectSummary :
1015
1095
type : object
1016
1096
properties :
@@ -1025,12 +1105,14 @@ components:
1025
1105
- random
1026
1106
- selection
1027
1107
- random_and_selection
1108
+ - custom
1028
1109
description : |
1029
1110
プロジェクトで使用するタスクの割当方式。
1030
1111
1031
1112
* `random` - タスクフェーズのみを指定してランダムにタスクを自身に割当する方式です。
1032
1113
* `selection` - 担当者とタスクを明示的に指定してタスクを割当する方式です。プロジェクトオーナーもしくはチェッカーのみ、自身以外のプロジェクトメンバーを担当者に指定できます。
1033
1114
* `random_and_selection` - ランダム割当と選択割当の両機能を使用する方式です。
1115
+ * `custom` - タスク割当アルゴリズム (API) を独自に定義してタスクを割当する方式です。
1034
1116
JobInfo :
1035
1117
type : object
1036
1118
properties :
@@ -1608,6 +1690,12 @@ components:
1608
1690
}
1609
1691
no_label :
1610
1692
$ref : " #/components/schemas/InspectionStatisticsPhrases"
1693
+ PatchTasksMetadataRequest :
1694
+ type : object
1695
+ description : タスクIDとメタデータのkey-valueペア(Dictionary)です。
1696
+ additionalProperties : {
1697
+ $ref : " #/components/schemas/TaskMetadata"
1698
+ }
1611
1699
InspectionStatisticsPhrases :
1612
1700
type : object
1613
1701
description : ラベル外指摘の集計結果
@@ -2490,6 +2578,8 @@ components:
2490
2578
* `inspection_and_acceptance_skipped` - このタスクが抜取検査の対象外となり、検査・受入フェーズをスキップしたことを表す
2491
2579
2492
2580
未指定時はこのタスクが抜取検査の対象となったことを表す。(通常のワークフローを通過する)
2581
+ metadata :
2582
+ $ref : " #/components/schemas/TaskMetadata"
2493
2583
TaskPhase :
2494
2584
type : string
2495
2585
enum :
@@ -2521,15 +2611,24 @@ components:
2521
2611
* `complete` - 完了。次のフェーズへ進む
2522
2612
* `rejected` - 差戻し。修正のため、`annotation`フェーズへ戻る。[operateTask](#operation/operateTask) APIのリクエストボディに渡すときのみ利用する。その他のAPIのリクエストやレスポンスには使われない。
2523
2613
* `cancelled` - 提出取消し。修正のため、前フェーズへ戻る。[operateTask](#operation/operateTask) APIのリクエストボディに渡すときのみ利用する。その他のAPIのリクエストやレスポンスには使われない。
2614
+ TaskMetadata :
2615
+ type : object
2616
+ description : |
2617
+ ユーザーが自由に登録できるkey-value型のメタデータです。
2618
+ keyにはメタデータ名、valueには値を指定してください。
2619
+ valueには文字列、数値、真偽値を指定できます。
2524
2620
TaskRequest :
2525
2621
type : object
2526
2622
required :
2527
2623
- input_data_id_list
2624
+ - metadata
2528
2625
properties :
2529
2626
input_data_id_list :
2530
2627
type : array
2531
2628
items :
2532
2629
$ref : " #/components/schemas/InputDataId"
2630
+ metadata :
2631
+ $ref : " #/components/schemas/TaskMetadata"
2533
2632
TaskGenerateRequest :
2534
2633
type : object
2535
2634
required :
0 commit comments