এজেন্টদের পরিচালনা করুন

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

Code snippets on this page are taken from the Java samples and Node.js samples .

এজেন্ট তৈরি এবং সংজ্ঞা

একজন এজেন্ট তৈরি করুন

To create an RBM agent, you need to define its basic information .

আরও বিস্তারিত তথ্যের জন্য brands.agents.create দেখুন।

cURL

curl -v -X POST "https://businesscommunications.googleapis.com/v1/$BRAND_ID/agents" \
  -H "Content-Type: application/json" \
  -H "User-Agent: curl/business-messaging" \
  -H "`oauth2l header --json rbm-developer-service-account-credentials.json businesscommunications`" \
  -d "{
    'displayName': 'My test agent',
    'rcsBusinessMessagingAgent': {
      'description': 'My agent description',
      'logoUri': 'https://agent-logos.storage.googleapis.com/_/kt90w53vzw2QSxK6PG1uCeJf',
      'heroUri': 'https://agent-logos.storage.googleapis.com/_/kt90vzob74GQcfeHoEQbVRTP',
      'phoneNumbers': [
        {
            'phoneNumber': {
                'number': '+44800088088'
            },
            'label': 'My number'
        }
      ],
      'emails': [
        {
            'address': 'support@demo.test',
            'label': 'My email'
        }
      ],
      'websites': [
        {
            'uri': 'https://a.demo.test/',
            'label': 'My site'
        }
      ],
      'privacy': {
        'uri': 'https://a.demo.test/privacy',
        'label': 'My privacy policy'
      },
      'termsConditions': {
        'uri': 'https://a.demo.test/terms',
        'label': 'My terms'
      },
      'color': '#FFFFFF',
      'billingConfig': {
        'billingCategory': 'CONVERSATIONAL'
      },
      'agentUseCase': 'TRANSACTIONAL',
      'hostingRegion': 'EUROPE'
    }
  }"
This code is an excerpt from our RBM Management API sample .

নোড.জেএস

const businessCommunicationsApiHelper =
  require('@google/rbm-businesscommunications');

const privateKey =
  require('../../resources/businesscommunications-service-account-credentials.json');

businessCommunicationsApiHelper.initBusinessCommunucationsApi(privateKey);

const newAgentDetails = {
  displayName: 'My new agent',
  name: brandId + '/agents/',
  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'
      }
    ],
    // It's recommended to provide at least one contact method (phone or email) because
    // this is required for launch. For any phone, email, or website provided, a corresponding label
    // must also be included.
    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: 'TRANSACTIONAL',
    hostingRegion: 'EUROPE'
  }
};

businessCommunicationsApiHelper.createAgent(brandId, newAgentDetails).then((response) => {

}).catch((err) => {
  console.log(err);
});

জাভা

Brand brand = api.getBrand(brandId);
logger.info("Brand to operate on: " + brand);
String displayName = flags.getOrDefault("agent_name", "Test RBM Agent: " + now.getSecond());
String suffix = flags.getOrDefault("agent_data_suffix", "API");
RcsBusinessMessagingAgent agentData = AgentFactory.createRbmAgent(suffix);
Agent agent = api.createRbmAgent(brand, displayName, agentData);
logger.info("RBM agent has been created: " + agent);

This code returns the new agent information and a unique identifier assigned to the agent:

{
  name: 'brands/40bd963f-ff92-425c-b273-8f0892d2d017/agents/my_new_agent_dxuewtvy_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: [ [Object] ],
    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: 'EUROPE'
  }
}

এজেন্টের সংজ্ঞা খুঁজে দেখুন

You can retrieve an agent by specifying its unique identifier ( name ). For more details, see brands.agents.list .

নোড.জেএস

const businessCommunicationsApiHelper =
  require('@google/rbm-businesscommunications');

const privateKey =
  require('../../resources/businesscommunications-service-account-credentials.json');

businessCommunicationsApiHelper.initBusinessCommunucationsApi(privateKey);

// Retrieve details of the first agent (if one has already been created)
businessCommunicationsApiHelper.getAgent(agent.name).then((response) => {

}).catch((err) => {
  console.log(err);
});

