আমরা 31 জুলাই, 2024-এ Google বিজনেস মেসেজ বন্ধ করে দেব।
এখানে আরও পড়ুন।
ওহে বিশ্ব
সেভ করা পৃষ্ঠা গুছিয়ে রাখতে 'সংগ্রহ' ব্যবহার করুন
আপনার পছন্দ অনুযায়ী কন্টেন্ট সেভ করুন ও সঠিক বিভাগে রাখুন।
বার্তা এবং ইভেন্টগুলি পাঠানো এবং গ্রহণ করা একটি এজেন্ট এবং ব্যবহারকারীর মধ্যে যোগাযোগের মূল দিক। এজেন্টরা ব্যবসায়িক বার্তা API এর মাধ্যমে ব্যবহারকারীদের বার্তা, ইভেন্ট এবং অনুরোধ পাঠায় কিন্তু JSON হিসাবে তাদের ওয়েবহুকে ব্যবহারকারীর তৈরি বার্তা এবং ইভেন্টগুলি গ্রহণ করে।
নীচে একটি উদাহরণ কথোপকথন প্রবাহ যা বার্তা, ইভেন্ট এবং অনুরোধগুলি কীভাবে দরকারী এবং অর্থপূর্ণ মিথস্ক্রিয়া তৈরি করতে পারে তা বোঝাতে নমুনা ডেটা ব্যবহার করে।
এই উদাহরণে, ব্যবহারকারী একটি কথোপকথন শুরু করে এবং "হ্যালো, আমি বিশ্ব!" বার্তা পাঠায়, তারপর এজেন্ট "হ্যালো, ওয়ার্ল্ড" দিয়ে প্রতিক্রিয়া জানায়।

