ঘটনা পাঠান

আপনার এজেন্ট মানুষের মিথস্ক্রিয়া অনুকরণ করার জন্য ব্যবহারকারীর ডিভাইসে স্ট্যাটাস ইভেন্ট পাঠায়। ব্যবহারকারীদের জন্য, এই ইভেন্টগুলি পঠিত রসিদ বা টাইপিং সূচক হিসাবে প্রদর্শিত হয়, তাদের আশ্বস্ত করে যে তাদের বার্তাগুলি প্রক্রিয়া করা হচ্ছে।

সম্পূর্ণ বিন্যাস এবং মান বিকল্পগুলির জন্য, phones.agentEvents রেফারেন্স দেখুন।

আপনার এজেন্ট RBM প্ল্যাটফর্ম থেকে যে ওয়েবহুক ইভেন্টগুলি গ্রহণ করে তার বিশদ বিবরণের জন্য, ইভেন্টগুলি গ্রহণ করুন দেখুন।

এজেন্ট একটি READ ইভেন্ট পাঠায়।

ব্যবহারকারীদের কাছে, এই ইভেন্টটি একটি নির্দিষ্ট বার্তার পঠিত রসিদ হিসেবে প্রদর্শিত হয়। এটি ব্যবহারকারীকে জানায় যে RBM প্ল্যাটফর্ম তাদের বার্তাটি পৌঁছে দিয়েছে এবং এজেন্ট এটি প্রক্রিয়া করছে।

নিম্নলিখিত কোডটি একটি মেসেজের জন্য একটি READ ইভেন্ট পাঠায় যার সাথে একটি মিল রয়েছে messageId

সিআরএল

curl -X POST "https://REGION-rcsbusinessmessaging.googleapis.com/v1/phones/PHONE_NUMBER/agentEvents?eventId=EVENT_ID&agentId=AGENT_ID" \
-H "Content-Type: application/json" \
-H "User-Agent: curl/rcs-business-messaging" \
-H "`oauth2l header --json PATH_TO_SERVICE_ACCOUNT_KEY rcsbusinessmessaging`" \
-d "{
  'eventType': 'READ',
  'messageId': 'MESSAGE_ID'
}"

নোড.জেএস

// Reference to RBM API helper
const rbmApiHelper = require('@google/rcsbusinessmessaging');

// Send the device an event to indicate that messageId has been read
rbmApiHelper.sendReadMessage('+12223334444', messageId);
এই কোডটি একটি RBM নমুনা এজেন্ট থেকে নেওয়া একটি উদ্ধৃতি।

জাভা

import com.google.rbm.RbmApiHelper;


// Create an instance of the RBM API helper
RbmApiHelper rbmApiHelper = new RbmApiHelper();

// Send the device an event to indicate that messageId has been read
rbmApiHelper.sendReadMessage(messageId, "+12223334444");
এই কোডটি একটি RBM নমুনা এজেন্ট থেকে নেওয়া একটি উদ্ধৃতি।

পাইথন

# Reference to RBM Python client helper and messaging object structure
from rcs_business_messaging import rbm_service

# Send the device an event to indicate that message_id was read
rbm_service.send_read_event('+12223334444', message_id)
এই কোডটি একটি RBM নমুনা এজেন্ট থেকে নেওয়া একটি উদ্ধৃতি।

সি#

using RCSBusinessMessaging;


// Create an instance of the RBM API helper
RbmApiHelper rbmApiHelper = new RbmApiHelper(credentialsFileLocation,
                                                 projectId);

// Send the device an event to indicate that messageId has been read
rbmApiHelper.SendReadMessage(messageId, "+12223334444");
এই কোডটি একটি RBM নমুনা এজেন্ট থেকে নেওয়া একটি উদ্ধৃতি।

এজেন্ট একটি IS_TYPING ইভেন্ট পাঠায়

ব্যবহারকারীদের কাছে, এই ইভেন্টটি একটি টাইপিং ইন্ডিকেটর হিসেবে প্রদর্শিত হবে এবং তাদের জানাবে যে আপনার এজেন্ট একটি বার্তা রচনা করছে। টাইপিং ইন্ডিকেটরটি অল্প সময়ের (প্রায় ২০ সেকেন্ড) পরে অথবা ব্যবহারকারীর ডিভাইস আপনার এজেন্টের কাছ থেকে একটি নতুন বার্তা পেলে মেয়াদ শেষ হয়ে যায়। টাইপিং ইন্ডিকেটরের মেয়াদ শেষ হওয়ার টাইমার রিসেট করতে আপনার এজেন্ট একাধিক IS_TYPING ইভেন্ট পাঠাতে পারে।

নিম্নলিখিত কোডটি একটি IS_TYPING ইভেন্ট পাঠায়।

সিআরএল

curl -X POST "https://REGION-rcsbusinessmessaging.googleapis.com/v1/phones/PHONE_NUMBER/agentEvents?eventId=EVENT_ID&agentId=AGENT_ID" \
-H "Content-Type: application/json" \
-H "User-Agent: curl/rcs-business-messaging" \
-H "`oauth2l header --json PATH_TO_SERVICE_ACCOUNT_KEY rcsbusinessmessaging`" \
-d "{
  'eventType': 'IS_TYPING',
}"

নোড.জেএস

// Reference to RBM API helper
const rbmApiHelper = require('@google/rcsbusinessmessaging');

// Send the device an event to indicate that the agent is typing
rbmApiHelper.sendIsTypingMessage('+12223334444', function() {
    console.log('Typing event sent!');
});
এই কোডটি একটি RBM নমুনা এজেন্ট থেকে নেওয়া একটি উদ্ধৃতি।

জাভা

import com.google.rbm.RbmApiHelper;


// Create an instance of the RBM API helper
RbmApiHelper rbmApiHelper = new RbmApiHelper();

// Send the device an event to indicate that the agent is typing
rbmApiHelper.sendIsTypingMessage("+12223334444");
এই কোডটি একটি RBM নমুনা এজেন্ট থেকে নেওয়া একটি উদ্ধৃতি।

পাইথন

# Reference to RBM Python client helper and messaging object structure
from rcs_business_messaging import rbm_service

# Send the device an event to indicate that the agent is typing
rbm_service.send_is_typing_event('+12223334444')
এই কোডটি একটি RBM নমুনা এজেন্ট থেকে নেওয়া একটি উদ্ধৃতি।

সি#

using RCSBusinessMessaging;


// Create an instance of the RBM API helper
RbmApiHelper rbmApiHelper = new RbmApiHelper(credentialsFileLocation,
                                                 projectId);

// Send the device an event to indicate that the agent is typing
rbmApiHelper.SendIsTypingMessage(messageId, "+12223334444");
এই কোডটি একটি RBM নমুনা এজেন্ট থেকে নেওয়া একটি উদ্ধৃতি।