このページでは

タクソノミー API

地域

ベースURLは、プロジェクトのデータのレジデンシーによって異なります。このページ内のすべての例では、プロジェクトがAmplitudeのEUデータセンターを利用している場合を除き、デフォルトのベースURLを使用してください。EUデータセンターを利用している場合は、この表に記載されているEU用のベースURLを使用してください。

リクエストはhttps://amplitude.com(デフォルト)またはhttps://analytics.eu.amplitude.com(EU)に送信されます。https://analytics.amplitude.comのホスト名はアナリティクスウェブアプリ(ブラウザーUI)です。RESTリクエストにはanalytics.amplitude.comではなく、この表に記載されているホストを使用してください。

考慮事項

  • イベントタイプ、イベントプロパティ、およびユーザープロパティの名前には特殊文字をURLエンコードする必要がある場合があります。 たとえば、Play SongPlay%20Song としてエンコードします。W3Schools のエンコーディングリファレンスを参照してください。
  • レスポンスでは、カスタムユーザープロパティにはgp:プレフィックスが付いています。 たとえば、gp:my_custom_propertyのようになります。
  • この API を使用してイベントやプロパティを削除するには、その前にスキーマ内で計画しておく必要があります。

制限事項

各エンドポイントには同時実行の制限とレート制限があります。 同時実行数の制限により、同時に実行できるリクエストの数が制限されます。 レート制限により、1時間あたりのクエリの合計数が制限されます。

制限はプロジェクトごとに設定されています。 いずれかの制限を超えると、エラー 429 が返されます。

エンドポイントはクエリごとのコストモデルを使用します。 APIキーあたりの最大コスト:

  • 同時コスト制限: 合計コストが最大4になるようにクエリを同時に実行します。
  • 期間コスト制限: 1 時間あたり最大 7200 コストまで実行できます。

各エンドポイントのコスト構造:

  • GET: コスト1
  • PUT: 2 つのコスト
  • POST: コスト2
  • DELETE: コスト2

イベントカテゴリ

イベントカテゴリは、イベントタイプを幅広いグループに分類する方法です。

ユーザーがアプリに登録したり、チェックアウトしたり、オンボーディング体験とどのように対話したりしているかを追跡するには、次のイベントカテゴリを使用してイベントをグループ化します。

  • 登録
  • チェックアウト
  • オンボーディング

イベントカテゴリを作成する

プロジェクトにイベントカテゴリを作成します。

POST /api/2/taxonomy/category

curl --location --request POST 'https://amplitude.com/api/2/taxonomy/category' \
--header 'Authorization: Basic {api-key}:{secret-key}' \ #credentials must be base64 encoded
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'category_name=CATEGORY_NAME'

ボディパラメータ

レスポンス

リクエストが成功すると、JSONボディを含む200 OKレスポンスが返されます。

json
{
  "success": true
}

失敗したリクエストは、詳細な情報を含むエラー メッセージを送信します:

json
{
  "success": false,
  "errors": [
    {
      "message": "error info"
    }
  ]
}

すべてのイベントカテゴリを取得

プロジェクト内のすべてのイベントカテゴリを取得します。

GET https://amplitude.com/api/2/taxonomy/category

curl --location --request GET 'https://amplitude.com/api/2/taxonomy/category' \
-u '{api_key}:{secret_key}'

レスポンス

リクエストが成功すると、JSON ボディを含む200 OKステータスが返されます:

json
{
  "success": true,
  "data": [
    {
      "id": 412931,
      "name": "Attribution"
    },
    {
      "id": 412941,
      "name": "Conversion"
    }
  ]
}

失敗したリクエストは、より多くの情報を含む400 Bad Request応答を返します。

json
{
  "success": false,
  "errors": [
    {
      "message": "Not found"
    }
  ]
}

イベントカテゴリを取得する

プロジェクト内のイベントカテゴリの ID を取得するには、カテゴリ名を指定したGETリクエストを送信します。

GET https://amplitude.com/api/2/taxonomy/category/:category_name

curl --location --request GET 'https://amplitude.com/api/2/taxonomy/category/:category_name' \
-u '{api_key}:{secret_key}'

パスパラメータ

レスポンス

リクエストが成功すると、200 OKステータスとカテゴリのデータを含む JSON ボディが返されます。

json
{
  "success": true,
  "data": {
    "id": 412941,
    "name": "Conversion"
  }
}

