ক্যারিয়ারদের জন্য মূল RBM কর্মপ্রবাহের মধ্যে রয়েছে নতুন এজেন্টদের তথ্য পর্যালোচনা করা এবং তাদের ক্যারিয়ারের নেটওয়ার্কে লঞ্চ করার এবং তাদের গ্রাহকদের বার্তা পাঠানোর অনুমতি অনুমোদন বা অস্বীকার করা।
এই পৃষ্ঠার কোড স্নিপেটগুলি আমাদের জাভাস্ক্রিপ্ট এবং কার্ল নমুনা থেকে নেওয়া হয়েছে।
ক্যারিয়ারের কাছে জমা দেওয়া সমস্ত এজেন্টের তালিকা তৈরি করুন।
ক্যারিয়ারটি ডেভেলপারদের দ্বারা ক্যারিয়ারের নেটওয়ার্কে লঞ্চের জন্য জমা দেওয়া সমস্ত এজেন্টের একটি তালিকা পেতে পারে।
নোড.জেএস
const businessCommunicationsApiHelper = require('@google/rbm-businesscommunications'); const privateKey = require('../../resources/businesscommunications-service-account-credentials.json'); businessCommunicationsApiHelper.initBusinessCommunucationsApi(privateKey); // Retrieve all agents targeting the carrier businessCommunicationsApiHelper.listAgents('brands/-').then((response) => { console.log('Current agents are:'); console.log(JSON.stringify(response.data, null, 2)); }).catch((err) => { console.log(err); });
সিআরএল
curl -v "https://businesscommunications.googleapis.com/v1/brands/-/agents" \ -H "Content-Type: application/json" \ -H "User-Agent: curl/business-messaging" \ -H "`oauth2l header --json serviceAccount.json businesscommunications`"
ব্র্যান্ডটি - তে সেট করা আছে কারণ সমস্ত এজেন্টের তালিকা পুনরুদ্ধার করার সময় এটির প্রয়োজন হয় না।
এই কোডটি ক্যারিয়ারে লঞ্চের জন্য জমা দেওয়া সমস্ত এজেন্টের একটি তালিকা প্রদান করে:
{
"agents": [
{
"name": "brands/40bd963f-ff92-425c-b273-8f0892d2d017/agents/my_new_agent_4fpd1psz_agent",
"displayName": "My new agent",
"rcsBusinessMessagingAgent": {
"description": "This is the agent description that will be displayed in the Agent info tab in Messages",
"logoUri": "https://agent-logos.storage.googleapis.com/_/kt90w53vzw2QSxK6PG1uCeJf",
"heroUri": "https://agent-logos.storage.googleapis.com/_/kt90vzob74GQcfeHoEQbVRTP",
"phoneNumbers": [
{
"phoneNumber": {
"number": "+12223334444"
},
"label": "Call support"
}
],
"privacy": {
"uri": "https://policies.google.com/privacy",
"label": "Our privacy policy"
},
"termsConditions": {
"uri": "https://policies.google.com/terms",
"label": "Our Terms and Conditions"
},
"color": "#0B78D0",
"billingConfig": {
"billingCategory": "NON_CONVERSATIONAL"
},
"agentUseCase": "MULTI_USE",
"hostingRegion": "NORTH_AMERICA"
}
},
{
"name": "brands/40bd963f-ff92-425c-b273-8f0892d2d017/agents/my_new_agent_7jo0trhw_agent",
"displayName": "My second agent",
"rcsBusinessMessagingAgent": {
"description": "Another agent description",
"logoUri": "https://agent-logos.storage.googleapis.com/_/kt90w53vzw2QSxK6PG1uCeJf",
"heroUri": "https://agent-logos.storage.googleapis.com/_/kt90vzob74GQcfeHoEQbVRTP",
"phoneNumbers": [
{
"phoneNumber": {
"number": "+12228885768"
},
"label": "Call support"
}
],
"privacy": {
"uri": "https://policies.google.com/privacy",
"label": "Our privacy policy"
},
"termsConditions": {
"uri": "https://policies.google.com/terms",
"label": "Our Terms and Conditions"
},
"color": "#0B78D0",
"billingConfig": {
"billingCategory": "CONVERSATIONAL"
},
"agentUseCase": "PROMOTIONAL",
"hostingRegion": "NORTH_AMERICA"
}
}
]
}
ফলাফল একবারে এক পৃষ্ঠা থেকে উদ্ধার করা যেতে পারে। বিস্তারিত জানার জন্য API রেফারেন্স দেখুন।
এজেন্ট যাচাইকরণের তথ্য পান
ক্যারিয়ার এজেন্টের ব্র্যান্ড যাচাইয়ের স্থিতি পেতে পারে। আরও বিস্তারিত জানার জন্য, brands.agents.getVerification দেখুন।
নোড.জেএস
const businessCommunicationsApiHelper = require('@google/rbm-businesscommunications'); const privateKey = require('../../resources/businesscommunications-service-account-credentials.json'); businessCommunicationsApiHelper.initBusinessCommunucationsApi(privateKey); businessCommunicationsApiHelper.getAgentVerification(agents[0].name).then((response) => { }).catch((err) => { console.log(err); });
সিআরএল
curl -v "https://businesscommunications.googleapis.com/v1/brands/-/agents/AGENT ID/verification" \ -H "Content-Type: application/json" \ -H "User-Agent: curl/business-messaging" \ -H "`oauth2l header --json serviceAccount.json businesscommunications`"
কলকারীর ব্র্যান্ড নাম সহ সম্পূর্ণ এজেন্টের নাম প্রয়োজন হয় না। শুধুমাত্র এজেন্ট আইডি ( @rbm.goog এর আগে) প্রয়োজন, ব্র্যান্ড নামটি - এ সেট করে।
এই কোডটি যাচাইকরণের স্থিতি এবং অংশীদারের তথ্য প্রদান করে:
{
"name": "brands/40bd963f-ff92-425c-b273-8f0892d2d017/agents/my_new_agent_ciymyd2b_agent/verification",
"verificationState": "VERIFICATION_STATE_UNVERIFIED",
"agentVerificationContact": {
"partnerName": "John Doe",
"partnerEmailAddress": "john.doe@gmail.com",
"brandContactName": "Bob",
"brandContactEmailAddress": "bob@brand.com",
"brandWebsiteUrl": "https://www.brand.com"
}
}
এজেন্ট লঞ্চ স্ট্যাটাস এবং প্রশ্নাবলী পান
ক্যারিয়ারটি একজন এজেন্টের বর্তমান লঞ্চ স্ট্যাটাস এবং ডেভেলপার লঞ্চ প্রশ্নাবলী পেতে পারে।
নোড.জেএস
const businessCommunicationsApiHelper = require('@google/rbm-businesscommunications'); const privateKey = require('../../resources/businesscommunications-service-account-credentials.json'); businessCommunicationsApiHelper.initBusinessCommunucationsApi(privateKey); businessCommunicationsApiHelper.getAgentLaunch(agents[0].name).then((response) => { console.log('Launch details are:'); console.log(JSON.stringify(response.data, null, 2)); }).catch((err) => { console.log(err); });
সিআরএল
curl -v "https://businesscommunications.googleapis.com/v1/brands/-/agents/AGENT ID/launch" \ -H "Content-Type: application/json" \ -H "User-Agent: curl/business-messaging" \ -H "`oauth2l header --json serviceAccount.json businesscommunications`"
কলকারীর ব্র্যান্ড নাম সহ সম্পূর্ণ এজেন্টের নাম প্রয়োজন হয় না। শুধুমাত্র এজেন্ট আইডি ( @rbm.goog এর আগে) প্রয়োজন, ব্র্যান্ড নামটি - এ সেট করে।
এই কোডটি লঞ্চের তথ্য প্রদান করে:
{
"name": "brands/8b5c7f80-b025-486b-bc8a-2d0797559711/agents/my-agent-demo/launch",
"rcsBusinessMessaging": {
"questionnaire": {
"contacts": [
{
"name": "John Doe",
"title": "Mr",
"email": "johndoe@developer.com"
}
],
"optinDescription": "Messages are sent to known MSISDNs",
"triggerDescription": "We respond to any interaction",
"interactionsDescription": "Simple conversations with a chatbot",
"optoutDescription": "User sends stop"
},
"launchDetails": {
"/v1/regions/thecarrier": {
"launchState": "LAUNCH_STATE_LAUNCHED",
"updateTime": "2023-02-20T15:10:36.528669Z"
}
}
}
}
এজেন্টের সংজ্ঞা দেখুন।
ক্যারিয়ার তার অনন্য শনাক্তকারী ( name ) ব্যবহার করে এজেন্টের তথ্য পুনরুদ্ধার করতে পারে।
নোড.জেএস
const businessCommunicationsApiHelper = require('@google/rbm-businesscommunications'); const privateKey = require('../../resources/businesscommunications-service-account-credentials.json'); businessCommunicationsApiHelper.initBusinessCommunucationsApi(privateKey); businessCommunicationsApiHelper.getAgent(agent[0].name).then((response) => { console.log('Agent details are:'); console.log(JSON.stringify(response.data, null, 2)); }).catch((err) => { console.log(err); });
সিআরএল
curl -v "https://businesscommunications.googleapis.com/v1/brands/-/agents/AGENT ID" \ -H "Content-Type: application/json" \ -H "User-Agent: curl/business-messaging" \ -H "`oauth2l header --json serviceAccount.json businesscommunications`"
কলকারীর ব্র্যান্ড নাম সহ সম্পূর্ণ এজেন্টের নাম প্রয়োজন হয় না। শুধুমাত্র এজেন্ট আইডি ( @rbm.goog এর আগে) প্রয়োজন, ব্র্যান্ড নামটি - এ সেট করে।
এই কোডটি এজেন্টের তথ্য ফেরত দেয়:
{
"name": "brands/40bd963f-ff92-425c-b273-8f0892d2d017/agents/my_new_agent_4fpd1psz_agent",
"displayName": "My new agent",
"rcsBusinessMessagingAgent": {
"description": "This is the agent description that will be displayed in the Agent info tab in Messages",
"logoUri": "https://agent-logos.storage.googleapis.com/_/kt90w53vzw2QSxK6PG1uCeJf",
"heroUri": "https://agent-logos.storage.googleapis.com/_/kt90vzob74GQcfeHoEQbVRTP",
"phoneNumbers": [
{
"phoneNumber": {
"number": "+12223334444"
},
"label": "Call support"
}
],
"privacy": {
"uri": "https://policies.google.com/privacy",
"label": "Our privacy policy"
},
"termsConditions": {
"uri": "https://policies.google.com/terms",
"label": "Our Terms and Conditions"
},
"color": "#0B78D0",
"billingConfig": {
"billingCategory": "NON_CONVERSATIONAL"
},
"agentUseCase": "MULTI_USE",
"hostingRegion": "NORTH_AMERICA"
}
}
এজেন্ট লঞ্চের অবস্থা পরিবর্তন করুন
একজন ক্যারিয়ার একজন এজেন্টের লঞ্চ স্ট্যাটাস আপডেট করতে পারে এবং স্ট্যাটাস পরিবর্তনের কারণ ব্যাখ্যা করে একটি মন্তব্য অন্তর্ভুক্ত করতে পারে।
অবস্থাটি নিম্নরূপ পরিবর্তন করা উচিত:
-
LAUNCH_STATE_PENDINGথেকেLAUNCH_STATE_LAUNCHEDঅথবাLAUNCH_STATE_REJECTED -
LAUNCH_STATE_LAUNCHEDথেকেLAUNCH_STATE_SUSPENDED -
LAUNCH_STATE_SUSPENDEDথেকেLAUNCH_STATE_LAUNCHEDঅথবাLAUNCH_STATE_REJECTED
কলকারীর ব্র্যান্ড নাম সহ সম্পূর্ণ এজেন্টের নাম প্রয়োজন হয় না। শুধুমাত্র এজেন্ট আইডি ( @rbm.goog এর আগে) প্রয়োজন, ব্র্যান্ড নামটি - এ সেট করে।
নোড.জেএস
const businessCommunicationsApiHelper = require('@google/rbm-businesscommunications'); const privateKey = require('../../resources/businesscommunications-service-account-credentials.json'); businessCommunicationsApiHelper.initBusinessCommunucationsApi(privateKey); businessCommunicationsApiHelper .updateAgentLaunchState(agentId, 'LAUNCH_STATE_LAUNCHED').then((response) => { console.log('Updated launch details are:'); console.log(JSON.stringify(response.data, null, 2)); });
সিআরএল
curl -v -X PATCH "https://businesscommunications.googleapis.com/v1/brands/-/agents/AGENT ID/launch" \ -H "Content-Type: application/json" \ -H "User-Agent: curl/business-messaging" \ -H "`oauth2l header --json serviceAccount.json businesscommunications`" \ -d "{ 'rcsBusinessMessaging': { 'launchDetails': { '': { 'launchState': 'LAUNCH_STATE_LAUNCHED', } } } }"
এই কোডটি লঞ্চের অবস্থা পরিবর্তনের সাথে আপডেট হওয়া লঞ্চ তথ্য ফেরত দেয়:
{
"name": "brands/40bd963f-ff92-425c-b273-8f0892d2d017/agents/my_new_agent_4fpd1psz_agent/launch",
"rcsBusinessMessaging": {
"questionnaire": {
"contacts": [
{
"name": "John Doe",
"title": "Contact manager",
"email": "john.doe@gmail.com"
}
],
"optinDescription": "Users accepted our terms of service online.",
"triggerDescription": "We are reaching pre-registered users",
"interactionsDescription": "This agent sends notifications and processes suggested replies.",
"optoutDescription": "Reply stop and we stop.",
"agentAccessInstructions": "This is a simple agent that reaches registered users.",
"videoUris": [
"https://www.google.com/a/video"
],
"screenshotUris": [
"https://www.google.com/a/screenshot"
]
},
"launchDetails": {
"/v1/regions/thecarrier": {
"launchState": "LAUNCH_STATE_REJECTED",
"comment": "We don't have a billing contract in place with you.", // Note: The field is optional only for launch approval; otherwise, required.
"updateTime": "2023-04-28T15:22:10.221191Z"
}
}
}
}
একজন এজেন্ট মুছে ফেলুন
নিরাপত্তার কারণে, RBM এজেন্টদের আর মুছে ফেলা যাবে না। সহায়তার জন্য RBM সহায়তার সাথে যোগাযোগ করুন।