---
title: "\u30C6\u30CA\u30F3\u30C8 API"
language: ja
source_language: en
translation_state: complete
canonical: https://documentation.invantive.eu/ja/docs/invantive-waypoint/interfaces/tenant-api
original: https://documentation.invantive.eu/en/docs/invantive-waypoint/interfaces/tenant-api
updated: 2026-12-04T16:45:33Z
license: https://documentation.invantive.eu/ja/
---

テナントAPIは、テナントのプログラム向けのAPIで、`https://waypoint.invantive.eu/api/v1`にあります。 プログラムは、管理者がコンソールの「Settings」タブ「Tokens and OData」で作成したトークンを使ってサインインし、`Authorization: Bearer wpt_tok_...`として送信します。 トークンのスコープによって実行できる操作が決まります。[[Invantive Waypoint/Console/Applications and Installation|Applications and Installation]]を参照してください。 OpenAPIの説明は`https://waypoint.invantive.eu/api/v1/openapi.json`にあります。

## トークンの確認
プログラムはまずトークンを確認します：

```http
GET /api/v1/me HTTP/1.1
Host: waypoint.invantive.eu
Authorization: Bearer wpt_tok_8f3e1c0d9a7b4e21b6c5d4f3a2e1b0c9
Accept: application/json
```

応答では、トークン、コード付きのテナント、スコープ、公開可否、有効期限が示されます。有効期限が決して切れないトークンの場合、有効期限は`null`です。 不明、期限切れ、または取り消されたトークンには、401と`itgenwpt200`が返されます。 一時停止中のテナントのトークンは、403に対して`itgenwpt225`で応答します。

## リソース
テナントAPIは次のリソースを提供します:
- `/end-users`と`/end-users/{id}`: 属性を含むエンドユーザー。`GET`、`POST`、`PUT`、`PATCH`、`DELETE`。 `DELETE`は、エンドユーザーとそのすべてのデータを削除し、`end_users.delete`が必要です。
- `/end-users/batch`: 1回のリクエストで最大1件の000を扱えます。
- `/accounts`、`/accounts/{id}`、`/accounts/batch`: 会社も同様です。
- `/applications`と`/applications/{code}`: 発生元を持つアプリケーション。`/applications/{code}/secrets`は署名用シークレットをローテーションします。
- `/themes`、`/segments`、`/experiences`はいずれも`/{code}`を含み、内容は下書きとして扱われます。
- `/experiences/{code}/publish`: 下書きを公開します。`content.publish`と、公開できるトークンが必要です。
- `/experiences/{code}/archive`: エンドユーザーが利用中のエクスペリエンスをアーカイブします。
- `/experiences/{code}/steps/{step}`: 下書きのステップのアンカー、ページ、配置を変更するか、未公開のステップを削除します。`/experiences/{code}/steps/{step}/retire`は公開済みのステップを廃止します。
- `/broken-anchors`: スニペットが見つけられなかったアンカー。
- `/steps`、`/user-states`、`/account-states`、`/step-states`、`/searches`、`/ideas`: 参照用の一覧。
- `/events`: 保存済みイベントの参照。`POST`は、`events.write`のアプリケーションのサーバーから最大1件000のイベントを取得します。各イベントには`application`、`user_id`、`code`、`properties`、`at`があります。 `at`が受信時刻より30分を超えて過去、または1分を超えて未来の場合、受信時刻として保存されるため、この方法では古い履歴を読み込めません。
- `/event-hours`と`/audit-events`: 時間ごとの合計と監査証跡。参照用です。
- `/api-tokens`と`/api-tokens/{name}`: トークン。新しいトークンの応答には、トークンが一度だけ含まれます。 有効期限（`expires`）を指定しない新しいトークンは無期限です。過去の日付の有効期限を指定すると、400が返され、`itgenwpt205`になります。
- `/analytics/experiences/{code}`: ステップごとの表示回数と完了数、または`group=origin`による発生元ごとの数。
- `/transfers/...`: エクスポートとインポート。[[Invantive Waypoint/Console/Export and Import|Export and Import]]を参照してください。

すべての一覧は、行数をプレーンテキストとして`/$count`でも応答します。

## 一括でエンドユーザーを書き込む
バッチは行ごとに適用されます。応答では行ごとに受け入れられたかどうかが示されるため、1つの誤った行が他の行を拒否することはありません。 行はIDによって作成または更新されます。 送信された属性は保存済みの属性を置き換え、`null`に設定された属性は削除され、送信されなかった属性はそのまま残ります。

```http
POST /api/v1/end-users/batch HTTP/1.1
Host: waypoint.invantive.eu
Authorization: Bearer wpt_tok_8f3e1c0d9a7b4e21b6c5d4f3a2e1b0c9
Content-Type: application/json

{ "rows":
  [ { "id": "u-7f3c0a"
    , "name": "John Doe"
    , "email": "john.doe@acme.eu"
    , "language": "en"
    , "account": "pty-7c1e"
    , "signed_up": "2026-11-06T09:00:00Z"
    , "attributes":
      { "segment_codes": "s.trial,p.currency-tools,r.admin"
      , "plan": "trial"
      }
    }
  ]
}
```