失敗したリクエストは、エラーに関する詳細な情報を含む400 Bad Requestステータスを返します。

json
{
  "success": false,
  "errors": [
    {
      "message": "Not found"
    }
  ]
}

イベントカテゴリを更新する

イベントカテゴリの名前を更新するには、カテゴリ ID と本文に新しい名前を付けてPUTリクエストを送信します。

PUT https://amplitude.com/api/2/taxonomy/category/:category_id

curl --location --request PUT 'https://amplitude.com/api/2/taxonomy/category/CATEGORY_ID' \
-u '{api_key}:{secret_key}' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'category_name=NEW_NAME'

パスパラメータ

ボディパラメータ

200 OK レスポンス

成功したリクエストは200 OKステータスと JSON 本文を返します。

json
{
  "success": true
}

409 コンフリクト レスポンス

リクエストに問題がある場合、リクエストは409 Conflictステータスと詳細情報を含む JSON ボディを返します。

json
{
  "success": false,
  "errors": [
    {
      "message": "Attempted to operate on entity event_category, id \"4129\", that does not exist."
    }
  ]
}

イベントカテゴリを削除する

イベント カテゴリを削除するには、カテゴリ ID を指定してDELETEリクエストを送信します。

DELETE https://amplitude.com/api/2/taxonomy/category/:category_id

curl --location --request DELETE 'https://amplitude.com/api/2/taxonomy/category/:category_id' \
-u '{api_key}:{secret_key}'

パスパラメータ

200 OK レスポンス

成功したリクエストは200 OKステータスと JSON 本文を返します。

json
{
  "success": true
}

409 コンフリクト レスポンス

リクエストに問題がある場合、リクエストは409 Conflictステータスと詳細情報を含む JSON ボディを返します。

json
{
  "success": false,
  "errors": [
    {
      "message": "Attempted to operate on entity event_category, id \"412941\", that does not exist."
    }
  ]
}

イベントタイプ

イベントとは、_ゲームを開始_したり_カートに追加_したりといったユーザーが実行できるあらゆるアクションや、アプリ内通知やプッシュ通知といったユーザーに関連付けられたあらゆるアクティビティのことです。

タクソノミー API を使用して、イベントタイプを作成、取得、更新、削除、および復元します。

イベントタイプを作成する

ボディにパラメータを指定してhttps://amplitude.com/api/2/taxonomy/eventリクエストを POSTに送信することにより、イベントタイプを作成します。

curl --location --request POST 'https://amplitude.com/api/2/taxonomy/event' \
-u '{api_key}:{secret_key}' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'event_type=EVENT_TYPE' \
--data-urlencode 'category=CATEGORY_NAME' \
--data-urlencode 'description=DESCRIPTION'

ボディパラメータ

is_hidden_from_dropdowns、 、 is_hidden_from_persona_resultsis_hidden_from_pathfinderおよびプロパis_hidden_from_timelineティは、取り込まれたイベントタイプに対してのみ設定できます。

200 OK レスポンス

リクエストが成功すると、JSONボディを含む200 OKレスポンスが返されます。

json
{
  "success": true
}

409 コンフリクト レスポンス

失敗したリクエストは、エラーメッセージを含む409 Conflictステータスを返します。

json
{
  "success": false,
  "errors": [
    {
      "message": "error info"
    }
  ]
}

すべてのイベントタイプを取得

プロジェクト内のすべてのイベントタイプを取得します。 このリクエストには必須パラメータがありません。

GET https://amplitude.com/api/2/taxonomy/event

非表示のイベント(「表示」以外の表示設定を持つイベント)は、レスポンスに表示されません。

デフォルトでは、この応答は削除済みイベントを除外します。 これらを含めるには、showDeletedクエリパラメータを追加します:

GET https://amplitude.com/api/2/taxonomy/event?showDeleted=true

curl --location --request GET 'https://amplitude.com/api/2/taxonomy/event' \
-u '{api_key}:{secret_key}'

200 OK レスポンス

リクエストが成功すると、JSON ボディを含む200 OKステータスが返されます:

json
{
  "success": true,
  "data": [
    {
      "event_type": "Attribution",
      "category": {
        "name": "Attribution Events"
      },
      "description": null,
      "display_name": null,
      "is_active": false,
      "is_hidden_from_dropdowns": false,
      "is_hidden_from_persona_results": false,
      "is_hidden_from_pathfinder": false,
      "is_hidden_from_timeline": false,
      "tags": [],
      "owner": null
    },
    {
      "event_type": "Conversation",
      "category": {
        "name": "Conversion Events"
      },
      "description": "This event is fired when a user converts.",
      "display_name": "User Conversion",
      "is_active": false,
      "is_hidden_from_dropdowns": false,
      "is_hidden_from_persona_results": false,
      "is_hidden_from_pathfinder": false,
      "is_hidden_from_timeline": false,
      "tags": [],
      "owner": null
    }
  ]
}

イベントタイプを取得する

単一のイベントタイプを名前で取得します。 イベント名を指定してGETリクエストを送信します。

GET https://amplitude.com/api/2/taxonomy/event/:event_type

curl --location --request GET 'https://amplitude.com/api/2/taxonomy/event:event_type' \
-u '{api_key}:{secret_key}'

パスパラメータ

200 OK レスポンス

リクエストが成功すると、200 OKステータスとイベントタイプのデータを含む JSON ボディが返されます。

json
{
  "success": true,
  "data": {
    "event_type": "Event 2",
    "category": {
      "name": "Conversion Events"
    },
    "description": null,
    "display_name": null,
    "is_active": false,
    "is_hidden_from_dropdowns": false,
    "is_hidden_from_persona_results": false,
    "is_hidden_from_pathfinder": false,
    "is_hidden_from_timeline": false,
    "tags": [],
    "owner": null
  }
}

400不正なリクエスト応答

失敗したリクエストは、エラーに関する詳細な情報を含む400 Bad Requestステータスを返します。

json
{
  "success": false,
  "errors": [
    {
      "message": "Not found"
    }
  ]
}

イベントタイプを更新する

イベントタイプ名を指定したPUTリクエストを送信することにより、イベントタイプを更新します。

PUT https://amplitude.com/api/2/taxonomy/event/:event_type

curl --location --request PUT 'https://amplitude.com/api/2/taxonomy/event/EVENT_TYPE_NAME' \
-u '{api_key}:{secret_key}'
--data-urlencode 'category=NEW_CATEGORY_NAME' \
--data-urlencode 'display_name=NEW_EVENT_TYPE_DISPLAY_NAME'

パスパラメータ

ボディパラメータ

is_hidden_from_dropdowns、 、 is_hidden_from_persona_resultsis_hidden_from_pathfinderおよびプロパis_hidden_from_timelineティは、取り込まれたイベントタイプに対してのみ設定できます。

200 OK レスポンス

成功したリクエストは200 OKステータスと JSON 本文を返します。

json
{
  "success": true
}

409 コンフリクト レスポンス

リクエストに問題がある場合、リクエストは409 Conflictステータスと詳細情報を含む JSON ボディを返します。

json
{
  "success": false,
  "errors": [
    {
      "message": "Attempted to change the event display name for event \"Event\", but the event is not in schema."
    }
  ]
}

イベント タイプを削除する

イベント タイプ名をパスパラメータとして指定したリクエストを送信することにより、イベント タイプを削除できますDELETE

DELETE https://amplitude.com/api/2/taxonomy/event/:event_type

curl --location --request DELETE 'https://amplitude.com/api/2/taxonomy/event/EVENT_TYPE'
-u '{api_key}:{secret_key}'

パスパラメータ

行動

200 OK レスポンス

成功したリクエストは200 OKステータスと JSON 本文を返します。

json
{
  "success": true
}

4XXレスポンス

リクエストに問題がある場合、Amplitudeは4XXステータスと詳細情報を含むJSONボディを返します。

json
{
  "success": false,
  "errors": [
    {
      "message": "Not found"
    }
  ]
}

イベントタイプを復元する

イベントタイプ名をパスパラメータとして指定したPOSTリクエストを送信することにより、イベントタイプを復元できます。

POST https://amplitude.com/api/2/taxonomy/event/:event_type/restore

curl --location --request POST 'https://amplitude.com/api/2/taxonomy/event/EVENT_TYPE/restore'
-u '{api_key}:{secret_key}'

パスパラメータ

行動

200 OK レスポンス

成功したリクエストは200 OKステータスと JSON 本文を返します。

json
{
  "success": true
}

4XXレスポンス

リクエストに問題がある場合、Amplitudeは4XXステータスと詳細情報を含むJSONボディを返します。

json
{
  "success": false,
  "errors": [
    {
      "message": "Not found"
    }
  ]
}

イベントプロパティ

