サポートされているApple Messages for Business機能
Oracle Digital AssistantでApple Messages for Businessチャネルを介して公開するスキルの場合、他のチャネルで一般的にサポートされている機能に加えて、Apple Messages for Businessに固有の機能を使用できます。
そのためには、通常、共通レスポンス・コンポーネントのchannelCustomProperties
要素を使用して、Apple固有のプロパティを挿入します。
コードのフォーマットは次のとおりです:
...
channelCustomProperties:
- channel: "apple"
properties:
PROPERTY_NAME: "PROPERTY_VALUE"
...
Rich Link
リッチ・リンク・メッセージをApple Messages for Businessチャネルに組み込むには、richLinkData
チャネルのカスタム・プロパティとそのサブプロパティassets
を使用します。assets
プロパティは、次の例に示すように、image
オブジェクトまたはvideo
オブジェクトのいずれかをとることができます。
channelCustomProperties:
- channel: "apple"
properties:
richLinkData:
assets:
image:
data: "<base-64-encoded image data>"
mimeType: "image/jpeg"
video:
mimeType: "video/mp4",
url: "https://example.com/example.mov"
例: リッチ・リンク・イメージ
responseItems:
- type: "text"
text: "iPad Pro"
actions:
- type: "url"
url: "https://www.apple.com/ipad-pro/"
channelCustomProperties:
- channel: "apple"
properties:
richLinkData:
assets:
image:
data: "<base 64 encoded image data>"
mimeType: "image/jpeg"
例: リッチ・リンクのビデオ
responseItems:
- type: "text"
text: "HomePod"
actions:
- type: "url"
url: "https://images.apple.com/media/films/expand/homepod-expand-tpl-cc-us-20180306_1280x720h.mp4"
channelCustomProperties:
- channel: "apple"
properties:
richLinkData:
assets:
image:
data: "<base 64 encoded image data>"
mimeType: "image/jpeg"
video:
mimeType: "video/mp4",
url: "https://store.storevideos.cdn-apple.com/v1/store.apple.com/st/1619042871000/mx532-
クイック返信
「クイック返信」メッセージ・タイプは、ユーザーが1回のタップで選択できる2対5の事前定義済レスポンスを提供するために、Apples Messages for Businessで使用される規則です。
クイック返信のサマリー・テキストは、summaryText
チャネルのカスタム・プロパティを使用して設定できます。
channelCustomProperties:
- channel: apple
properties:
summaryText: Your selection
summaryText
プロパティを指定しない場合、チャネルはかわりにtext
プロパティを使用します。
また、次のことに注意してください。
summaryText
は25文字以下にする必要があります。- キーワードの場合は、
A
、B
、C
、D
およびE
(数値ではなく)を使用します。
例: クイック返信
responseItems:
- text: "You can type or select from the options below:"
type: text
actions:
- payload:
variables:
menuAction: orderAccessories
action: orderAccessories
label: "Order Accessories"
type: postback
keyword: "A"
- payload:
variables:
menuAction: checkOrder
action: checkOrder
label: "Check Order Status"
type: postback
keyword: "B"
channelCustomProperties:
- channel: apple
properties:
summaryText: Your selection
リスト・ピッカー
Apple Messages for Businessには、ユーザーが1つ以上のオプションを選択できるようにするために使用できるリスト・ピッカー・メッセージ・タイプがあります。Apple Messages for BusinessチャネルにList Pickerメッセージを組み込むには、次のAppleチャネルのカスタム プロパティを使用します。
images
.これは、receivedMessage
およびreplyMessage
プロパティによって使用され、次の要素を含むオブジェクトのリストです。identifier
: イメージが他のプロパティによって参照される識別子。imageUrl
: 表示されるイメージのURL。description
.
receivedMessage
.これは、次のオプション要素を持つオブジェクトです。imageIdentifier
.この値は、images
カスタム・プロパティで定義されたいずれかのイメージのidentifier
プロパティと一致する必要があります。style
.指定可能な値は、icon
、small
およびlarge
です。subtitle
.title
.
replyMessage
.これは、次のオプション要素を持つオブジェクトです。imageIdentifier
.この値は、images
カスタム・プロパティで定義されたいずれかのイメージのidentifier
プロパティと一致する必要があります。style
.指定可能な値は、icon
、small
およびlarge
です。subtitle
.title
.
imageIdentifier
.このプロパティは、options
要素のchannelCustomProperties
要素内で使用して、ピッカーのオプションにイメージを追加できます。この値は、images
カスタム・プロパティで定義されたいずれかのイメージのidentifier
プロパティと一致する必要があります。
単一選択リスト・ピッカーは、cards
またはeditForm
レスポンス・アイテム・タイプを使用して作成できます。
editForm
を使用する単一選択リスト・ピッカーの場合:
- アイテムの
displayType
を"singleSelect"
に設定します。
複数選択リスト・ピッカーの場合は、editForm
レスポンス・アイテム・タイプを使用します:
- アイテムの
displayType
を"multiSelect"
に設定します。
singleSelect
リストとmultiSelect
リストの任意の組合せを使用して、複数のセクションを持つリスト・ピッカーを作成することもできます。これを行うには、各セクションのitems
にエントリを作成し、各エントリのdisplayType
を、そのセクションに必要なリストのタイプに応じて"singleSelect"
または"multiSelect"
に設定します。
例: カードを使用した単一選択リスト・ピッカー
responseItems:
- type: "cards"
cardLayout: "horizontal"
headerText: "Here are our pizzas you can order today:"
visible:
entitiesToResolve:
include: "Type"
cards:
- title: "${enumValue}"
description: ""
imageUrl: "system.entityToResolve.value.image"
iteratorVariable: "system.entityToResolve.value.enumValues"
actions:
- label: "Order Now"
type: "postback"
payload:
variables:
pizza: "${enumValue}"
channelCustomProperties:
- channel: "apple"
properties:
images:
- identifier: image1
imageUrl: "https://example.com/url1.jpg"
- identifier: image2
imageUrl: "https://example.com/url2.jpg"
receivedMessage:
imageIdentifier: "image1"
style: "small"
subtitle: "Fresh baked for you"
title: "Select Your Pizza"
replyMessage:
title: "Selected Pizza"
style: "small"
imageIdentifier: "image2"
例: editFormを使用した単一選択ListPicker
responseItems:
- headerText: "Let's start Shopping!"
type: editForm
formColumns: 1
items:
- displayType: singleSelect
name: selectHeadset
options:
- label: "Logitech® G435 LIGHTSPEED Wireless Gaming Headset"
value: LogitechG435
channelCustomProperties:
- channel: apple
properties:
imageIdentifier: logitech g435
- label: "JBL Live 660NC Wireless Over-Ear NC Headphones"
value: JBL660NC
channelCustomProperties:
- channel: apple
properties:
imageIdentifier: jbl 660nc
- label: "Altec Lansing® 3-In-1, MZX4100-PGRN-STK-6"
value: altec
channelCustomProperties:
- channel: apple
properties:
imageIdentifier: altec
label: Select the headset of your choice
placeholder: Tap to select the product
channelCustomProperties:
- channel: apple
properties:
subtitle: Headset of your choice
required: true
actions:
- processingMethod: mapVariable
variable: skill.skillSelectedProduct
label: Submit
type: submitForm
channelCustomProperties:
- channel: apple
properties:
showSummary: true
receivedMessage:
imageIdentifier: main
subtitle: Personalized search on basis of your requirements
style: large
title: "Tap & Select Headphones"
images:
- identifier: main
imageUrl: "https://example.com/b/shopping-cart-headphones-23724543.jpg"
- identifier: logitech g435
imageUrl: "https://example.com/60_o01_040122/2310460.jpg"
description: "Play never ends with G435."
- identifier: jbl 660nc
imageUrl: "https://example.com/7693360_o01/7693360.jpg"
description: "Enjoy while studying or working out."
- identifier: altec
imageUrl: "https://example.com/18_o01_110422/5159518.jpg"
description: "Simple setup."
replyMessage:
imageIdentifier: logitech g435
subtitle: "Your cart is ready!"
style: icon
title: Tap to view your response.
ListPicker (複数選択)
responseItems:
- headerText: Choose the type of product you are looking
type: editForm
formColumns: 1
items:
- displayType: multiSelect
name: features
options:
- label: Noise cancellation
value: Noise cancellation
- label: Microphone/Remote
value: Microphone/Remote
- label: Wireless
value: Wireless
- label: USB connectivity
value: USB connectivity
- label: Voice Assistant Support
value: Voice Assistant Support
- label: Fast Charging
value: Fast Charging
label: What features are you looking for?
placeholder: Select multiple-values
required: true
- displayType: multiSelect
name: usage
options:
- label: Attending Online Meetings
value: Attending Online Meetings
- label: Music
value: Music
- label: Casual usage
value: Casual usage
- label: Binge Watching
value: Binge Watching
- label: Jogging/Gym
value: Jogging/Gym
label: Your purpose of usage
placeholder: Select multiple-values
required: true
actions:
- processingMethod: mapVariable
variable: requirementMap
label: Submit
type: submitForm
channelCustomProperties:
- channel: apple
properties:
receivedMessage:
imageIdentifier: main
subtitle: "Customize your product search!"
style: icon
title: "Tap & Provide your Preferences"
images:
- identifier: main
imageUrl: "https://example.com/images/search-filter-icon.jpg"
- identifier: filter
imageUrl: "https://example.com/images/filter.jpg"
replyMessage:
imageIdentifier: filter
style: icon
時間ピッカー
Apples Messages for Businessの「時間ピッカー」メッセージ・タイプを使用して、ユーザーにタイム・スロットを提供します。editForm
の各timePicker
フィールド要素は、ユーザーが選択できる1つのタイム・スロットに対応します。defaultValue
プロパティを使用して開始時間を設定し、Appleチャネルのカスタム・プロパティduration
を使用してタイム・スロットの期間を秒単位で設定します。timeZoneOffset
およびlocation
には、Appleチャネルのカスタム・プロパティもあります。
例: 時間ピッカー
responseItems:
- headerText: "Select Date & Time for your appointment"
type: editForm
formColumns: 2
items:
- displayType: timePicker
defaultValue: "2023-05-10T06:00Z"
name: 27JanOne
label: Slots available
channelCustomProperties:
- channel: apple
properties:
duration: 1800
required: true
- displayType: timePicker
defaultValue: "2023-05-05T07:30Z"
name: 27JanTwo
label: Enter Time
channelCustomProperties:
- channel: apple
properties:
duration: 1800
required: true
- displayType: timePicker
defaultValue: "2023-05-11T07:30Z"
name: 24th
label: another time
channelCustomProperties:
- channel: apple
properties:
duration: 1800
required: true
actions:
- label: Submit
type: submitForm
channelCustomProperties:
- channel: apple
properties:
receivedMessage:
imageIdentifier: clock
subtitle: "Every slot is of 30 mins.!"
style: large
title: "Tap & Select from available Slots"
images:
- identifier: clock
imageUrl: "https://example.com/images/clock.png"
description: clock
timezoneOffset: 1200
replyMessage:
imageIdentifier: clock
style: icon
title: Selected Slot
location:
latitude: 28.605354
radius: 1.5
title: Supremo Customer Service Center
longitude: 77.053546
Appleフォーム
editForm
レスポンス・アイテム・タイプを使用して、次のフィールド・タイプの組合せでAppleフォーム・メッセージを作成できます。
numberInput
textInput
datePicker
timePicker
singleSelect
multiSelect
フォームの各種フィールドに必要なカスタム・チャネル・プロパティに加えて、フォーム全体に対して次のAppleチャネル・カスタム・プロパティを使用します。
submitForm
。フォームの最後のアイテムに対してtrue
に設定します。pickerTitle
。オプションで、特定のピッカー・テキスト・フィールドに表示されるテキストを設定できます。selectedItemIndex
。オプションで、デフォルトで選択する項目の索引番号を設定できます。デフォルトは0
です。
splash
Appleチャネル・カスタム・プロパティを使用して、フォームのようこそページを定義します。splash
プロパティには、次の要素が含まれます。
header
.splashText
.buttonTitle
.ボタン上に表示されるテキスト。これは必須ですimageIdentifier
.
例: Appleフォーム
responseItems:
- headerText: Provide Delivery Address details
type: editForm
formColumns: 1
items:
- displayType: textInput
name: house_address
label: House No.
required: true
maxLength: 100
channelCustomProperties:
- channel: apple
properties:
subtitle: Your House/Appartment No.
options:
keyboardType: numberPad
- displayType: textInput
name: street_address
label: Street Name
channelCustomProperties:
- channel: apple
properties:
subtitle: Your Street Details
options:
keyboardType: default
required: true
maxLength: 200
- displayType: numberInput
name: zipcode
label: Where do you live?
placeholder: Enter your area zipcode
channelCustomProperties:
- channel: apple
properties:
subtitle: Zip-code
required: true
actions:
- label: Submit
type: submitForm
channelCustomProperties:
- channel: apple
properties:
showSummary: true
receivedMessage:
imageIdentifier: main
subtitle: "Add your details carefully!"
style: icon
title: "Tap & Provide your Delivery details"
images:
- identifier: main
imageUrl: "https://example.com/delivery-address.png"
- identifier: saveAddress
imageUrl: "https://example.com/successful-delivery.png"
replyMessage:
imageIdentifier: saveAddress
style: icon
title: Your address details are saved. Tap to review.
splash:
imageIdentifier: main
認証
Apple Messages for Businessの認証メッセージには、デジタル・アシスタントのOAuthアカウント・リンク・コンポーネントを使用できます。次の2つの方法を使用できます。
- OAuthアカウント・リンク・コンポーネントの「URLの認可」プロパティで、
responseType
およびscope
問合せパラメータを指定します。認証に成功すると、認可コードが返され、アクセス・トークンのフェッチに使用されます。
- OAuthアカウント・リンク・コンポーネントの「URLの認可」プロパティで、
responseType
、clientSecret
およびscope
問合せパラメータを指定します。認証に成功すると、アクセス・トークンが返されます。
iMessageアプリケーション
Apple Messages for Businessでは、カスタム対話型データメッセージである iMessage Appタイプのメッセージを作成できます。これらのメッセージをデジタル・アシスタントのApple Messages for Businessチャネル内で機能させるには、カスタム・コンポーネントを使用して、スキル自体のAppleインタラクティブ・データ・ペイロードを構築する必要があります。
カスタム・コンポーネントは、次のペイロード属性を含むRAW共通メッセージ・モデル(CMM)メッセージを送信する必要があります。
type: interactive
(必須)interactiveData
:appIcon
appId
appName
URL
(必須)bid
(必須)receivedMessage
replyMessage
useLiveLayout
iMessageアプリケーションの作成に関するチュートリアルは、AppleのドキュメントのiMessageアプリケーションの統合を参照してください。
デジタル・アシスタントの共通メッセージ・モデルの使用の詳細は、ボット・ノードSDKドキュメントの会話メッセージングの項を参照してください。
例: iMessageアプリケーション・ペイロード
{
"type": "interactive",
"interactiveData": {
"appId": 12345678,
"appName": "Package Delivery",
"URL": "?name=WWDC%20Goodies&deliveryDate=09-06-2017&destinationName=Moscone%20Convention%20Center&street=747%20Howard%20St&state=CA&city=San%20
Fransisco&country=USA&postalCode=94103&latitude=37%2E7831&longitude=%2D122%2E4041&extraCharge=15%2E00",
"bid": "com.apple.messages.MSMessageExtensionBalloonPlugin:4R3L6Z3UP2:com.example.apple-samplecode.PackageDelivery4R3L6Z3UP2.MessagesExtension",
"receivedMessage": {
"title": "PackageDelivery",
"subtitle": "Tap to Install the iMessage App from App Store"
}
}
}
ChannelCustomProperties (Apple Messages for Businessの場合)
名前 | 許可される値 | 適用対象 | 説明 |
---|---|---|---|
images |
次のプロパティを持つネストされたオブジェクト:
|
editForm レスポンス項目。
|
フォーム内のリスト アイテムやその他の場所で使用するために定義するイメージ。 |
receivedMessage |
次のプロパティを持つネストされたオブジェクト。これらはすべてオプションです。
|
editForm レスポンス・アイテム
|
リスト・ピッカーまたは他のメッセージ・タイプの上に表示されるメッセージ。 |
replyMessage |
次のプロパティを持つネストされたオブジェクト。これらはすべてオプションです。
|
editForm レスポンス・アイテム
|
ユーザーが特定のピッカーを使用して選択を行った後に表示されるメッセージ。 |
location |
次のプロパティを持つネストされたオブジェクト:
|
editForm レスポンス項目。
|
指定された場所の座標を提供します。 |
showSummary |
|
editForm レスポンス項目。
|
true の場合、ユーザーが選択したオプションのサマリーが表示されます。デフォルトはfalse です。
|
splash |
次のプロパティを持つネストされたオブジェクト:
|
editForm レスポンス項目。
|
フォームのようこそページを定義するために使用します。 |
timeZoneOffset |
数値 | editForm レスポンス項目。
|
ロケーションのタイム・ゾーンとGMTの時間の差異(分)。 |
imageIdentifier |
images 配列内のイメージのidentifier 値と一致する文字列。
|
editForm のoptions 配列内のオブジェクトは、項目に対応します。
|
タイプがeditForm のレスポンス項目の特定のオプションにイメージを適用するために使用されます。
|
subtitle |
任意の文字列 | editForm レスポンス項目。
|
リスト・ピッカーのオプションのサブタイトル。
ノート: |
duration |
数値 | displayType がtimePicker のeditForm レスポンス・アイテム |
デュレーションの秒数。 |
options |
keyboardType やdateFormat などのプロパティを持つネストされたオブジェクト。datePicker およびinput ページ・タイプには個別のオプションがあります。Appleのフォーム・メッセージのドキュメントを参照してください。
|
editForm は、displayType がdatePicker およびtextInput の項目に対応します。
|
個々のアイテムで使用できるApple Messages for Businessチャネルに固有のプロパティのカテゴリ。
ノート:このカテゴリは、 |
submitForm |
false |
dataSet レスポンス項目タイプの個々の項目。
|
アイテムの選択時にフォームを送信する場合は、true に設定します。デフォルトはfalse です。
|
pickerTitle |
文字列 | dataSet レスポンス項目タイプの個々の項目。
|
ピッカー・テキスト・フィールドの横に表示されるオプションのテキストを表す文字列値。この値のデフォルトは空の文字列です。空の場合、ピッカー・テキスト・フィールドはページに集中します |
selectedItemIndex |
数値 | dataSet レスポンス項目タイプの個々の項目。
|
オプションで、デフォルトで選択するピッカーのアイテムのインデックス番号を設定するために使用します。デフォルトは0 です。
|