জাভা

Agent agent = api.getAgent(flags.get("agent_id"));
logger.info("Agent: " + agent);

এই কোডটি এজেন্টের তথ্য ফেরত দেয়:

{
  name: 'brands/40bd963f-ff92-425c-b273-8f0892d2d017/agents/my_new_agent_dxuewtvy_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: [ [Object] ],
    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: 'EUROPE'
  }
}

যাচাইকরণ এবং চালু

যাচাইকরণ তথ্য জমা দিন

এজেন্ট লঞ্চের জন্য ব্র্যান্ড যাচাইকরণ প্রয়োজন। লঞ্চের অনুরোধ করার আগে আপনাকে অবশ্যই যাচাইকরণ তথ্য জমা দিতে হবে। মনে রাখবেন, লঞ্চের অনুরোধ করার আগে আপনাকে ব্র্যান্ড অনুমোদনের জন্য অপেক্ষা করতে হবে না; লঞ্চ অনুমোদন প্রক্রিয়ার অংশ হিসেবেই ব্র্যান্ড অনুমোদন সম্পন্ন হয়।

For more details, see brands.agents.requestVerification .

নোড.জেএস

const businessCommunicationsApiHelper =
  require('@google/rbm-businesscommunications');

const privateKey =
  require('../../resources/businesscommunications-service-account-credentials.json');

businessCommunicationsApiHelper.initBusinessCommunucationsApi(privateKey);

let agentVerificationContact = {
  partnerName: 'Alice',
  partnerEmailAddress: 'alice@thepartner.com',
  brandContactName: 'Bob',
  brandContactEmailAddress: 'bob@thebrand.com',
  brandWebsiteUrl: 'https://thebrand.com/'
};

businessCommunicationsApiHelper.verifyAgent(agent.name, agentVerificationContact).then((response) => {

}).catch((err) => {
  console.log(err);
});

জাভা

AgentVerificationContact contact = AgentFactory.createRbmAgentVerification();
AgentVerification verification = api.requestAgentVerification(agent.getName(), contact);
logger.info("Verification requested: " + verification);

এই কোডটি যাচাইকরণ তথ্য ফেরত দেয়:

{
  "name": "brands/40bd963f-ff92-425c-b273-8f0892d2d017/agents/my_new_agent_ciymyd2b_agent",
  "verificationState": "VERIFICATION_STATE_UNVERIFIED",
  "agentVerificationContact": {
    "partnerName": "Alice",
    "partnerEmailAddress": "alice@thepartner.com",
    "brandContactName": "Bob",
    "brandContactEmailAddress": "bob@thebrand.com",
    "brandWebsiteUrl": "https://thebrand.com/"
  }
}

একজন এজেন্টের যাচাইকরণ তথ্য খুঁজে দেখুন

You can retrieve the status of an agent's brand verification. For more details, see brands.agents.getVerification .

নোড.জেএস

const businessCommunicationsApiHelper =
  require('@google/rbm-businesscommunications');

const privateKey =
  require('../../resources/businesscommunications-service-account-credentials.json');

businessCommunicationsApiHelper.initBusinessCommunucationsApi(privateKey);

businessCommunicationsApiHelper.getAgentVerification(agent.name).then((response) => {

}).catch((err) => {
  console.log(err);
});

জাভা

AgentVerification verification = api.getAgentVerification(agent.getName());
logger.info("RBM agent verification: " + verification);

This code returns the verification status and partner info:

{
  "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"
  }
}

লঞ্চের জন্য একজন এজেন্ট জমা দিন

আপনি এক বা একাধিক ক্যারিয়ারে লঞ্চ করার জন্য একটি এজেন্ট জমা দিতে পারেন। কিছু লঞ্চ গুগল দ্বারা পরিচালিত হয় এবং অন্যগুলো সরাসরি ক্যারিয়ার দ্বারা পরিচালিত হয়। ক্যারিয়ার-পরিচালিত লঞ্চগুলোর জন্য অতিরিক্ত কিছু শর্ত থাকতে পারে। আরও তথ্যের জন্য ‘গুগল-পরিচালিত বনাম ক্যারিয়ার-পরিচালিত লঞ্চ’ দেখুন।