イベントプロパティは、イベントの属性を記述します。 たとえば、Swipe がトラッキング対象のイベントである場合、イベントプロパティには Leftまたは Rightという値が設定Directionできます。

イベントプロパティを作成する

ボディに必要な情報を入れてPOSTリクエストを送信することにより、イベントプロパティを作成します。

POST https://amplitude.com/api/2/taxonomy/event-property

curl --location --request POST 'https://amplitude.com/api/2/taxonomy/event-property' \
-u '{api_key}:{secret_key}' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'event_type=EVENT_TYPE' \
--data-urlencode 'event_property=EVENT_PROPERTY' \

ボディパラメータ

is_hidden プロパティは取り込まれたプロパティに対してのみ設定できます。

200 OK レスポンス

成功したリクエストは200 OKステータスと JSON 本文を返します。

json
{
  "success": true
}

409 コンフリクト レスポンス

リクエストに問題がある場合、リクエストは409 Conflictステータスと詳細情報を含む JSON ボディを返します。

json
{
  "success": false,
  "errors": [
    {
      "message": "Attempted to add an event property, \"Completed Task\" for event \"Onboard Start\", that already exists."
    }
  ]
}

イベントプロパティの取得

共有またはイベント固有のイベントプロパティを取得します。

GET https://amplitude.com/api/2/taxonomy/event-property

curl --location --request GET 'https://amplitude.com/api/2/taxonomy/event-property' \
-u '{api_key}:{secret_key}' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'event_type=EVENT_NAME'

ボディパラメータ

200 OK レスポンス

成功したリクエストは、200 OKステータスとイベントプロパティとそのデータのリストを含むJSONボディを返します。

json
{
  "success": true,
  "data": [
    {
      "event_property": "Completed Task",
      "event_type": "Onboard Start",
      "description": "User completed a task during onboarding.",
      "type": "boolean",
      "regex": null,
      "enum_values": null,
      "is_array_type": false,
      "is_required": false,
      "is_hidden": false,
      "classifications": ["PII"]
    },
    {
      "event_property": "Completed Tutorial",
      "event_type": "Onboard Start",
      "description": "",
      "type": "any",
      "regex": null,
      "enum_values": null,
      "is_array_type": false,
      "is_required": false,
      "is_hidden": false,
      "classifications": []
    }
  ]
}

単一のイベントプロパティを取得する

単一のイベントプロパティを取得します。 イベントプロパティ名をパスパラメータとして指定し、オプションでイベント名を本文に指定してGETリクエストを送信します。

GET https://amplitude.com/api/2/taxonomy/event-property

curl --location --request GET 'https://amplitude.com/api/2/taxonomy/event-property?event_property=EVENT_PROPERTY' \
-u '{api_key}:{secret_key}' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'event_type=EVENT_NAME'

パスパラメータ

ボディパラメータ

200 OK レスポンス

成功したリクエストは、200 OKステータスとイベントプロパティに関する情報を含む JSON ボディを返します。

json
{
  "success": true,
  "data": {
    "event_property": "Shared",
    "event_type": "Onboard Finish",
    "description": "Whether user shared content.",
    "type": "boolean",
    "regex": null,
    "enum_values": null,
    "is_array_type": false,
    "is_required": false,
    "is_hidden": false,
    "classifications": ["PII"]
  }
}

400不正なリクエスト応答

Amplitudeがイベントプロパティを見つけられない場合、またはリクエストを正しく設定していない場合、Amplitudeは400 Bad Requestレスポンスとエラーメッセージを返します。

json
{
  "success": false,
  "errors": [
    {
      "message": "Not found"
    }
  ]
}

イベントプロパティを更新する

イベントプロパティ名をパスパラメータとして指定したPUTリクエストを送信することにより、イベントプロパティを更新できます。

PUT https://amplitude.com/api/2/taxonomy/event-property/:event-property

curl --location --request PUT 'https://amplitude.com/api/2/taxonomy/event-property/EVENT_PROPERTY' \
-u '{api_key}:{secret_key}' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'event_type=EVENT_NAME' \

パスパラメータ

ボディパラメータ

is_hidden プロパティは取り込まれたプロパティに対してのみ設定できます。

200 OK レスポンス

成功したリクエストは200 OKステータスと JSON 本文を返します。

json
{
  "success": true
}

409 コンフリクト レスポンス

失敗した要求によっては、409 Conflictとより詳細なエラーメッセージが返される場合があります。

