Notification API ドキュメント
通知 API(Notification API)
Notification API を使用すると、eBay 通知エクスペリエンス全体を管理できます。通知トピックの参照、宛先エンドポイントの作成・管理、サブスクリプションの構成・テスト、およびメッセージペイロードの整合性確認をサポートします。
バージョン: v1.6.2
ベースURL: https://api.ebay.com/commerce/notification/v1
認証(OAuth スコープ)
Client Credentials スコープ:
| スコープ | 説明 |
|---|---|
https://api.ebay.com/oauth/api_scope | eBay の公開データを表示 |
Authorization Code スコープ:
| スコープ | 説明 |
|---|---|
https://api.ebay.com/oauth/api_scope/commerce.notification.subscription | 通知サブスクリプションの表示と管理 |
https://api.ebay.com/oauth/api_scope/commerce.notification.subscription.readonly | 通知サブスクリプションの表示 |
リソース一覧
Notification API は以下の 7 リソース、合計 21 エンドポイントで構成されています。
| リソース | 説明 | 数 |
|---|---|---|
| config | アプリレベルの構成(アラート設定) | 2 |
| destination | 通知の宛先エンドポイントの管理 | 5 |
| public_key | 通知検証用の公開キー取得 | 1 |
| subscription | 通知サブスクリプションの管理 | 5 |
| subscription (enable/disable) | サブスクリプションの有効化/無効化 | 2 |
| subscription filter | サブスクリプションフィルターの管理 | 3 |
| subscription test | サブスクリプションのテスト | 1 |
| topic | 通知トピックの参照 | 2 |
config — アプリケーション構成(2 エンドポイント)
GET /config
getConfig — 以前に作成された構成を取得します。
レスポンス: 200 → Config / 404 / 500
PUT /config
updateConfig — 新しい構成を作成または既存の構成を更新します。アラート設定が可能です。
| パラメータ | 場所 | 必須 | 説明 |
|---|---|---|---|
Content-Type | ヘッダー | 必須 | application/json |
リクエストボディ: Config
レスポンス: 204 / 400 / 500
destination — 宛先管理(5 エンドポイント)
GET /destination
getDestinations — 宛先リソースのページ分けされたコレクションを取得します。
| パラメータ | 場所 | 必須 | 説明 |
|---|---|---|---|
limit | クエリ | 任意 | ページあたりの最大件数。最小: 10、最大: 100、デフォルト: 20 |
continuation_token | クエリ | 任意 | 次ページの継続トークン。 |
レスポンス: 200 → DestinationSearchResponse / 400 / 500
POST /destination
createDestination — HTTP プッシュ通知を受信する宛先エンドポイントを作成します。エンドポイントは challengeResponse で応答する準備が必要です。
| パラメータ | 場所 | 必須 | 説明 |
|---|---|---|---|
Content-Type | ヘッダー | 必須 | application/json |
リクエストボディ: DestinationRequest
レスポンス: 201 / 400 / 409 / 500
GET /destination/{destination_id}
getDestination — 特定の宛先の詳細を取得します。
| パラメータ | 場所 | 必須 | 説明 |
|---|---|---|---|
destination_id | パス | 必須 | 宛先の一意の識別子。 |
レスポンス: 200 → Destination / 400 / 404 / 500
PUT /destination/{destination_id}
updateDestination — 宛先を更新します。
| パラメータ | 場所 | 必須 | 説明 |
|---|---|---|---|
destination_id | パス | 必須 | 宛先の一意の識別子。 |
Content-Type | ヘッダー | 必須 | application/json |
リクエストボディ: DestinationRequest
レスポンス: 204 / 400 / 404 / 409 / 500
DELETE /destination/{destination_id}
deleteDestination — 宛先を削除します。アクティブな宛先は削除できません。サブスクリプションを無効にしてから削除してください。
| パラメータ | 場所 | 必須 | 説明 |
|---|---|---|---|
destination_id | パス | 必須 | 削除する宛先の一意の識別子。 |
レスポンス: 204 / 400 / 404 / 409 / 500
public_key — 公開キー取得(1 エンドポイント)
GET /public_key/{public_key_id}
getPublicKey — 通知の処理と検証に使用する公開キーを取得します。キー ID は通知の X-EBAY-SIGNATURE ヘッダーから取得されます。
重要: 取得した公開キーは一時的にキャッシュしてください(推奨: 1 時間)。通知ごとにリクエストすると API 呼び出し制限を超える可能性があります。
| パラメータ | 場所 | 必須 | 説明 |
|---|---|---|---|
public_key_id | パス | 必須 | 公開キーの一意の ID(X-EBAY-SIGNATURE ヘッダーから取得)。 |
レスポンス: 200 → PublicKey / 400 / 404 / 500
subscription — サブスクリプション管理(5 エンドポイント)
GET /subscription
getSubscriptions — すべてのサブスクリプションのページ分けされたリストを取得します。
| パラメータ | 場所 | 必須 | 説明 |
|---|---|---|---|
limit | クエリ | 任意 | ページあたりの最大件数。最小: 10、最大: 100、デフォルト: 20 |
continuation_token | クエリ | 任意 | 次ページの継続トークン。 |
レスポンス: 200 → SubscriptionSearchResponse / 400 / 500
POST /subscription
createSubscription — トピックとスキーマバージョンのサブスクリプションを作成します。無効モードで作成し、テスト後に有効化できます。
| パラメータ | 場所 | 必須 | 説明 |
|---|---|---|---|
Content-Type | ヘッダー | 必須 | application/json |
リクエストボディ: CreateSubscriptionRequest
レスポンス: 201 / 400 / 403 / 409 / 500
GET /subscription/{subscription_id}
getSubscription — 指定されたサブスクリプションの詳細を取得します。
| パラメータ | 場所 | 必須 | 説明 |
|---|---|---|---|
subscription_id | パス | 必須 | サブスクリプションの一意の識別子。 |
レスポンス: 200 → Subscription / 400 / 404 / 500
PUT /subscription/{subscription_id}
updateSubscription — サブスクリプションを更新します。
| パラメータ | 場所 | 必須 | 説明 |
|---|---|---|---|
subscription_id | パス | 必須 | サブスクリプションの一意の識別子。 |
Content-Type | ヘッダー | 必須 | application/json |
リクエストボディ: UpdateSubscriptionRequest
レスポンス: 204 / 400 / 404 / 409 / 500
DELETE /subscription/{subscription_id}
deleteSubscription — サブスクリプションを削除します(ステータスに関係なく削除可能)。
| パラメータ | 場所 | 必須 | 説明 |
|---|---|---|---|
subscription_id | パス | 必須 | サブスクリプションの一意の識別子。 |
レスポンス: 204 / 400 / 404 / 500
subscription — 有効化/無効化(2 エンドポイント)
POST /subscription/{subscription_id}/disable
disableSubscription — サブスクリプションを無効にし、通知の配信を停止します。
| パラメータ | 場所 | 必須 | 説明 |
|---|---|---|---|
subscription_id | パス | 必須 | 無効にする有効なサブスクリプションの ID。 |
レスポンス: 204 / 400 / 404 / 500
POST /subscription/{subscription_id}/enable
enableSubscription — 無効なサブスクリプションを有効にします。
| パラメータ | 場所 | 必須 | 説明 |
|---|---|---|---|
subscription_id | パス | 必須 | 有効にする無効なサブスクリプションの ID。 |
レスポンス: 204 / 400 / 404 / 409 / 500
subscription filter — フィルター管理(3 エンドポイント)
POST /subscription/{subscription_id}/filter
createSubscriptionFilter — サブスクリプションのフィルターを作成します。指定した基準に一致する通知のみが配信されます。フィルターは JSON Schema(バージョン 2020-12 以降)で定義します。作成直後は PENDING ステータスで、確認後に ENABLED に移行します。
| パラメータ | 場所 | 必須 | 説明 |
|---|---|---|---|
subscription_id | パス | 必須 | サブスクリプションの一意の識別子。 |
Content-Type | ヘッダー | 必須 | application/json |
リクエストボディ: CreateSubscriptionFilterRequest
レスポンス: 201 / 400 / 403 / 404 / 500
GET /subscription/{subscription_id}/filter/{filter_id}
getSubscriptionFilter — 指定されたサブスクリプションフィルターの詳細を取得します。
| パラメータ | 場所 | 必須 | 説明 |
|---|---|---|---|
subscription_id | パス | 必須 | サブスクリプションの一意の識別子。 |
filter_id | パス | 必須 | フィルターの一意の識別子。 |
レスポンス: 200 → SubscriptionFilter / 400 / 403 / 404 / 500
DELETE /subscription/{subscription_id}/filter/{filter_id}
deleteSubscriptionFilter — アクティブなフィルターを無効にします。PENDING ステータスのフィルターは無効にできません。
| パラメータ | 場所 | 必須 | 説明 |
|---|---|---|---|
subscription_id | パス | 必須 | サブスクリプションの一意の識別子。 |
filter_id | パス | 必須 | フィルターの一意の識別子。 |
レスポンス: 204 / 400 / 403 / 404 / 500
subscription test — テスト(1 エンドポイント)
POST /subscription/{subscription_id}/test
testSubscription — モックテストペイロードをトリガーし、サブスクリプションをエンドツーエンドでテストします。テストペイロードと実際のペイロードを区別するには notificationId を使用します。
| パラメータ | 場所 | 必須 | 説明 |
|---|---|---|---|
subscription_id | パス | 必須 | テストするサブスクリプションの一意の識別子。 |
レスポンス: 202 / 400 / 404 / 500
topic — トピック参照(2 エンドポイント)
GET /topic
getTopics — サポートされているすべての通知トピックのページ分けされたコレクションを返します。スキーマバージョン、形式、メタデータを含みます。
| パラメータ | 場所 | 必須 | 説明 |
|---|---|---|---|
limit | クエリ | 任意 | ページあたりの最大件数。最小: 10、最大: 100、デフォルト: 20 |
continuation_token | クエリ | 任意 | 次ページの継続トークン。 |
レスポンス: 200 → TopicSearchResponse / 400 / 500
GET /topic/{topic_id}
getTopic — 指定されたトピックの詳細を取得します。
| パラメータ | 場所 | 必須 | 説明 |
|---|---|---|---|
topic_id | パス | 必須 | 通知トピックの一意の識別子。 |
レスポンス: 200 → Topic / 400 / 404 / 500
スキーマ定義(全 18 スキーマ)
構成
Config
| フィールド | 型 | 説明 |
|---|---|---|
alertEmail | string | アラートメールアドレス |
宛先
Destination
| フィールド | 型 | 説明 |
|---|---|---|
destinationId | string | 宛先の一意の ID |
name | string | 宛先名 |
status | string | ステータス |
deliveryConfig | DeliveryConfig | 配信構成 |
DestinationRequest
| フィールド | 型 | 説明 |
|---|---|---|
name | string | 宛先名 |
status | string | ステータス |
deliveryConfig | DeliveryConfig | 配信構成 |
DeliveryConfig
| フィールド | 型 | 説明 |
|---|---|---|
endpoint | string | エンドポイント URL |
verificationToken | string | 検証トークン |
DestinationSearchResponse
| フィールド | 型 | 説明 |
|---|---|---|
destinations | array[Destination] | 宛先の配列 |
href | string | 現在の結果の URI |
next | string | 次ページの URI |
limit | integer | 最大件数 |
total | integer | 総数 |
公開キー
PublicKey
| フィールド | 型 | 説明 |
|---|---|---|
key | string | 公開キーの値 |
algorithm | string | アルゴリズム |
digest | string | ダイジェスト |
サブスクリプション
Subscription
| フィールド | 型 | 説明 |
|---|---|---|
subscriptionId | string | サブスクリプション ID |
topicId | string | トピック ID |
destinationId | string | 宛先 ID |
status | string | ステータス |
payload | SubscriptionPayloadDetail | ペイロード詳細 |
filterId | string | フィルター ID |
creationDate | string | 作成日時 |
CreateSubscriptionRequest
| フィールド | 型 | 説明 |
|---|---|---|
topicId | string | トピック ID |
destinationId | string | 宛先 ID |
status | string | ステータス |
payload | SubscriptionPayloadDetail | ペイロード詳細 |
UpdateSubscriptionRequest
| フィールド | 型 | 説明 |
|---|---|---|
destinationId | string | 宛先 ID |
status | string | ステータス |
payload | SubscriptionPayloadDetail | ペイロード詳細 |
SubscriptionPayloadDetail
| フィールド | 型 | 説明 |
|---|---|---|
format | string | 形式(例: JSON) |
schemaVersion | string | スキーマバージョン |
deliveryProtocol | string | 配信プロトコル |
SubscriptionSearchResponse
| フィールド | 型 | 説明 |
|---|---|---|
subscriptions | array[Subscription] | サブスクリプションの配列 |
href | string | 現在の結果の URI |
next | string | 次ページの URI |
limit | integer | 最大件数 |
total | integer | 総数 |
フィルター
CreateSubscriptionFilterRequest
| フィールド | 型 | 説明 |
|---|---|---|
filterSchema | object | 有効な JSON Schema(バージョン 2020-12 以降) |
SubscriptionFilter
| フィールド | 型 | 説明 |
|---|---|---|
filterId | string | フィルター ID |
subscriptionId | string | サブスクリプション ID |
filterSchema | object | フィルタースキーマ |
filterStatus | string | フィルターステータス(PENDING / ENABLED) |
creationDate | string | 作成日時 |
トピック
Topic
| フィールド | 型 | 説明 |
|---|---|---|
topicId | string | トピック ID |
description | string | 説明 |
status | string | ステータス |
context | string | コンテキスト |
scope | string | スコープ |
filterable | boolean | フィルタリング可能かどうか |
authorizationScopes | array[string] | 必要な認可スコープ |
supportedPayloads | array[PayloadDetail] | サポートされるペイロード |
PayloadDetail
| フィールド | 型 | 説明 |
|---|---|---|
format | string | 形式 |
schemaVersion | string | スキーマバージョン |
deliveryProtocol | string | 配信プロトコル |
deprecated | boolean | 非推奨かどうか |
TopicSearchResponse
| フィールド | 型 | 説明 |
|---|---|---|
topics | array[Topic] | トピックの配列 |
href | string | 現在の結果の URI |
next | string | 次ページの URI |
limit | integer | 最大件数 |
total | integer | 総数 |
共通スキーマ
Error
| フィールド | 型 | 説明 |
|---|---|---|
category | string | エラーカテゴリ |
domain | string | エラードメイン |
errorId | integer | エラー ID |
message | string | 短いメッセージ |
longMessage | string | 詳細メッセージ |
inputRefIds | array[string] | 入力参照 ID |
outputRefIds | array[string] | 出力参照 ID |
parameters | array[ErrorParameter] | エラーパラメータ |
subdomain | string | エラーサブドメイン |
ErrorParameter
| フィールド | 型 | 説明 |
|---|---|---|
name | string | パラメータ名 |
value | string | パラメータ値 |
エンドポイント一覧(全 21 エンドポイント)
| メソッド | エンドポイント | operationId | 説明 |
|---|---|---|---|
| GET | /config | getConfig | 構成を取得 |
| PUT | /config | updateConfig | 構成を作成/更新 |
| GET | /destination | getDestinations | 宛先一覧を取得 |
| POST | /destination | createDestination | 宛先を作成 |
| GET | /destination/{destination_id} | getDestination | 宛先の詳細を取得 |
| PUT | /destination/{destination_id} | updateDestination | 宛先を更新 |
| DELETE | /destination/{destination_id} | deleteDestination | 宛先を削除 |
| GET | /public_key/{public_key_id} | getPublicKey | 公開キーを取得 |
| GET | /subscription | getSubscriptions | サブスクリプション一覧を取得 |
| POST | /subscription | createSubscription | サブスクリプションを作成 |
| GET | /subscription/{subscription_id} | getSubscription | サブスクリプションの詳細を取得 |
| PUT | /subscription/{subscription_id} | updateSubscription | サブスクリプションを更新 |
| DELETE | /subscription/{subscription_id} | deleteSubscription | サブスクリプションを削除 |
| POST | /subscription/{subscription_id}/disable | disableSubscription | サブスクリプションを無効化 |
| POST | /subscription/{subscription_id}/enable | enableSubscription | サブスクリプションを有効化 |
| POST | /subscription/{subscription_id}/filter | createSubscriptionFilter | フィルターを作成 |
| GET | /subscription/{subscription_id}/filter/{filter_id} | getSubscriptionFilter | フィルターの詳細を取得 |
| DELETE | /subscription/{subscription_id}/filter/{filter_id} | deleteSubscriptionFilter | フィルターを削除 |
| POST | /subscription/{subscription_id}/test | testSubscription | サブスクリプションをテスト |
| GET | /topic | getTopics | トピック一覧を取得 |
| GET | /topic/{topic_id} | getTopic | トピックの詳細を取得 |