প্রথমবার কোনো এজেন্ট চালু করার আগে, আপনাকে যাচাইকরণ তথ্য জমা দিতে হবে। এর মাধ্যমে গুগল, ক্যারিয়ার বা উভয়ই আপনার ব্র্যান্ড কন্ট্যাক্টের সাথে যাচাই করে নিতে পারে যে, আপনি তাদের পক্ষ থেকে এজেন্টটি পরিচালনা করার জন্য অনুমোদিত। বিস্তারিত জানতে ব্র্যান্ড ভেরিফিকেশন দেখুন।

Once you've submitted the verification information and completed the launch prerequisites , you can submit a launch request.

You can submit an agent for launch on one or more carriers. The completed launch questionnaire must be provided as part of the launch request. For more details, see brands.agents.requestLaunch .

cURL

curl -v -X POST "https://businesscommunications.googleapis.com/v1/$AGENT_ID:requestLaunch" \
  -H "Content-Type: application/json" \
  -H "User-Agent: curl/business-messaging" \
  -H "`oauth2l header --json rbm-developer-service-account-credentials.json businesscommunications`" \
  -d "{
    'agentLaunch': {
      'rcsBusinessMessaging': {
        'questionnaire': {
          'contacts': [
            {
              'name': 'John Doe',
              'title': 'Product Owner',
              'email': 'support@demo.test'
            }
          ],
          'optinDescription': 'Thanks for your request.',
          'triggerDescription': 'Promotional messages will be triggered in a timely manner.',
          'interactionsDescription': 'Promotional messages are one way.',
          'optoutDescription': 'Sorry to see you go.',
          'agentAccessInstructions': 'Thanks for your request.',
          'videoUris': [
            'https://d2q4iodazzzt8b.cloudfront.net/MicrosoftTeamsvideo2_1758533835.mp4'
          ],
          'screenshotUris': [
            'https://rm.virbm.com/Il9ChvVEhS1na5mr/ee9bc94b468a40688fb7fc71cb1c069c.png'
          ]
        },
        'launchDetails': {
          '/v1/regions/$CARRIER_ID': {}
        }
      }
    }
  }"
This code is an excerpt from our RBM Management API sample .

নোড.জেএস

const businessCommunicationsApiHelper =
  require('@google/rbm-businesscommunications');

const privateKey =
  require('../../resources/businesscommunications-service-account-credentials.json');

businessCommunicationsApiHelper.initBusinessCommunucationsApi(privateKey);
  
let agentLaunch = {
  questionnaire: {
    contacts: [
      {
        name: 'James Bond',
        title: 'Mr 0 0 7',
        email: 'someone@somewhere.com'
      }
    ],
    optinDescription: 'Users accepted our terms of service online.',
    triggerDescription: 'We are reaching preregistered users',
    interactionsDescription: 'This agent does not do much.',
    optoutDescription: 'Reply stop and we stop.',
    agentAccessInstructions: 'This is a a simple agent that reaches registered users.',
    videoUris: [
      'https://www.google.com/a/video'
    ],
    screenshotUris: [
      'https://www.google.com/a/screenshot'
    ]
  },
  launchDetails: {}
};

businessCommunicationsApiHelper.launchAgent(agent.name, agentLaunch).then((response) => {

}).catch((err) => {
  console.log(err);
});

জাভা

Optional<Questionnaire> q = Optional.of(AgentFactory.createRbmQuestionnaire());
AgentLaunch launch = api.requestRbmAgentLaunch(agent.getName(), regionIds, q);
logger.info("RBM agent updated launch: " + launch);

এই কোডটি এজেন্ট চালুর তথ্য ফেরত দেয়:

{
  "name": "brands/40bd963f-ff92-425c-b273-8f0892d2d017/agents/my_new_agent_7jo0trhw_agent/launch",
  "rcsBusinessMessaging": {
    "questionnaire": {
      "contacts": [
        {
          "name": "James Bond",
          "title": "Mr O O 7",
          "email": "someone@somewhere.com"
        }
      ],
      "optinDescription": "Users accepted our terms of service online.",
      "triggerDescription": "We are reaching preregistered users",
      "interactionsDescription": "This agent does not do much.",
      "optoutDescription": "Reply stop and we stop.",
      "agentAccessInstructions": "This is a a simple agent that reaches registered users.",
      "videoUris": [
        "https://www.google.com/a/video"
      ],
      "screenshotUris": [
        "https://www.google.com/a/screenshot"
      ]
    },
    "launchDetails": {
      "/v1/regions/some-carrier": {
        "launchState": "LAUNCH_STATE_PENDING",
        "updateTime": "2023-02-24T15:02:13.903554Z"
      }
    },
    "launchRegion": "NORTH_AMERICA"
  }
}

Note that launchRegion is deprecated and is scheduled to be removed soon.

এক বা একাধিক অঞ্চলে একজন এজেন্ট চালু করুন

এক বা একাধিক অঞ্চলে কোনো এজেন্ট চালু করতে, যদি এজেন্টটি আগে চালু না হয়ে থাকে , তাহলে requestLaunch মেথডটি এমন একটি অবজেক্ট দিয়ে কল করুন যাতে শুধুমাত্র সেই সমস্ত অঞ্চলের কী (key) সহ একটি ম্যাপ থাকবে যেখানে আপনি এজেন্টটি চালু করতে চান। একটি খালি ম্যাপ ব্যবহার করলে বিভিন্ন এপিআই কলের মধ্যে ব্যবহৃত অবজেক্টগুলিতে অভ্যন্তরীণ এপিআই সামঞ্জস্য বজায় রাখা সম্ভব হয়।

curl -X POST \
"https://businesscommunications.googleapis.com/v1/brands/BRAND_ID/agents/AGENT_ID:requestLaunch" \
-H "Content-Type: application/json" \
-H "$(oauth2l header --json PATH_TO_SERVICE_ACCOUNT_KEY businesscommunications)" \
-d "{
  'name': 'brands/BRAND_ID/agents/AGENT_ID/launch',
  'rcsBusinessMessaging': {
    'questionnaire': {
      'contacts': [
        {
          'name': 'Contact person 000',
          'title': 'Contact manager 000',
          'email': 'user@domain.com000'
        }
      ],
      'optinDescription': 'Opt-in description 0',
      'triggerDescription': 'Trigger description 0',
      'optoutDescription': 'Opt-out description 0',
      'agentAccessInstructions': 'Agent instructions 0',
      'videoUris': [
        'https://www.youtube.com/watch?v=NN75im_us4k'
      ],
      'screenshotUris': [
        'https://www.youtube.com/watch?v=NN75im_us4k'
      ]
    },
    'launchDetails': {
      '/v1/regions/fi-rcs': {}
    }
  }
}"

এক বা একাধিক অঞ্চলে কোনো এজেন্ট চালু করতে (যদি এজেন্টটি আগে চালু করা হয়ে থাকে ), `requestLaunch` মেথডটি এমন একটি অবজেক্টসহ কল ​​করুন, যেটিতে শুধুমাত্র সেইসব অঞ্চলের কী-গুলোসহ একটি ম্যাপ থাকবে যেখানে এজেন্টটি ইতিমধ্যে চালু আছে এবং সেইসব অঞ্চলের কী-গুলো থাকবে যেখানে এজেন্টটি চালু হতে চায়। একটি খালি ম্যাপ ব্যবহার করলে বিভিন্ন এপিআই কলের মধ্যে ব্যবহৃত অবজেক্টগুলোতে অভ্যন্তরীণ এপিআই সামঞ্জস্য বজায় রাখা সম্ভব হয়।

curl -X POST \
"https://businesscommunications.googleapis.com/v1/brands/BRAND_ID/agents/AGENT_ID:requestLaunch" \
-H "Content-Type: application/json" \
-H "$(oauth2l header --json PATH_TO_SERVICE_ACCOUNT_KEY businesscommunications)" \
-d "{
  'name': 'brands/BRAND_ID/agents/AGENT_ID/launch',
  'rcsBusinessMessaging': {
    'launchDetails': {
      '/v1/regions/fi-rcs': {},
      '/v1/regions/vodafone-idea-india': {}
    }
  }
}"