json
{
  "success": false,
  "errors": [
    {
      "message": "Attempted to change the event property description for property \"Completed Task\" for event \"\", but the property is not in schema."
    }
  ]
}

イベントプロパティを削除する

イベントプロパティをパスパラメータとして指定したDELETEリクエストを送信することにより、イベントプロパティを削除できます。 オプションで、リクエスト本文にイベントタイプを含めることができます。

DELETE https://amplitude.com/api/2/taxonomy/event-property/:event-property

curl --location --request DELETE 'https://amplitude.com/api/2/taxonomy/event-property/EVENT_PROPERTY' \
--header 'Authorization: Basic {api-key}:{secret-key}' # credentials must be base64 encoded \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'event_type=EVENT_NAME'

パスパラメータ

ボディパラメータ

行動

イベントタイプが使用可能な場合:

イベントタイプが使用できない場合、Amplitudeはグローバルイベントプロパティに対して動作します。

200 OK レスポンス

成功したリクエストは200 OKステータスと JSON 本文を返します。

json
{
  "success": true
}

イベント プロパティを復元する

イベント プロパティをパス パラメータとして指定したPOSTリクエストを送信することにより、イベント プロパティを復元できます。

POST https://amplitude.com/api/2/taxonomy/event-property/:event-property/restore

curl --location --request POST 'https://amplitude.com/api/2/taxonomy/event-property/EVENT_PROPERTY/restore' \
--header 'Authorization: Basic {api-key}:{secret-key}' # credentials must be base64 encoded

パスパラメータ

ボディパラメータ

行動

削除されたプロパティとGETエンドポイント。

Getイベントプロパティのエンドポイントは削除されたプロパティを返しません。存在するイベントプロパティを作成しようとした場合、イベントプロパティの作成エンドポイントは、そのプロパティがすでに存在することを示す409 Conflictエラーを返します。 削除されたプロパティを操作するには:

  • 復元エンドポイントを使用して、削除されたプロパティを復元します。
  • プロパティを作成する際に409 Conflictエラーがないかチェックしてください。 このエラーは、プロパティが存在しているが削除されていることを示している可能性があります。

201 OKレスポンス

成功したリクエストは201 OKステータスと JSON 本文を返します。

json
{
  "success": true
}

ユーザープロパティ

ユーザープロパティは、プロダクトを使用する個人の特性を反映します。

ユーザープロパティを作成する

ユーザープロパティ名を本文に含めてPOSTリクエストを送信することにより、ユーザープロパティを作成します。

POST https://amplitude.com/api/2/taxonomy/user-property/

curl --location --request POST 'https://amplitude.com/api/2/taxonomy/user-property' \
--header 'Authorization: Basic {api-key}:{secret-key}' # credentials must be base64 encoded \
--data-urlencode 'user_property=USER_PROPERTY' \

ボディパラメータ

is_hidden プロパティは取り込まれたプロパティに対してのみ設定できます。

レスポンス

この要求は、true または false の応答を返します。

json
{
  "success": true
}
json
{
  "success": false
}

すべてのユーザープロパティを取得する

アカウント内のすべてのユーザープロパティを取得します。 リクエストには必須パラメータがありません。

GET https://amplitude.com/api/2/taxonomy/user-property

非表示のユーザープロパティ(「表示可能」以外の表示を持つプロパティ)は、応答に表示されません。

デフォルトでは、このエンドポイントは削除されたユーザープロパティを除外します。 これらを含めるには、showDeletedクエリパラメータを追加します:

GET https://amplitude.com/api/2/taxonomy/user-property?showDeleted=true

curl --location --request GET 'https://amplitude.com/api/2/taxonomy/user-property' \
-u '{api_key}:{secret_key}''

レスポンス

リクエストが成功すると、200 OKレスポンスとユーザープロパティの詳細を含む JSON 本文が返されます。

