Google Business Messages 功能將於 2024 年 7 月 31 日終止服務。請按
這裡瞭解詳情。
程式碼範例
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
使用我們的範例,迅速展開開發作業。
Business Messages
收發使用者傳送的訊息。
虛擬服務專員 |
說明 |
語言 |
廚房水槽 |
這個服務機器人可讓你透過互動式方式,在裝置上探索 Business Messages 的功能。 |
Java
|
Echo Agent |
使用者傳送訊息時,這個服務會將訊息回送給使用者。包含 Business Messages API 的完整 SDK。 |
Node.js
Java
Python
|
預約設定代理程式 |
這個服務專員示範如何協助客戶與商家預約。聊天機器人會使用自訂的 Dialogflow 對話服務專員,提供對話功能。 |
Node.js
|
Bonjour Meal Agent |
這個代理程式會示範在店內購買線上商品的顧客使用者歷程。使用者可以查看商店商品、將商品加入購物車,然後透過網路結帳體驗付款。如要觀看示範影片的螢幕錄影,請按
這裡。 |
Python
|
gCal Assistant |
這個代理程式會示範如何在 Business 訊息中整合 OAuth 2.0 與身分識別提供者。這個範例展示了與
Google OAuth 2.0 整合的情形。 |
Python
|
購物車 |
這個範例展示如何在 Business Messages 中建立購物車體驗。 |
Java
|
轉接至真人服務專員 |
這個範例示範如何在自動化服務和真人服務人員之間轉接對話。 |
Node.js
|
虛擬寵物模擬遊戲 |
這個範例展示了在 Business Messages 中建構的虛擬寵物模擬遊戲。如要觀看示範影片的螢幕錄影,請按
這裡。 |
Node.js
|
啟動 |
這個範例示範如何接收及驗證訊息,以及如何使用互動式資訊卡、輪轉介面、圖片、連結、建議方塊等回覆使用者。 |
Node.js
|
商務通訊
管理 Business Messages 服務專員。
虛擬服務專員 |
說明 |
語言 |
指令列範例 |
展示 Business Communications API 功能。包含 Business Communications API 的完整 SDK。 |
Node.js
Java
Python
|
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2024-12-17 (世界標準時間)。
[null,null,["上次更新時間:2024-12-17 (世界標準時間)。"],[[["\u003cp\u003eJumpstart development with pre-built Business Messages samples showcasing features like rich cards, carousels, and suggestion chips.\u003c/p\u003e\n"],["\u003cp\u003eExplore various Business Messages agent samples including an echo agent, appointment setter, and a virtual pet simulation game.\u003c/p\u003e\n"],["\u003cp\u003eLeverage the Business Communications API to manage your Business Messages agents, with command-line samples available in Node.js, Java, and Python.\u003c/p\u003e\n"],["\u003cp\u003eAccess full SDKs for both Business Messages and Business Communications APIs, enabling comprehensive agent development and management.\u003c/p\u003e\n"],["\u003cp\u003eDiscover how to build engaging user experiences with features such as live agent transfer, shopping carts, and OAuth 2.0 integration.\u003c/p\u003e\n"]]],[],null,["# Code samples\n\nGet a jump start on development by using one of our samples.\n\nBusiness Messages\n-----------------\n\nSend and receive messages from users.\n\n| Agent | Description | Language |\n|-----------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Kitchen Sink | This agent provides an interactive way to explore Business Messages's features on your device. | [Java](https://github.com/google-business-communications/bm-java-kitchen-sink) |\n| Echo Agent | When the user sends a message, this agent echos the message back to the user. Includes the full SDK for the Business Messages API. | [Node.js](https://github.com/google-business-communications/bm-nodejs-echo-bot) [Java](https://github.com/google-business-communications/bm-java-echo-bot) [Python](https://github.com/google-business-communications/bm-python-echo-bot) |\n| Appointment Setting Agent | This agent demonstrates how to support a customer with setting up an appointment with a business. The chat bot uses a custom Dialogflow conversational agent to power the conversation. | [Node.js](https://github.com/google-business-communications/bm-nodejs-appointment-bot) |\n| Bonjour Meal Agent | This agent demonstrates a buy online purchase in store customer user journey. The user can view shop items, add items to a shopping cart, and then pay for the items through a web-based checkout experience. See a screencast of the demo [here](/static/business-communications/business-messages/files/bonjourmeal-screencast.mp4). | [Python](https://github.com/google-business-communications/bm-bonjour-meal-django-starter-code) |\n| gCal Assistant | This agent demonstrates the integration of OAuth 2.0 on Business Messages with an identity provider. This sample showcases the integration with [Google OAuth 2.0](/identity/protocols/oauth2). | [Python](https://github.com/google-business-communications/bm-gCal-bot) |\n| Shopping Cart | This sample showcases how to create a shopping cart experience on Business Messages. | [Java](https://github.com/google-business-communications/bm-shopping-cart) |\n| Live Agent Transfer | This sample demonstrates how to hand off conversations between automation and live agents. | [Node.js](https://github.com/google-business-communications/bm-nodejs-live-agent-transfer) |\n| Virtual Pet Simulation Game | This sample demonstrates a virtual pet simulation game built in Business Messages. See a screencast of the demo [here](/static/business-communications/business-messages/files/virtual-pet-sim-game-screencast.mp4). | [Node.js](https://github.com/google-business-communications/bm-gotchi-litpet-bot) |\n| Bootstrap | This sample demonstrates how to receive and validate messages, and how to reply to users with rich card, carousel, image, links, suggestion chips and more. | [Node.js](https://github.com/google-business-communications/bm-bootstrap-nodejs) |\n\nBusiness Communications\n-----------------------\n\nManage your Business Messages agents.\n\n| Agent | Description | Language |\n|---------------------|-------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Command Line Sample | Demonstrates the Business Communications API features. Includes the full SDK for the Business Communications API. | [Node.js](https://github.com/google-business-communications/bc-bm-nodejs-command-line-examples) [Java](https://github.com/google-business-communications/bc-bm-java-command-line-examples) [Python](https://github.com/google-business-communications/bc-bm-python-command-line-examples) |"]]