If an agent calls the requestLaunch method but doesn't include all regions where the agent is already launched as keys, a 400 - Bad Request error is thrown.

একজন এজেন্টের লঞ্চ স্ট্যাটাস দেখুন

আপনি একজন এজেন্টের বর্তমান লঞ্চ স্ট্যাটাস জানতে পারবেন। আরও বিস্তারিত জানতে brands.agents.getLaunch দেখুন।

নোড.জেএস

const businessCommunicationsApiHelper =
  require('@google/rbm-businesscommunications');

const privateKey =
  require('../../resources/businesscommunications-service-account-credentials.json');

businessCommunicationsApiHelper.initBusinessCommunucationsApi(privateKey);

businessCommunicationsApiHelper.getAgentLaunch(agent.name).then((response) => {

}).catch((err) => {
  console.log(err);
});

জাভা

AgentLaunch launch = api.getAgentLaunch(agent.getName());
logger.info("RBM agent launch: " + launch);

If a launch is rejected by the carrier, a partner can request launch on the carrier again (request has an UNSPECIFIED state and backend has a REJECTED state).

This code returns the launch information and the launch status for each target carrier:

{
  "name": "brands/40bd963f-ff92-425c-b273-8f0892d2d017/agents/my_new_agent_7jo0trhw_agent/launch",
  "rcsBusinessMessaging": {
    "questionnaire": {
      "contacts": [
        {
          "name": "James Bond",
          "title": "Mr O O 7",
          "email": "someone@somewhere.com"
        }
      ],
      "optinDescription": "Users accepted our terms of service online.",
      "triggerDescription": "We are reaching preregistered users",
      "interactionsDescription": "This agent does not do much.",
      "optoutDescription": "Reply stop and we stop.",
      "agentAccessInstructions": "This is a a simple agent that reaches registered users.",
      "videoUris": [
        "https://www.google.com/a/video"
      ],
      "screenshotUris": [
        "https://www.google.com/a/screenshot"
      ]
    },
    "launchDetails": {
      "/v1/regions/some-carrier": {
        "launchState": "LAUNCH_STATE_PENDING",
        "updateTime": "2023-02-24T15:02:13.903554Z"
      }
    },
    "launchRegion": "NORTH_AMERICA"
  }
}

Note that launchRegion is deprecated and is scheduled be removed soon.

একজন এজেন্টের লঞ্চে অতিরিক্ত ক্যারিয়ার যোগ করুন

brands.agents.getLaunch API কলটি ব্যবহার করে আপনার এজেন্টের বর্তমান লঞ্চের তথ্য পাওয়ার পর, আপনি আপনার এজেন্টের নাগাল প্রসারিত করতে আরও টার্গেট ক্যারিয়ার যোগ করতে পারেন। আরও বিস্তারিত জানতে, brands.agents.updateLaunch দেখুন।

নোড.জেএস

const businessCommunicationsApiHelper =
  require('@google/rbm-businesscommunications');

const privateKey =
  require('../../resources/businesscommunications-service-account-credentials.json');

businessCommunicationsApiHelper.initBusinessCommunucationsApi(privateKey);');

// To launch an agent to further carriers, we need to first obtain the existing
// launch information and extend it with the new carrier(s).
businessCommunicationsApiHelper.getAgentLaunch(agent.name).then((response) => {
  let existingLaunch = response.data.rcsBusinessMessaging;

  // Now we add the new carrier to the existing launch
  existingLaunch.launchDetails[config.launchCarrier2] = null;

  // And we submit the launch again
  businessCommunicationsApiHelper.launchAgent(agent.name, existingLaunch).then((response) => {
    console.log('Launch details are:');
    console.log(JSON.stringify(response.data, null, 2));
  }).catch((err) => {
    console.log(err);
  });
}).catch((err) => {
  console.log(err);
});

This code returns the updated launch information:

{
  "name": "brands/40bd963f-ff92-425c-b273-8f0892d2d017/agents/my_new_agent_7jo0trhw_agent/launch",
  "rcsBusinessMessaging": {
    "questionnaire": {
      "contacts": [
        {
          "name": "James Bond",
          "title": "Mr O O 7",
          "email": "someone@somewhere.com"
        }
      ],
      "optinDescription": "Users accepted our terms of service online.",
      "triggerDescription": "We are reaching preregistered users",
      "interactionsDescription": "This agent does not do much.",
      "optoutDescription": "Reply stop and we stop.",
      "agentAccessInstructions": "This is a a simple agent that reaches registered users.",
      "videoUris": [
        "https://www.google.com/a/video"
      ],
      "screenshotUris": [
        "https://www.google.com/a/screenshot"
      ]
    },
    "launchDetails": {
      "/v1/regions/some-carrier": {
        "launchState": "LAUNCH_STATE_PENDING",
        "updateTime": "2023-02-24T15:02:13.903554Z"
      },
      "/v1/regions/another-carrier": {
        "launchState": "LAUNCH_STATE_PENDING",
        "updateTime": "2023-02-24T15:04:50.456552Z"
      }
    },
    "launchRegion": "NORTH_AMERICA"
  }
}

উৎক্ষেপণ পরবর্তী এবং রক্ষণাবেক্ষণ

একটি ব্র্যান্ডের জন্য তৈরি করা সমস্ত এজেন্টের তালিকা

The developer can retrieve a list of all agents they have created for a brand. For more details, see brands.agents.list .

নোড.জেএস

const businessCommunicationsApiHelper =
  require('@google/rbm-businesscommunications');

const privateKey =
  require('../../resources/businesscommunications-service-account-credentials.json');

businessCommunicationsApiHelper.initBusinessCommunucationsApi(privateKey);

businessCommunicationsApiHelper.listAgents(brand.name).then((response) => {
  console.log('Current agents are:');
  console.log(response.data);
  datastore.saveJsonData('agents', response.data.agents);
}).catch((err) => {
  console.log(err);
});

জাভা

Brand brand = api.getBrand(brandId);
logger.info("Brand: " + brand);
ListAgentsResponse response = api.listAllAgents(brand);
List<Agent> agents = response.getAgents().stream()
  .sorted(Comparator.comparing(Agent::getName)).collect(Collectors.toList());
logger.info(String.format("Found %d agents", response.getAgents().size()));
for (Agent agent : agents) {
  logger.info(String.format("Agent [%s]: '%s'", agent.getName(), agent.getDisplayName()));
}

This code returns a list of all the agents owned by the brand:

{
  agents: [
    {
      name: 'brands/40bd963f-ff92-425c-b273-8f0892d2d017/agents/my_new_agent_4fpd1psz_agent',
      displayName: 'My new agent',
      rcsBusinessMessagingAgent: [Object]
    },
    {
      name: 'brands/40bd963f-ff92-425c-b273-8f0892d2d017/agents/my_new_agent_ciymyd2b_agent',
      displayName: 'My second agent',
      rcsBusinessMessagingAgent: [Object]
    },
    {
      name: 'brands/40bd963f-ff92-425c-b273-8f0892d2d017/agents/my_new_agent_helof85o_agent',
      displayName: 'My third agent',
      rcsBusinessMessagingAgent: [Object]
    }
  ]
}

আর্কাইভ করা এজেন্টদের অন্তর্ভুক্ত করুন

By default, the list of all agents excludes agents that have been archived by the partner. To include archived agents in the results, set the includeArchived parameter to true .

নোড.জেএস

The `listAgents` method accepts an optional configuration object to include archived agents.
const businessCommunicationsApiHelper =
 require('@google/rbm-businesscommunications');

const privateKey =
 require('../../resources/businesscommunications-service-account-credentials.json');

businessCommunicationsApiHelper.initBusinessCommunicationsApi(privateKey);

// To list all agents including archived ones, set includeArchived to true
const listOptions = {
  includeArchived: true
};

businessCommunicationsApiHelper.listAgents(brand.name, listOptions).then((response) => {
 console.log('Current agents (including archived) are:');
 console.log(response.data);
 datastore.saveJsonData('agents', response.data.agents);
}).catch((err) => {
 console.log(err);
});