json
{
  "success": true,
  "data": [
    {
      "user_property": "device_id",
      "description": null,
      "type": null,
      "enum_values": null,
      "regex": null,
      "is_array_type": false,
      "is_hidden": false,
      "classifications": ["PII"],
      "deleted": false
    },
    {
      "user_property": "event_id",
      "description": null,
      "type": null,
      "enum_values": null,
      "regex": null,
      "is_array_type": false,
      "is_hidden": false,
      "classifications": [],
      "deleted": false
    },
    {
      "user_property": "amplitude_id",
      "description": null,
      "type": null,
      "enum_values": null,
      "regex": null,
      "is_array_type": false,
      "is_hidden": false,
      "classifications": [],
      "deleted": false
    },
    {
      "user_property": "location_lat",
      "description": null,
      "type": null,
      "enum_values": null,
      "regex": null,
      "is_array_type": false,
      "is_hidden": false,
      "classifications": [],
      "deleted": false
    },
    {
      "user_property": "location_lng",
      "description": null,
      "type": null,
      "enum_values": null,
      "regex": null,
      "is_array_type": false,
      "is_hidden": false,
      "classifications": [],
      "deleted": false
    },
    {
      "user_property": "server_upload_time",
      "description": null,
      "type": null,
      "enum_values": null,
      "regex": null,
      "is_array_type": false,
      "is_hidden": false,
      "classifications": [],
      "deleted": false
    },
    {
      "user_property": "session_id",
      "description": null,
      "type": null,
      "enum_values": null,
      "regex": null,
      "is_array_type": false,
      "is_hidden": false,
      "classifications": [],
      "deleted": false
    },
    {
      "user_property": "user_id",
      "description": null,
      "type": null,
      "enum_values": null,
      "regex": null,
      "is_array_type": false,
      "is_hidden": false,
      "classifications": [],
      "deleted": false
    }
  ]
}

ユーザープロパティを取得する

単一のユーザープロパティを名前で取得します。

GET https://amplitude.com/api/2/taxonomy/user-property/:user_property

デフォルトでは、このエンドポイントは削除されたユーザープロパティを除外します。 これらを含めるには、showDeletedクエリパラメータを追加します:

GET https://amplitude.com/api/2/taxonomy/user-property/:user_property?showDeleted=true

curl --location --request GET 'https://amplitude.com/api/2/taxonomy/user-property/USER_PROPERTY' \
-u '{api_key}:{secret_key}'

パスパラメータ

200 OK レスポンス

リクエストが成功すると、200 OKレスポンスとユーザープロパティの詳細を含む JSON 本文が返されます。

json
{
  "success": true,
  "data": {
    "user_property": "device_id",
    "description": null,
    "type": null,
    "enum_values": null,
    "regex": null,
    "is_array_type": false,
    "is_hidden": false,
    "classifications": ["PII"],
    "deleted": false
  }
}

404不正なリクエスト応答

失敗したリクエストは、404 Bad Requestステータスとエラーメッセージを返します。

json
{
  "success": false,
  "errors": [
    {
      "message": "Not found"
    }
  ]
}

ユーザープロパティを更新する

ユーザープロパティ名をパスパラメータとして指定したPUTリクエストを送信することにより、ユーザープロパティを更新できます。

PUT https://amplitude.com/api/2/taxonomy/user-property/:user_property

curl --location --request PUT 'https://amplitude.com/api/2/taxonomy/user-property/USER_PROPERTY' \
-u '{api_key}:{secret_key}'
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'new_user_property_value=VALUE' \
--data-urlencode 'description=DESCRIPTION'

パスパラメータ

ボディパラメータ

is_hidden プロパティは取り込まれたプロパティに対してのみ設定できます。

レスポンス

この要求は、true または false の応答を返します。

json
{
  "success": true
}
json
{
  "success": false
}

ユーザープロパティを削除する

単一のユーザープロパティを名前で削除します。

DELETE https://amplitude.com/api/2/taxonomy/user-property/USER_PROPERTY

curl --location --request DELETE 'https://amplitude.com/api/2/taxonomy/user-property/USER_PROPERTY' \
-u '{api_key}:{secret_key}'

パスパラメータ

行動

200 OK レスポンス

成功したリクエストは、200 OK応答と JSON メッセージを返します。

json
{
  "success": true
}

ユーザープロパティを復元する

単一のユーザープロパティを名前でリストアします。

POST https://amplitude.com/api/2/taxonomy/user-property/USER_PROPERTY/restore

curl --location --request POST 'https://amplitude.com/api/2/taxonomy/user-property/USER_PROPERTY/restore' \
-u '{api_key}:{secret_key}'

パスパラメータ

行動

200 OK レスポンス

成功したリクエストは、200 OK応答と JSON メッセージを返します。

json
{
  "success": true
}

グループプロパティ

グループプロパティはアカウントレベルのプロパティです。 グループのプロパティは、そのアカウントに属するすべてのユーザーに適用されます。

グループプロパティを作成する

