受信Webhookでの高度なメッセージ書式設定の使用

受信Webhookでの高度なメッセージ書式設定の使用

お知らせ:当社は、お客様により充実したサポート情報を迅速に提供するため、本ページのコンテンツは機械翻訳を用いて日本語に翻訳しています。正確かつ最新のサポート情報をご覧いただくには、本内容の英語版を参照してください。

高度な書式設定オプションについて  

高度な書式設定を使用すると、Webhookの投稿を、書式なしテキストではなく、より表現豊かな形式で表示できます。同じ書式設定はコメントにも使用できます。カードに加えて、表、ラベル、リスト、画像のスライドを使用できます。スライドの基本構造は、type、title、text、data、および任意のbuttonsで構成され、1つの投稿に最大5個のボタンを含めることができます。

 

カード形式のメッセージの投稿  

カードには、タイトル、テキスト、サムネイルを含めることができます。以下の形式では、カードのタイトルは100文字、テキストは200文字、サムネイル画像のサイズは1,000KBが上限です。

curl --request POST \
--url '<URL got from the configuration>' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'payload={'message':'A new profile has been added.','card':{'title':'Speaker profile','text':'*Role* : Product Lead <br> *Region* : APAC','thumbnail':'https://example.com/images/speaker.png'}}'

 

表スライドの投稿  

構造化されたデータを表示するには、表スライドを使用します。表には最大20個の見出しと50行を含めることができ、各見出しと値には最大100文字を入力できます。

curl --request POST \
--url '<URL got from the configuration>' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'payload={'message':'Weekly metrics summary','slides':[{'type':'table','title':'Engagement summary','text':'Top metrics for this week','data':{'headers':['Metric','Value'],'rows':[{'Metric':'Posts','Value':'42'},{'Metric':'Comments','Value':'128'}]}}]}'

 

ラベルスライドの投稿  

ラベルとリンク先のリソースなど、キーと値のペアを表示するには、ラベルスライドを使用します。

curl --request POST \
--url '<URL got from the configuration>' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'payload={'message':'Hi guys! Checkout my new YOUTUBE video.','slides':[{'type':'label','title':'New Training Video is OUT','data':[{'Q1':'[Revenue report](https://example.com/q1)'},{'Q2':'[Revenuereport](https://example.com/q2)'},{'Q3':'[Revenuereport](https://example.com/q3)'}]}]}'

 

リストスライドの投稿  

複数の要点を順序立ててまとめたり、チェックリスト形式で最新情報を伝えたりするには、リストスライドを使用します。

curl --request POST \
--url '<URL got from the configuration>' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'payload={'message':'Here are the event details.','slides':[{'type':'list','title':'Key points','text':'Topics covered in today'\''s session','data':['Review the event highlights','Share Insights']}]}'

 

画像スライドの投稿  

Webhookの投稿に1つ以上の画像URLを埋め込むには、画像スライドを使用します。

curl --request POST \
--url '<URL got from the configuration>' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'payload={'message':'Weekly onboarding report','slides':[{'type':'images','title':'Engagement charts','data':['https://example.com/chart1.png','https://example.com/chart2.png','https://example.com/chart3.png']}]}'

 

投稿の強調表示  

投稿を目立たせるには、styles.highlightをtrueに設定します。

curl --request POST \
--url '<URL got from the configuration>' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'payload={'message':'Please review the community guidelines.','slides':[{'type':'label','title':'Required documents','data':[{'Policy':'[Open document](https://example.com/policy)'}]}],'styles':{'highlight':'true'}}'

 

CTAボタンの追加  

CTAボタンはbuttons配列を使用して追加します。各ボタンにはlabel、hint、actionを使用します。以下の形式では、labelには最大20文字、hintには最大100文字を入力でき、対応するアクションの種類としてopen.urlが示されています。アクションのデータには、Web、iOS、Androidそれぞれのリンク先を指定できます。

curl --request POST \
--url '<URL got from the configuration>' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'payload={'message':'Join the session if you are available.','buttons':[{'label':'Join','hint':'Open the event link','action':{'type':'open.url','data':{'web':'https://example.com/join','iOS':'https://example.com/ios/join','Android':'https://example.com/android/join'}}}]}'

 

Zoho CommunitySpacesでの受信Webhookの設定についてサポートが必要な場合は、support@zohocommunityspaces.comまでお問い合わせください。