応答には`accepted`、`refused`、および行ごとの`result``created`、`updated`、または`refused`が、メッセージコードとともに含まれます。 1000行を超えるバッチは、全体として`itgenwpt210`により拒否されます。

## エクスペリエンスの作成
体験は、トリガー、ステップ、テキストとともに下書きとして作成され、その後公開されます：

```http
POST /api/v1/experiences HTTP/1.1
Host: waypoint.invantive.eu
Authorization: Bearer wpt_tok_5b7d9f1a3c5e4b70a9c1e3d5f7b9a1c3
Content-Type: application/json

{ "code": "schedule-daily"
, "name": "Schedule a daily import"
, "kind": "tour"
, "application": "currency-tools"
, "segment": "trial-users"
, "order_mode": "sequential"
, "progress_scope": "account"
, "replayable": true
, "triggers":
  [ { "kind": "page", "pages": [ "/schedules" ], "repeat_scope": "account", "presentation": "start", "throttled": true }
  , { "kind": "click", "anchor": { "data_waypoint": "new-schedule" }, "repeat_scope": "end_user", "presentation": "start", "throttled": false }
  ]
, "frequency": "once"
, "goal": { "event": "schedule.created", "within_days": 7 }
, "steps":
  [ { "code": "choose-companies"
    , "anchor": { "automation_id": "schedule-companies" }
    , "page": "/schedules"
    , "wait_anchor_seconds": 5
    , "texts": { "en": { "title": "Choose the companies", "body": "Pick the Exact Online companies the schedule runs for." } }
    }
  , { "code": "save-schedule"
    , "anchor": { "automation_id": "schedule-save" }
    , "page": "/schedules"
    , "advance_on": "event"
    , "completion_event": "schedule.created"
    , "texts": { "en": { "title": "Save the schedule", "body": "The tour ends when the schedule exists." } }
    }
  ]
}
```

種類は`tour`、`tooltip`、`hotspot`、`checklist`、`modal`、`banner`、`slide_out`、`resource_centre`です。 トリガーの種類は`page`、`element`、`event`、`click`、`delay`、`manual`です。 頻度は`once`、`once_per_session`、`every_n_days`（`frequency_days`付き）、または`every_time`です。 ステップには`skip_when`、`done_when`、`event_filter`を含めることもでき、[[Invantive Waypoint/Console/Segments|segments]]の文法に従ったルールを指定できます。 ステップのテキストは`title`、`body`、`button_next`、`button_back`、`button_other`です。 モーダル、バナー、またはスライドアウトでは、`button_back`が閉じるボタンのラベルになり、ステップが別の体験を開く場合やリンクに従う場合は、`button_other`がメインボタンのラベルになります。 下書きは`POST /api/v1/experiences/schedule-daily/publish`を付けて公開され、本文でレビュー済みの下書きバージョンを`draft_version`として指定します。 `draft_version`がなければ、現在の下書きが公開されます。

## フィルタリング、ソート、カウント
すべてのリストは[OData version 4](https://www.odata.org/documentation/)のシステムクエリオプションを受け付けます。プロパティはスネークケースです：
- `$filter`と`eq`、`ne`、`gt`、`ge`、`lt`、`le`、`and`、`or`、`not`、`in`、`eq null`。関数`contains`、`startswith`、`endswith`、`tolower`、`toupper`、`trim`、`length`、`year`、`month`、`day`、`date`。`account/name`のような1階層のナビゲーション。
- すべてのプロパティに対する`$select`および`$orderby`。
- ページのサイズとして`$top`、および`$skip`。
- `$count=true`は、応答に`count`を追加します。

例えば、`GET /api/v1/end-users?$filter=contains(email,'@acme.eu')&$select=id,name,last_seen&$orderby=last_seen desc&$count=true`です。 `?segment=trial-users`などのショートカットはフィルターになり、1つと組み合わせることができます。 エンドユーザーの一覧は`Accept: text/csv`付きのCSVで応答します。 グループ化は[[Invantive Waypoint/Interfaces/OData Service|OData Service]]でのみ提供されます。

## 拒否
実行できない操作には、ステータス、メッセージコード、代わりに行えることで応答します:
- 公開済みのステップは、削除されずに廃止されます(409、`itgenwpt208`)。
- エンドユーザーが利用中のエクスペリエンスは、削除されずアーカイブされます(409、`itgenwpt209`)。
- `content.publish`を持たないトークンでは公開できません（403、`itgenwpt202`）。公開が許可されていない編集者のトークンは`itgenwpt212`で拒否されます。 別の操作のスコープを持たないトークンは、`itgenwpt202`でも拒否されます。
- 生のイベント、時間別の合計、監査証跡の行は変更または削除できません（405、`itgenwpt207`）。
- 使用中のセグメントやテーマは削除できません(409、`itgenwpt232`、`itgenwpt233`)。

すべての書き込み、拒否された書き込み、失敗したサインインは監査証跡に保存されます。 読み取りは対象外です。