ボディに必要な情報を入れてPOSTリクエストを送信することで、グループプロパティを作成します。

POST https://amplitude.com/api/2/taxonomy/group-property

curl --location --request POST 'https://amplitude.com/api/2/taxonomy/group-property' \
-u '{api_key}:{secret_key}' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'group_type=GROUP_TYPE' \
--data-urlencode 'group_property=GROUP_PROPERTY' \

ボディパラメータ

is_hidden プロパティは取り込まれたプロパティに対してのみ設定できます。

200 OK レスポンス

成功したリクエストは200 OKステータスと JSON 本文を返します。

json
{
  "success": true
}

409 コンフリクト レスポンス

リクエストに問題がある場合、リクエストは409 Conflictステータスと詳細情報を含む JSON ボディを返します。

json
{
  "success": false,
  "errors": [
    {
      "message": "Attempted to add a group property, \"Group Property 1\", that already exists."
    }
  ]
}

グループプロパティの取得

共有またはグループ固有のグループプロパティを取得します。

GET https://amplitude.com/api/2/taxonomy/group-property

curl --location --request GET 'https://amplitude.com/api/2/taxonomy/group-property' \
-u '{api_key}:{secret_key}' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'group_type=GROUP_TYPE'

ボディパラメータ

200 OK レスポンス

成功したリクエストは200 OKステータスと、グループプロパティとそのデータのリストを含むJSON本文を返します。

json
{
  "success": true,
  "data": [
    {
      "group_type": "Group 1",
      "group_property": "grp:Group Property 1",
      "description": "First Group Property",
      "type": "string",
      "enum_values": null,
      "regex": null,
      "is_array_type": false,
      "is_hidden": false,
      "classifications": ["PII"]
    },
    {
      "group_type": "Group 1",
      "group_property": "grp:Group Property 2",
      "description": "Second Group Property",
      "type": "string",
      "enum_values": null,
      "regex": null,
      "is_array_type": false,
      "is_hidden": false,
      "classifications": []
    }
  ]
}

単一のグループプロパティを取得する

グループプロパティ名をパスパラメータとして指定してGETリクエストを送信することにより、単一のグループプロパティを取得できます。 オプションで、本文にグループタイプを含めます。

GET https://amplitude.com/api/2/taxonomy/group-property/:group_property

curl --location --request GET 'https://amplitude.com/api/2/taxonomy/group-property/GROUP_PROPERTY' \
-u '{api_key}:{secret_key}' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'group_type=GROUP_TYPE'

パスパラメータ

クエリまたはボディパラメータ

200 OK レスポンス

成功したリクエストは、200 OKステータスとグループプロパティに関する情報を含む JSON 本文を返します。

json
{
  "success": true,
  "data": {
    "group_type": "Group 1",
    "group_property": "grp:Group Property 1",
    "description": "First Group Property",
    "type": "string",
    "enum_values": null,
    "regex": null,
    "is_array_type": false,
    "is_hidden": false,
    "classifications": ["PII"]
  }
}

400不正なリクエスト応答

Amplitudeがグループプロパティを見つけられない場合、またはリクエストを正しく設定していない場合、Amplitudeは400 Bad Requestレスポンスとエラーメッセージを返します。

json
{
  "success": false,
  "errors": [
    {
      "message": "Not found"
    }
  ]
}

グループプロパティを更新する

グループプロパティ名をパスパラメータとして指定したPUTリクエストを送信することにより、グループプロパティを更新します。

PUT https://amplitude.com/api/2/taxonomy/group-property/:group_property

curl --location --request PUT 'https://amplitude.com/api/2/taxonomy/group-property/GROUP_PROPERTY' \
-u '{api_key}:{secret_key}' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'group_type=GROUP_TYPE' \

パスパラメータ

ボディパラメータ

is_hidden プロパティは取り込まれたプロパティに対してのみ設定できます。

200 OK レスポンス

成功したリクエストは200 OKステータスと JSON 本文を返します。

json
{
  "success": true
}

409 コンフリクト レスポンス

失敗した要求によっては、409 Conflictとより詳細なエラーメッセージが返される場合があります。

json
{
  "success": false,
  "errors": [
    {
      "message": "Attempted to update classifications for an overridden group property, \"grp:Group Property 1\" on group type \"Group 1\". Call the Update API without the \"group_type\" parameter to update classifications of the shared property."
    }
  ]
}

これは役に立ちましたか?