জাভা

The `listAllAgents` method includes a boolean parameter for visibility control.
// To list all agents including archived ones, pass 'true' for the includeArchived parameter
boolean includeArchived = true;
Brand brand = api.getBrand(brandId);
logger.info("Brand: " + brand);

// Call listAllAgents with the brand and the includeArchived flag
ListAgentsResponse response = api.listAllAgents(brand, includeArchived);

List agents = response.getAgents().stream()
 .sorted(Comparator.comparing(Agent::getName)).collect(Collectors.toList());

logger.info(String.format("Found %d agents (including archived)", response.getAgents().size()));
for (Agent agent : agents) {
 logger.info(String.format("Agent [%s]: '%s' (Archived: %s)",
    agent.getName(), agent.getDisplayName(), agent.getIsArchived()));
}

একজন এজেন্টকে আনলঞ্চ করুন

To unlaunch an agent from a specific region, call the updateLaunch method, specify the target region in the call's map, and set launchState to LAUNCH_STATE_UNLAUNCHED .

curl -X PATCH \
"https://businesscommunications.googleapis.com/v1/brands/BRAND_ID/agents/AGENT_ID" \
-H "Content-Type: application/json" \
-H "$(oauth2l header --json PATH_TO_SERVICE_ACCOUNT_KEY businesscommunications)"\
-d "{
  'rcsBusinessMessaging': {
    'launchDetails': {
      '/v1/regions/fi-rcs': {
        'launchState': 'LAUNCH_STATE_UNLAUNCHED'
      },
      '/v1/regions/vodafone-idea-india': {
        'launchState': 'LAUNCH_STATE_UNLAUNCHED'
      }
    }
  }
}"

একজন এজেন্টকে মুছে ফেলুন

For security reasons, RBM agents can no longer be deleted. For assistance, contact the RCS for Business support team .

আর্কাইভ বা আনআর্কাইভ এজেন্ট

To maintain a clean and organized workspace, you can archive agents that are no longer in use. Archiving an agent hides it from default API discovery results.

আর্কাইভ করা শুধুমাত্র দৃশ্যমানতার একটি পরিবর্তন। এটি এজেন্টকে মুছে ফেলে না বা এর অন্তর্নিহিত লঞ্চ অবস্থাকে প্রভাবিত করে না। আপনি যেকোনো সময় একটি এজেন্টকে আনআর্কাইভ করে তার দৃশ্যমানতা পুনরুদ্ধার করতে এবং ব্যবস্থাপনা চালিয়ে যেতে পারেন।

To make sure that active agents are not accidentally hidden, the following rules apply:

  • Eligibility : You can only archive agents that are in an inactive state: UNLAUNCHED , SUSPENDED , or REJECTED .
  • Restrictions : You can't archive an agent that is LAUNCHED or PENDING on any carrier. If you attempt to archive such an agent, the request will be rejected with an error.

আর্কাইভের অবস্থা আপডেট করুন

কোনো এজেন্টকে আর্কাইভ বা আনআর্কাইভ করতে patch মেথডটি ব্যবহার করুন। যে ফিল্ডটি আপডেট করা হচ্ছে তা নির্দিষ্ট করার জন্য আপনাকে অবশ্যই URL-এ updateMask=is_archived প্যারামিটারটি অন্তর্ভুক্ত করতে হবে। আর্কাইভ করার জন্য isArchived বুলিয়ানটিকে true এবং আনআর্কাইভ করার জন্য এটিকে false সেট করুন।

পদ্ধতি : PATCH /v1/brands/{brandId}/agents/{agentId} আপডেট মাস্কে is_archived যোগ করুন।

{
  "isArchived": true
}

ফিল্টার সহ এজেন্টদের তালিকা

ডিফল্টরূপে, list মেথডটি আর্কাইভ করা এজেন্টদের লুকিয়ে রাখে। আপনার ফলাফলে সেগুলোকে অন্তর্ভুক্ত করতে, include_archived প্যারামিটারটি ব্যবহার করুন।

পদ্ধতি : GET /v1/brands/{brandId}/agents?include_archived=true