Message API ドキュメント

メッセージ API(Commerce Message API)

この API により、eBay セラーはメッセージの送信、取得、管理が可能になります。バイヤーとセラー間(M2M)、または eBay からの通知メッセージを会話として管理できます。

バージョン: 1.0.0

ベースURL: https://api.ebay.com/commerce/message/v1

認証(OAuth スコープ)

スコープ説明
https://api.ebay.com/oauth/api_scope/commerce.messageメッセージの送信・取得・管理

リソース一覧

Commerce Message API は 1 リソース(conversation)、合計 5 エンドポイント(2 GET + 3 POST)で構成されています。

リソース説明
conversation会話の取得・送信・更新・一括更新5

conversation — 会話管理(5 エンドポイント)

GET /conversation

getConversations — ユーザーに関連付けられた会話一覧を取得します。会話ステータス、リファレンス、ユーザー名、時間範囲でフィルタリング可能。

パラメータ場所必須説明
conversation_typeクエリ必須会話タイプ: FROM_EBAY / FROM_MEMBERS
conversation_statusクエリ任意ステータス: ACTIVE / ARCHIVE / DELETE / READ / UNREAD
start_timeクエリ任意開始時間(ISO 8601)。FROM_MEMBERS のみ。
end_timeクエリ任意終了時間(ISO 8601)。FROM_MEMBERS のみ。
other_party_usernameクエリ任意相手の eBay ユーザー名。
reference_idクエリ任意リファレンス ID。reference_type と併用必須。
reference_typeクエリ任意リファレンスタイプ。現在 LISTING のみ。
limitクエリ任意最大件数。デフォルト: 25、最大: 50
offsetクエリ任意スキップ件数。デフォルト: 0

レスポンス: 200 / 400 / 401 / 403 / 404 / 500

GET /conversation/{conversation_id}

getConversation — 特定の会話内のメッセージを取得します。

パラメータ場所必須説明
conversation_idパス必須会話の一意の識別子。
conversation_typeクエリ必須会話タイプ: FROM_EBAY / FROM_MEMBERS
limitクエリ任意最大件数。デフォルト: 25、最大: 50
offsetクエリ任意スキップ件数。デフォルト: 0

レスポンス: 200 / 400 / 401 / 403 / 404 / 500

POST /send_message

sendMessage — 新しい会話を開始するか、既存の会話でメッセージを送信します。

既存の会話: conversationId 必須。新規会話: otherPartyUsername 必須。メディア(画像/ドキュメント)を最大 5 件添付可能。

パラメータ場所必須説明
Content-Typeヘッダー必須application/json

リクエストボディ(SendMessageRequest):

フィールド説明
conversationIdstring既存の会話 ID(既存会話時は必須)
otherPartyUsernamestring相手の eBay ユーザー名(新規会話時は必須)
messageTextstringメッセージ本文。最大: 2000 文字
messageMediaarray[MessageMedia]添付メディア。最大 5 件。タイプ: IMAGE / PDF / DOC / TXT
emailCopyToSenderboolean送信者にメールコピーを送るか
referenceReferenceリスティングへの関連付け

レスポンス: 201 / 400 / 401 / 403 / 500

POST /update_conversation

updateConversation — 会話の conversationStatus または read ステータスを更新します。一度に更新できるのは一方のみ。両方含まれる場合は read のみ更新されます。

パラメータ場所必須説明
Content-Typeヘッダー必須application/json

リクエストボディ(UpdateConversationRequest):

フィールド説明
conversationIdstring更新対象の会話 ID(必須)
conversationTypestring既存の会話タイプ(必須、更新不可): FROM_MEMBERS / FROM_EBAY
conversationStatusstring更新後のステータス: ACTIVE / ARCHIVE / DELETE
readboolean既読ステータス。true = 既読、false = 未読

レスポンス: 204 / 400 / 401 / 403 / 500

POST /bulk_update_conversation

bulkUpdateConversation — 最大 10 件の会話の conversationStatus を一括更新します。

パラメータ場所必須説明
Content-Typeヘッダー必須application/json

レスポンス: 200 / 400 / 401 / 403 / 500

主要スキーマ定義(全 15 スキーマ)

ConversationDetail

フィールド説明
conversationIdstring会話の一意の識別子
conversationStatusstring会話の現在のステータス
conversationTitlestring会話のタイトル
conversationTypestring会話タイプ: FROM_EBAY / FROM_MEMBERS
createdDatestring会話作成日(ISO 8601)
latestMessageMessageDetail最新メッセージの詳細
referenceIdstringリファレンス ID(リスト ID 等)
referenceTypestringリファレンスタイプ
unreadCountinteger未読メッセージ数

MessageDetail

フィールド説明
messageIdstringメッセージの一意の識別子
messageBodystringメッセージ本文
subjectstring件名
senderUsernamestring送信者のユーザー名
recipientUsernamestring受信者のユーザー名
readStatusboolean既読かどうか
createdDatestringメッセージ作成日
messageMediaarray[MessageMedia]添付メディア

MessageMedia

フィールド説明
mediaNamestringメディア名
mediaTypestringメディアタイプ: IMAGE / PDF / DOC / TXT
mediaUrlstringメディア URL(HTTPS 必須)

その他のスキーマ: BulkConversation, BulkUpdateConversationsRequest, BulkUpdateConversationsResponse, ConversationsMetadata, ConversationsResponse, GetAllMyConversationsResponse, GetMessagesByConversationIdResponse, Reference, SendMessageRequest, SendMessageResponse, UpdateConversationRequest, Error, ErrorParameter

エンドポイント一覧(全 5 エンドポイント)

メソッドエンドポイントoperationId説明
GET/conversationgetConversations会話一覧取得
GET/conversation/{conversation_id}getConversation特定会話のメッセージ取得
POST/send_messagesendMessageメッセージ送信
POST/update_conversationupdateConversation会話ステータス更新
POST/bulk_update_conversationbulkUpdateConversation会話一括ステータス更新
トップに戻る