# REST API を使用したタグのリストと確認

タグのリストを表示し、詳細、ポリシー、カラム情報を含む各タグの使用状況を表示できます。

| ![Information](/assets/info.aa88698bdb590fb167080bc7bc900e461aa937f4b3774de0759e678e7a8aab37.9f549006.png) | 情報 |
|  --- | --- |
| ポリシータグは、すべてのタグの詳細および使用状況リストで分離されていません。したがって、namespace: POLICY と namespace: RESOURCE は結果に統合されます。 |  |


# タグのリスト

すべてのタグの詳細をリストして表示します。

```bash
$ curl --request GET "https://api-data-def-repo.treasuredata.com/v1/annotation-type/custom" \
       --header 'Authorization: TD1 ${6542/1120000023340000042320000016789000005438}'
```

**サンプルレスポンス**

```json
{
  "data": [
    {
      "id": "2f27b00e-9377-419e-91c3-4456598c30a8",
      "attributes": {
        "name": "PII",
        "humanReadableName": "PII",
        "comment": null,
        "version": 1,
        "createdAt": "2021-05-20T22:10:32.872791Z",
        "updatedAt": "2021-05-20T22:10:32.872791Z",
        "color": "POLICY_DEFAULT",
        "namespace": "POLICY"
      },
      "type": "annotation-type"
    },
    {
      "id": "6d4ed012-9a68-4de4-820d-e9b70c22382e",
      "attributes": {
        "name": "KarinTag",
        "humanReadableName": "KarinTag",
        "comment": "",
        "version": 1,
        "createdAt": "2022-01-07T17:08:32.255631Z",
        "updatedAt": "2022-01-07T17:08:32.255631Z",
        "color": "RESOURCE_DEFAULT",
        "namespace": "RESOURCE"
      },
      "type": "annotation-type"
    },
    ....
  ]
}
```

# 各タグの使用状況を表示

各タグの使用状況を表示できます。次の例では、PII の使用状況を確認できます。

```bash
$ curl --request GET "https://api-data-def-repo.treasuredata.com/v1/column-annotation/lookup?annotationTypeName=PII" \
       --header 'Authorization: TD1 ${6542/1120000023340000042320000016789000005438}'
```

**サンプルレスポンス**

```json
{
  "data": [
    {
      "id": "465302e6-67c0-4b33-9462-2f501c511601",
      "attributes": {
        "comment": "",
        "createdAt": "2021-09-30T07:40:01.792499Z",
        "sensitive": false
      },
      "relationships": {
        "annotation-type": {
          "data": {
            "type": "annotation-type",
            "id": "2f27b00e-9377-419e-91c3-4456598c30a8",
            "name": "PII"
          }
        },
        "table": {
          "data": {
            "type": "treasure-data-table",
            "id": "607222.3276426"
          }
        },
        "column": {
          "data": {
            "type": "treasure-data-column",
            "id": "dob"
          }
        },
        "created-by": {
          "data": {
            "type": "treasure-data-user",
            "id": "33648"
          }
        }
      },
      "type": "column-annotation"
    },
    ...
  ],
  "links": {
    "first": "/v1/column-annotation/lookup?annotationTypeName=PII",
    "self": "/v1/column-annotation/lookup?annotationTypeName=PII"
  },
  "meta": {
    "perPage": 250
  }
}
```