- ব্যবহারকারী এজেন্টের সাথে কথোপকথন শুরু করে।
একবার ব্যবহারকারী একটি প্রতিক্রিয়া টাইপ করা শুরু করলে, তারা এজেন্টকে একটি টাইপিং ইভেন্ট পাঠায়।
{
"agent": "brands/1111/agents/2222",
"conversationId": "3333",
"customAgentId": "hello-world-bot",
"requestId": "1234567890",
"userStatus": {
"isTyping": "true",
"createTime": "2020-10-02T15:01:23.045123456Z",
},
"sendTime": "2020-10-02T15:01:24.045123456Z",
}
ব্যবহারকারী পাঠায় "হ্যালো, আমি বিশ্ব!" একটি বার্তা হিসাবে
{
"agent": "brands/1111/agents/2222",
"conversationId": "3333",
"customAgentId": "hello-world-bot",
"requestId": "123123123",
"message": {
"messageId": "4444",
"name": "conversations/12345/messages/67890",
"text": "Hello! I'm World!",
"createTime": "2020-10-02T15:05:23.045123456Z",
},
"context": {
"entryPoint": "PLACESHEET",
"userInfo": {
"displayName": "Michael",
"userDeviceLocale": "en",
},
"resolvedLocale": "en",
}
"sendTime": "2020-10-02T15:05:24.045123456Z",
}
এজেন্ট একটি বার্তা হিসাবে "হ্যালো, ওয়ার্ল্ড" পাঠায়।
curl -X POST "https://businessmessages.googleapis.com/v1/conversations/3333/messages" \
-H "Content-Type: application/json" \
-H "`oauth2l header --json path/to/service/account/key.json businessmessages`" \
-d "{
'messageId': '5555',
'text': 'Hello, World',
'representative': {
'avatarImage': 'https://hello.world/avatar.jpg',
'displayName': 'Hello World Agent',
'representativeType': 'BOT'
}
}"
বার্তা বিতরণের পরে, ব্যবহারকারীর ডিভাইস একটি বিতরণ রসিদ ফেরত দেয়।
{
"agent": "brands/1111/agents/2222",
"conversationId": "3333",
"customAgentId": "hello-world-bot",
"receipts" : {
"receipts": [
{
"message": "conversations/3333/messages/5555",
"receiptType": "DELIVERED",
}
],
"createTime": "2020-10-02T16:01:23.045123456Z",
},
"sendTime": "2020-10-02T16:01:24.045123456Z",
}
অন্য কিছু উল্লেখ না করা থাকলে, এই পৃষ্ঠার কন্টেন্ট Creative Commons Attribution 4.0 License-এর অধীনে এবং কোডের নমুনাগুলি Apache 2.0 License-এর অধীনে লাইসেন্স প্রাপ্ত। আরও জানতে, Google Developers সাইট নীতি দেখুন। Java হল Oracle এবং/অথবা তার অ্যাফিলিয়েট সংস্থার রেজিস্টার্ড ট্রেডমার্ক।
2025-01-08 UTC-তে শেষবার আপডেট করা হয়েছে।
[null,null,["2025-01-08 UTC-তে শেষবার আপডেট করা হয়েছে।"],[[["\u003cp\u003eAgents and users communicate by sending and receiving messages and events through the Business Messages API and webhooks.\u003c/p\u003e\n"],["\u003cp\u003eUser interactions, such as typing and sending messages, are sent to the agent as JSON payloads containing relevant information like user details and message content.\u003c/p\u003e\n"],["\u003cp\u003eAgents can respond to users with messages containing text and optional representative details like display name and avatar.\u003c/p\u003e\n"],["\u003cp\u003eThe platform provides delivery receipts to the agent, confirming the delivery status of messages sent to the user.\u003c/p\u003e\n"]]],[],null,["# Hello, World\n\nSending and receiving messages and events are the core aspects of communication\nbetween an agent and a user. Agents send messages, events, and requests to users\nthrough the Business Messages API but receive user-created messages and events\nat their webhooks as JSON.\n\nBelow is an example conversation flow that uses sample data to illustrate how\nmessages, events, and requests can create useful and meaningful interactions.\n\nIn this example, the user starts a conversation and sends the message \"Hello,\nI'm World!\", then the agent responds with \"Hello, World\".\n\n1. The user begins the conversation with the agent.\n2. Once the user begins typing a response, they send a typing event to the\n agent.\n\n {\n \"agent\": \"brands/1111/agents/2222\",\n \"conversationId\": \"3333\",\n \"customAgentId\": \"hello-world-bot\",\n \"requestId\": \"1234567890\",\n \"userStatus\": {\n \"isTyping\": \"true\",\n \"createTime\": \"2020-10-02T15:01:23.045123456Z\",\n },\n \"sendTime\": \"2020-10-02T15:01:24.045123456Z\",\n }\n\n3. The user sends \"Hello, I'm World!\" as a message.\n\n {\n \"agent\": \"brands/1111/agents/2222\",\n \"conversationId\": \"3333\",\n \"customAgentId\": \"hello-world-bot\",\n \"requestId\": \"123123123\",\n \"message\": {\n \"messageId\": \"4444\",\n \"name\": \"conversations/12345/messages/67890\",\n \"text\": \"Hello! I'm World!\",\n \"createTime\": \"2020-10-02T15:05:23.045123456Z\",\n },\n \"context\": {\n \"entryPoint\": \"PLACESHEET\",\n \"userInfo\": {\n \"displayName\": \"Michael\",\n \"userDeviceLocale\": \"en\",\n },\n \"resolvedLocale\": \"en\",\n }\n \"sendTime\": \"2020-10-02T15:05:24.045123456Z\",\n }\n\n4. The agent sends \"Hello, World\" as a message.\n\n curl -X POST \"https://businessmessages.googleapis.com/v1/conversations/3333/messages\" \\\n -H \"Content-Type: application/json\" \\\n -H \"`oauth2l header --json path/to/service/account/key.json businessmessages`\" \\\n -d \"{\n 'messageId': '5555',\n 'text': 'Hello, World',\n 'representative': {\n 'avatarImage': 'https://hello.world/avatar.jpg',\n 'displayName': 'Hello World Agent',\n 'representativeType': 'BOT'\n }\n }\"\n\n5. Upon message delivery, the user's device returns a delivery receipt.\n\n {\n \"agent\": \"brands/1111/agents/2222\",\n \"conversationId\": \"3333\",\n \"customAgentId\": \"hello-world-bot\",\n \"receipts\" : {\n \"receipts\": [\n {\n \"message\": \"conversations/3333/messages/5555\",\n \"receiptType\": \"DELIVERED\",\n }\n ],\n \"createTime\": \"2020-10-02T16:01:23.045123456Z\",\n },\n \"sendTime\": \"2020-10-02T16:01:24.045123456Z\",\n }"]]