আপনার পরিচালিত কোনো ব্র্যান্ডের জন্য একজন বিজনেস মেসেজেস এজেন্ট তৈরি করে তার তথ্য চূড়ান্ত করার পর, আপনি এজেন্ট এবং তার সাথে যুক্ত যেকোনো লোকেশন যাচাই করতে পারবেন। এজেন্ট এবং লোকেশন চালু করার আগে আপনাকে অবশ্যই সেগুলো যাচাই করতে হবে।
এজেন্ট যাচাইকরণ
আপনি যখন কোনো এজেন্টকে যাচাই করেন, তখন বিজনেস মেসেজেস সেই এজেন্টের প্রতিনিধিত্বকারী ব্র্যান্ডের কোনো একজন প্রতিনিধির সাথে এজেন্টের তথ্য যাচাই করে নেয়। ব্র্যান্ডের প্রতিনিধি যখন নিশ্চিত করেন যে আপনি ওই এজেন্টের মাধ্যমে ব্র্যান্ডটির প্রতিনিধিত্ব করতে পারবেন এবং এজেন্টের তথ্য সঠিক, তখন এজেন্টকে যাচাই করা হয়ে যায়।
প্রাক-যাচাই চেকলিস্ট
আপনার এজেন্টকে যাচাই করার আগে, যাচাইকরণ প্রক্রিয়ার সময় উদ্ভূত হতে পারে এমন যেকোনো সমস্যা শনাক্ত করতে নিম্নলিখিত চেকলিস্টটি ব্যবহার করুন।
| এজেন্টের তথ্য |
|---|
| এজেন্টের নাম আবশ্যক। এজেন্টের নাম, যা ব্যবহারকারীদের কাছে প্রদর্শিত হয়। এজেন্ট তৈরি করুন দেখুন। |
| এজেন্ট লোগো আবশ্যক। এজেন্টের লোগো, যা ব্যবহারকারীদের কাছে প্রদর্শিত হয়। ‘এজেন্ট তৈরি করুন’ দেখুন। |
| মেসেজিং উপলব্ধতা আবশ্যক। যে দিন ও সময়ে লাইভ এজেন্টরা ব্যবহারকারীদের উত্তর দেওয়ার জন্য উপলব্ধ থাকেন। মেসেজিং উপলব্ধতা সেট করুন দেখুন। |
| অস্থানীয় তথ্য অস্থানীয় এন্ট্রি পয়েন্টের জন্য আবশ্যক। এজেন্টের সংশ্লিষ্ট ডোমেইন, ফোন নম্বর এবং উপলব্ধ লঞ্চ অঞ্চলসমূহ। অস্থানীয় তথ্য সেট করুন দেখুন। |
| ডিফল্ট লোকেল আবশ্যক। যে লোকেলে এজেন্ট সাধারণত যোগাযোগ করে। লোকেলাইজেশন এবং লোকেলস দেখুন। |
| OAuth কনফিগারেশন ঐচ্ছিক। অন্যান্য পণ্যের সাথে এজেন্টের OAuth ইন্টিগ্রেশন সম্পর্কে বিস্তারিত জানতে, ‘OAuth দিয়ে প্রমাণীকরণ’ দেখুন। |
| অনুমোদিত প্রবেশ পথ আবশ্যক। আপনি বিজনেস কমিউনিকেশনস এপিআই (Business Communications API) ব্যবহার করে এজেন্টটি তৈরি করেছেন কিনা, তা যাচাই করার জন্যই কেবল এটি প্রয়োজন। ‘এজেন্ট তৈরি করুন’ দেখুন। |
আপনার এজেন্টকে যাচাই করার পর, আপনি শুধুমাত্র নিম্নলিখিত আইটেমগুলি আপডেট করতে পারবেন:
-
conversationalSettings -
customAgentId -
defaultLocale -
primaryAgentInteraction -
additionalAgentInteractions -
phone
আপনার এজেন্ট যাচাই করার পরে যদি পঠনযোগ্য ফিল্ডগুলি আপডেট করার প্রয়োজন হয়,আমাদের সাথে যোগাযোগ করুন। (আপনাকে প্রথমে একটি বিজনেস মেসেজেস গুগল অ্যাকাউন্ট দিয়ে সাইন ইন করতে হবে। অ্যাকাউন্ট নিবন্ধন করার জন্য, ‘বিজনেস মেসেজেস-এ নিবন্ধন করুন’ দেখুন।)
পূর্বশর্ত
আপনার এজেন্টকে যাচাই করার আগে, আপনাকে কিছু তথ্য সংগ্রহ করতে হবে:
এজেন্টের
nameআপনি যদি কোনো এজেন্টের নাম না জানেন, তাহলে ‘একটি ব্র্যান্ডের সকল এজেন্টের তালিকা’ দেখুন।
আপনার ডেভেলপমেন্ট মেশিনে আপনার GCP প্রোজেক্টের সার্ভিস অ্যাকাউন্ট কী-এর পাথ
- অংশীদারের নাম (আপনার প্রতিষ্ঠানের নাম)
- অংশীদারের ইমেল (আপনার ইমেল)
- এজেন্ট যে ব্র্যান্ডের প্রতিনিধিত্ব করে, তার ওয়েবসাইট, যা "https://" দিয়ে শুরু হওয়া একটি সর্বজনীনভাবে উপলব্ধ URL।
- এজেন্ট যে ব্র্যান্ডের প্রতিনিধিত্ব করেন, সেই ব্র্যান্ডের যোগাযোগের নাম এবং ইমেল (যা সাধারণত ব্র্যান্ড ওয়েবসাইটের সাথে একই ডোমেইনে থাকে), যিনি ব্র্যান্ডের সাথে আপনার ব্যবসায়িক সম্পর্ক এবং ব্র্যান্ডের প্রতিনিধিত্ব করার জন্য আপনার কর্তৃত্ব যাচাই করতে পারবেন।
একজন এজেন্ট যাচাই করুন
আপনি যখন কোনো এজেন্টের জন্য যাচাইকরণের অনুরোধ করেন, তখন বিজনেস মেসেজেস আপনার এজেন্টের তথ্য নিশ্চিত করার জন্য আপনার নির্দিষ্ট করা ব্র্যান্ড কন্ট্যাক্টকে একটি ইমেল পাঠায়।
যখন ব্র্যান্ড কন্টাক্ট আপনার এজেন্টের তথ্য যাচাই করে এবং বিজনেস মেসেজেস আপনার এজেন্টকে যাচাই করে, তখন আপনি একটি ইমেল পান।
কোনো এজেন্টকে যাচাই করতে, নিম্নলিখিত কমান্ডটি চালান। পূর্বশর্তসমূহে উল্লিখিত মান দিয়ে ভেরিয়েবলগুলো প্রতিস্থাপন করুন।
cURL
# This code requests a verification of a Business Messages agent. # Read more: https://developers.google.com/business-communications/business-messages/guides/how-to/verify?method=api#verify_an_agent # Replace the __BRAND_ID__ and __AGENT_ID__ # Make sure a service account key file exists at ./service_account_key.json curl -X POST \ "https://businesscommunications.googleapis.com/v1/brands/__BRAND_ID__/agents/__AGENT_ID__:requestVerification" \ -H "Content-Type: application/json" \ -H "User-Agent: curl/business-communications" \ -H "$(oauth2l header --json ./service_account_key.json businesscommunications)" \ -d '{ "agentVerificationContact": { "partnerName": "Partner name", "partnerEmailAddress": "partner@email.com", "brandContactName": "Brand contact name", "brandContactEmailAddress": "brand-contact@email.com", "brandWebsiteUrl": "https://www.your-company-website.com" } }'
নোড.জেএস
/** * This code snippet requests an agent verification. * Read more: https://developers.google.com/business-communications/business-messages/guides/how-to/verify?method=api#verify_an_agent * * This code is based on the https://github.com/google-business-communications/nodejs-businesscommunications Node.js * Business Communications client library. */ /** * Edit the values below: */ const BRAND_ID = 'EDIT_HERE'; const AGENT_ID = 'EDIT_HERE'; const PATH_TO_SERVICE_ACCOUNT_KEY = './service_account_key.json'; const businesscommunications = require('businesscommunications'); const {google} = require('googleapis'); // Initialize the Business Communications API const bcApi = new businesscommunications.businesscommunications_v1.Businesscommunications({}); // Set the scope that we need for the Business Communications API const scopes = [ 'https://www.googleapis.com/auth/businesscommunications', ]; // Set the private key to the service account file const privatekey = require(PATH_TO_SERVICE_ACCOUNT_KEY); async function main() { const authClient = await initCredentials(); const agentName = 'brands/' + BRAND_ID + '/agents/' + AGENT_ID; if (authClient) { const agentVerificationContact = { agentVerificationContact: { partnerName: 'Partner name', partnerEmailAddress: 'partner@email.com', brandContactName: 'Brand contact name', brandContactEmailAddress: 'brand-contact@email.com', brandWebsiteUrl: 'https://www.your-company-website.com', }, }; // Setup the parameters for the API call const apiParams = { auth: authClient, name: agentName, resource: agentVerificationContact, }; bcApi.brands.agents.requestVerification(apiParams, {}, (err, response) => { if (err !== undefined && err !== null) { console.dir(err); } else { // Agent found console.log(response.data); } }); } else { console.log('Authentication failure.'); } } /** * Initializes the Google credentials for calling the * Business Messages API. */ async function initCredentials() { // Configure a JWT auth client const authClient = new google.auth.JWT( privatekey.client_email, null, privatekey.private_key, scopes, ); return new Promise(function(resolve, reject) { // Authenticate request authClient.authorize(function(err, tokens) { if (err) { reject(false); } else { resolve(authClient); } }); }); } main();
জাভা
import com.google.api.client.googleapis.auth.oauth2.GoogleCredential; import com.google.api.client.googleapis.javanet.GoogleNetHttpTransport; import com.google.api.client.http.HttpTransport; import com.google.api.client.json.jackson2.JacksonFactory; import com.google.api.services.businesscommunications.v1.BusinessCommunications; import com.google.api.services.businesscommunications.v1.model.Agent; import java.io.FileInputStream; import java.util.Arrays; class Main { /** * Initializes credentials used by the Business Communications API. */ private static BusinessCommunications.Builder getBusinessCommunicationsBuilder() { BusinessCommunications.Builder builder = null; try { GoogleCredential credential = GoogleCredential .fromStream(new FileInputStream("PATH_TO_SERVICE_ACCOUNT_KEY")); credential = credential.createScoped(Arrays.asList( "https://www.googleapis.com/auth/businesscommunications")); credential.refreshToken(); HttpTransport httpTransport = GoogleNetHttpTransport.newTrustedTransport(); JacksonFactory jsonFactory = JacksonFactory.getDefaultInstance(); // Create instance of the Business Communications API builder = new BusinessCommunications .Builder(httpTransport, jsonFactory, null) .setApplicationName(credential.getServiceAccountProjectId()); // Set the API credentials and endpoint builder.setHttpRequestInitializer(credential); } catch (Exception e) { e.printStackTrace(); } return builder; } public static void main(String args[]) { try { // Create client library reference BusinessCommunications.Builder builder = getBusinessCommunicationsBuilder(); String agentName = "brands/BRAND_ID/agents/AGENT_ID"; BusinessCommunications.Brands.Agents.RequestVerification request = builder.build().brands().agents().requestVerification(agentName, new RequestAgentVerificationRequest().setAgentVerificationContact( new AgentVerificationContact() .setPartnerName("PARTNER_NAME") .setPartnerEmailAddress("PARTNER_EMAIL") .setBrandContactName("BRAND_CONTACT_NAME") .setBrandContactEmailAddress("BRAND_CONTACT_EMAIL") .setBrandWebsiteUrl("BRAND_WEBSITE_URL"))); System.out.println(request.execute().toPrettyString()); } catch (Exception e) { e.printStackTrace(); } } }
পাইথন
"""This code requests a verification of a Business Messages agent. Read more: https://developers.google.com/business-communications/business-messages/guides/how-to/verify?method=api#verify_an_agent This code is based on the https://github.com/google-business-communications/python-businessmessages Python Business Messages client library. """ from oauth2client.service_account import ServiceAccountCredentials from businesscommunications.businesscommunications_v1_client import BusinesscommunicationsV1 from businesscommunications.businesscommunications_v1_messages import ( BusinesscommunicationsBrandsAgentsRequestVerificationRequest, RequestAgentVerificationRequest, AgentVerificationContact ) # Edit the values below: BRAND_ID = 'EDIT_HERE' AGENT_ID = 'EDIT_HERE' SCOPES = ['https://www.googleapis.com/auth/businesscommunications'] SERVICE_ACCOUNT_FILE = './service_account_key.json' credentials = ServiceAccountCredentials.from_json_keyfile_name( SERVICE_ACCOUNT_FILE, scopes=SCOPES) client = BusinesscommunicationsV1(credentials=credentials) agents_service = BusinesscommunicationsV1.BrandsAgentsService(client) agent_name = 'brands/' + BRAND_ID + '/agents/' + AGENT_ID verification_request = agents_service.RequestVerification(BusinesscommunicationsBrandsAgentsRequestVerificationRequest( name=agent_name, requestAgentVerificationRequest=RequestAgentVerificationRequest( agentVerificationContact=AgentVerificationContact( partnerName='Partner name', partnerEmailAddress='partner@email.com', brandContactName='Brand contact name', brandContactEmailAddress='brand-contact@email.com', brandWebsiteUrl='https://www.your-company-website.com' )) )) print(verification_request)
ফরম্যাটিং এবং ভ্যালু অপশনগুলির জন্য, brands.agents.requestVerification দেখুন।
এজেন্টের যাচাইকরণ অবস্থা জানুন
এজেন্ট যাচাইকরণের অনুরোধ করার পর, আপনি আপনার এজেন্টের যাচাইকরণের অবস্থা যাচাই করতে পারবেন।
কোনো এজেন্টের যাচাইকরণ অবস্থা জানতে, নিম্নলিখিত কমান্ডটি চালান। পূর্বশর্তসমূহে উল্লেখিত মান দিয়ে ভেরিয়েবলগুলো প্রতিস্থাপন করুন।
cURL
# This code gets the agent verification state. # Read more: https://developers.google.com/business-communications/business-messages/reference/business-communications/rest/v1/brands.locations/getVerification # Replace the __BRAND_ID__ and __AGENT_ID__ # Make sure a service account key file exists at ./service_account_key.json curl -X GET \ "https://businesscommunications.googleapis.com/v1/brands/__BRAND_ID__/agents/__AGENT_ID__/verification" \ -H "Content-Type: application/json" \ -H "User-Agent: curl/business-communications" \ -H "$(oauth2l header --json ./service_account_key.json businesscommunications)"
নোড.জেএস
/** * This code snippet gets an agent verification state. * Read more: https://developers.google.com/business-communications/business-messages/reference/business-communications/rest/v1/brands.locations/getVerification * * This code is based on the https://github.com/google-business-communications/nodejs-businesscommunications Node.js * Business Communications client library. */ /** * Edit the values below: */ const BRAND_ID = 'EDIT_HERE'; const AGENT_ID = 'EDIT_HERE'; const PATH_TO_SERVICE_ACCOUNT_KEY = './service_account_key.json'; const businesscommunications = require('businesscommunications'); const {google} = require('googleapis'); // Initialize the Business Communications API const bcApi = new businesscommunications.businesscommunications_v1.Businesscommunications({}); // Set the scope that we need for the Business Communications API const scopes = [ 'https://www.googleapis.com/auth/businesscommunications', ]; // Set the private key to the service account file const privatekey = require(PATH_TO_SERVICE_ACCOUNT_KEY); async function main() { const authClient = await initCredentials(); const agentName = 'brands/' + BRAND_ID + '/agents/' + AGENT_ID; if (authClient) { // Setup the parameters for the API call const apiParams = { auth: authClient, name: agentName + '/verification', }; bcApi.brands.agents.getVerification(apiParams, {}, (err, response) => { if (err !== undefined && err !== null) { console.dir(err); } else { // Agent found console.log(response.data); } }); } else { console.log('Authentication failure.'); } } /** * Initializes the Google credentials for calling the * Business Messages API. */ async function initCredentials() { // Configure a JWT auth client const authClient = new google.auth.JWT( privatekey.client_email, null, privatekey.private_key, scopes, ); return new Promise(function(resolve, reject) { // Authenticate request authClient.authorize(function(err, tokens) { if (err) { reject(false); } else { resolve(authClient); } }); }); } main();
জাভা
import com.google.api.client.googleapis.auth.oauth2.GoogleCredential; import com.google.api.client.googleapis.javanet.GoogleNetHttpTransport; import com.google.api.client.http.HttpTransport; import com.google.api.client.json.jackson2.JacksonFactory; import com.google.api.services.businesscommunications.v1.BusinessCommunications; import com.google.api.services.businesscommunications.v1.model.Agent; import java.io.FileInputStream; import java.util.Arrays; class Main { /** * Initializes credentials used by the Business Communications API. */ private static BusinessCommunications.Builder getBusinessCommunicationsBuilder() { BusinessCommunications.Builder builder = null; try { GoogleCredential credential = GoogleCredential .fromStream(new FileInputStream("PATH_TO_SERVICE_ACCOUNT_KEY")); credential = credential.createScoped(Arrays.asList( "https://www.googleapis.com/auth/businesscommunications")); credential.refreshToken(); HttpTransport httpTransport = GoogleNetHttpTransport.newTrustedTransport(); JacksonFactory jsonFactory = JacksonFactory.getDefaultInstance(); // Create instance of the Business Communications API builder = new BusinessCommunications .Builder(httpTransport, jsonFactory, null) .setApplicationName(credential.getServiceAccountProjectId()); // Set the API credentials and endpoint builder.setHttpRequestInitializer(credential); } catch (Exception e) { e.printStackTrace(); } return builder; } public static void main(String args[]) { try { // Create client library reference BusinessCommunications.Builder builder = getBusinessCommunicationsBuilder(); String agentName = "brands/BRAND_ID/agents/AGENT_ID/verification"; BusinessCommunications.Brands.Agents.GetVerification request = builder.build().brands().agents().getVerification(agentName); System.out.println(request.execute().toPrettyString()); } catch (Exception e) { e.printStackTrace(); } } }
পাইথন
"""This code gets the agent verification state. Read more: https://developers.google.com/business-communications/business-messages/reference/business-communications/rest/v1/brands.locations/getVerification This code is based on the https://github.com/google-business-communications/python-businessmessages Python Business Messages client library. """ from oauth2client.service_account import ServiceAccountCredentials from businesscommunications.businesscommunications_v1_client import BusinesscommunicationsV1 from businesscommunications.businesscommunications_v1_messages import ( BusinesscommunicationsBrandsAgentsGetVerificationRequest, ) # Edit the values below: BRAND_ID = 'EDIT_HERE' AGENT_ID = 'EDIT_HERE' SCOPES = ['https://www.googleapis.com/auth/businesscommunications'] SERVICE_ACCOUNT_FILE = './service_account_key.json' credentials = ServiceAccountCredentials.from_json_keyfile_name( SERVICE_ACCOUNT_FILE, scopes=SCOPES) client = BusinesscommunicationsV1(credentials=credentials) agents_service = BusinesscommunicationsV1.BrandsAgentsService(client) agent_name = 'brands/' + BRAND_ID + '/agents/' + AGENT_ID + '/verification' verification_state = agents_service.GetVerification(BusinesscommunicationsBrandsAgentsGetVerificationRequest( name=agent_name )) print(verification_state)
ফরম্যাটিং এবং ভ্যালু অপশনগুলির জন্য, brands.agents.getVerification দেখুন।
এজেন্ট যাচাইকরণ অনুরোধ বাতিল করুন
যদি আপনি দেখেন যে এজেন্টের তথ্য ভুল আছে অথবা এজেন্ট অন্য কোনো কারণে ভেরিফিকেশনের জন্য প্রস্তুত নন, তাহলে আপনি অপেক্ষাধীন ভেরিফিকেশন অনুরোধগুলো বাতিল করতে পারেন। আপনি কোনো অনুরোধ বাতিল করলে, বিজনেস মেসেজেস আপনার ব্র্যান্ড কন্ট্যাক্টকে জানিয়ে দেয় এবং ভেরিফিকেশন প্রক্রিয়াটি পুনরায় শুরু করার জন্য আপনাকে একটি নতুন ভেরিফিকেশন অনুরোধ করতে হবে।
এজেন্ট যাচাইকরণ অনুরোধ বাতিল করতে, নিম্নলিখিত কমান্ডটি চালান। পূর্বশর্তসমূহে উল্লিখিত মান দিয়ে ভেরিয়েবলগুলো প্রতিস্থাপন করুন।
cURL
# This code updates the verification state of an agent. # Read more: https://developers.google.com/business-communications/business-messages/reference/business-communications/rest/v1/brands.agents/updateVerification # Replace the __BRAND_ID__ and __AGENT_ID__ # Make sure a service account key file exists at ./service_account_key.json curl -X PATCH \ "https://businesscommunications.googleapis.com/v1/brands/__BRAND_ID__/agents/__AGENT_ID__/verification" \ -H "Content-Type: application/json" \ -H "User-Agent: curl/business-communications" \ -H "$(oauth2l header --json ./service_account_key.json businesscommunications)" \ -d '{ "verificationState": "VERIFICATION_STATE_UNVERIFIED" }'
নোড.জেএস
/** * This code snippet updates the state of an agent verification. * Read more: https://developers.google.com/business-communications/business-messages/reference/business-communications/rest/v1/brands.agents/updateVerification * * This code is based on the https://github.com/google-business-communications/nodejs-businesscommunications Node.js * Business Communications client library. */ /** * Edit the values below: */ const BRAND_ID = 'EDIT_HERE'; const AGENT_ID = 'EDIT_HERE'; const PATH_TO_SERVICE_ACCOUNT_KEY = './service_account_key.json'; const businesscommunications = require('businesscommunications'); const {google} = require('googleapis'); // Initialize the Business Communications API const bcApi = new businesscommunications.businesscommunications_v1.Businesscommunications({}); // Set the scope that we need for the Business Communications API const scopes = [ 'https://www.googleapis.com/auth/businesscommunications', ]; // Set the private key to the service account file const privatekey = require(PATH_TO_SERVICE_ACCOUNT_KEY); async function main() { const authClient = await initCredentials(); const agentName = 'brands/' + BRAND_ID + '/agents/' + AGENT_ID; if (authClient) { // Setup the parameters for the API call const apiParams = { auth: authClient, name: agentName + '/verification', updateMask: 'verificationState', resource: { name: agentName, verificationState: 'VERIFICATION_STATE_UNVERIFIED', } }; bcApi.brands.agents.updateVerification(apiParams, {}, (err, response) => { if (err !== undefined && err !== null) { console.dir(err); } else { // Agent found console.log(response.data); } }); } else { console.log('Authentication failure.'); } } /** * Initializes the Google credentials for calling the * Business Messages API. */ async function initCredentials() { // Configure a JWT auth client const authClient = new google.auth.JWT( privatekey.client_email, null, privatekey.private_key, scopes, ); return new Promise(function(resolve, reject) { // Authenticate request authClient.authorize(function(err, tokens) { if (err) { reject(false); } else { resolve(authClient); } }); }); } main();
জাভা
import com.google.api.client.googleapis.auth.oauth2.GoogleCredential; import com.google.api.client.googleapis.javanet.GoogleNetHttpTransport; import com.google.api.client.http.HttpTransport; import com.google.api.client.json.jackson2.JacksonFactory; import com.google.api.services.businesscommunications.v1.BusinessCommunications; import com.google.api.services.businesscommunications.v1.model.Agent; import java.io.FileInputStream; import java.util.Arrays; class Main { /** * Initializes credentials used by the Business Communications API. */ private static BusinessCommunications.Builder getBusinessCommunicationsBuilder() { BusinessCommunications.Builder builder = null; try { GoogleCredential credential = GoogleCredential .fromStream(new FileInputStream("PATH_TO_SERVICE_ACCOUNT_KEY")); credential = credential.createScoped(Arrays.asList( "https://www.googleapis.com/auth/businesscommunications")); credential.refreshToken(); HttpTransport httpTransport = GoogleNetHttpTransport.newTrustedTransport(); JacksonFactory jsonFactory = JacksonFactory.getDefaultInstance(); // Create instance of the Business Communications API builder = new BusinessCommunications .Builder(httpTransport, jsonFactory, null) .setApplicationName(credential.getServiceAccountProjectId()); // Set the API credentials and endpoint builder.setHttpRequestInitializer(credential); } catch (Exception e) { e.printStackTrace(); } return builder; } public static void main(String args[]) { try { // Create client library reference BusinessCommunications.Builder builder = getBusinessCommunicationsBuilder(); String agentName = "brands/BRAND_ID/agents/AGENT_ID/verification"; BusinessCommunications.Brands.Agents.UpdateVerification request = builder.build().brands().agents().updateVerification(agentName, new AgentVerification().setVerificationState("VERIFICATION_STATE_UNVERIFIED")); System.out.println(request.execute().toPrettyString()); } catch (Exception e) { e.printStackTrace(); } } }
পাইথন
"""This code updates the verification state of an agent. Read more: https://developers.google.com/business-communications/business-messages/reference/business-communications/rest/v1/brands.agents/updateVerification This code is based on the https://github.com/google-business-communications/python-businessmessages Python Business Messages client library. """ from oauth2client.service_account import ServiceAccountCredentials from businesscommunications.businesscommunications_v1_client import BusinesscommunicationsV1 from businesscommunications.businesscommunications_v1_messages import ( AgentVerification, BusinesscommunicationsBrandsAgentsUpdateVerificationRequest, ) # Edit the values below: BRAND_ID = 'EDIT_HERE' AGENT_ID = 'EDIT_HERE' SCOPES = ['https://www.googleapis.com/auth/businesscommunications'] SERVICE_ACCOUNT_FILE = './service_account_key.json' credentials = ServiceAccountCredentials.from_json_keyfile_name( SERVICE_ACCOUNT_FILE, scopes=SCOPES) client = BusinesscommunicationsV1(credentials=credentials) agents_service = BusinesscommunicationsV1.BrandsAgentsService(client) agent_name = 'brands/' + BRAND_ID + '/agents/' + AGENT_ID + '/verification' update_request = agents_service.UpdateVerification( BusinesscommunicationsBrandsAgentsUpdateVerificationRequest( name=agent_name, updateMask='verificationState', agentVerification=AgentVerification(verificationState=AgentVerification.VerificationStateValueValuesEnum.VERIFICATION_STATE_UNVERIFIED) ) ) print(update_request)
ফরম্যাটিং এবং ভ্যালু অপশনগুলির জন্য, brands.agents.updateVerification দেখুন।
অবস্থান যাচাইকরণ
একজন এজেন্টকে যাচাই করার পর, আপনি সেই এজেন্টের সাথে যুক্ত অবস্থানগুলো যাচাই করতে পারবেন। একবার কোনো অবস্থান যাচাই হয়ে গেলে এবং সংশ্লিষ্ট এজেন্টটি চালু হয়ে গেলে, আপনি এজেন্টটির সাথে ব্যবহারের জন্য অবস্থানটি চালু করতে পারবেন।
ব্র্যান্ডটি যদি কোনো চেইনের অংশ হয়, তবে আপনাকে সেই চেইনের এমন সমস্ত লোকেশন যোগ করতে হবে যেখানে মেসেজিং চালু করার অনুমতি আপনার আছে। আপনার যোগ করা সমস্ত লোকেশন যাচাই করতে, শুধুমাত্র একটি লোকেশনের জন্য যাচাইকরণের অনুরোধ করুন । আমরা সেই লোকেশনটি যাচাই করার সাথে সাথে, আপনার যোগ করা অন্যান্য সংশ্লিষ্ট লোকেশনগুলোও স্বয়ংক্রিয়ভাবে যাচাই হয়ে যাবে।
যাচাইকরণের পরে, আপনি যদি অতিরিক্ত অবস্থান যোগ করেন, তাহলে আপনাকে আবার অবস্থান যাচাইকরণের জন্য অনুরোধ করতে হবে। যদি কোনো অবস্থান স্বয়ংক্রিয়ভাবে যাচাই না হয়, তাহলে অনুগ্রহ করে ব্যবসা এবং অবস্থানগুলির বিবরণ সহ আমাদের সাথে যোগাযোগ করুন ।
প্রাক-যাচাই চেকলিস্ট
আপনার অবস্থান যাচাই করার আগে, যাচাইকরণ প্রক্রিয়ার সময় উদ্ভূত হতে পারে এমন যেকোনো সমস্যা শনাক্ত করতে নিম্নলিখিত চেকলিস্টটি ব্যবহার করুন।
| এজেন্টের তথ্য |
|---|
| এজেন্ট যাচাইকরণ আবশ্যক। এজেন্টের তথ্য সঠিক এবং তিনি সংশ্লিষ্ট ব্র্যান্ডের প্রতিনিধিত্ব করতে সক্ষম কিনা, তা যাচাই করতে হবে। ‘এজেন্ট ও অবস্থান যাচাই করুন ’ দেখুন। |
| অবস্থানের তথ্য |
|---|
| স্থান আইডি আবশ্যক। গুগল প্লেসেস ডেটাবেস এবং গুগল ম্যাপস-এ কোনো অবস্থানের অনন্য শনাক্তকারী। অবস্থানসমূহ পরিচালনা দেখুন। |
| অনুমোদিত প্রবেশ পথ আবশ্যক। আপনি বিজনেস কমিউনিকেশনস এপিআই (Business Communications API) ব্যবহার করে এজেন্টটি তৈরি করেছেন কিনা, তা যাচাই করার জন্যই কেবল এটি প্রয়োজন। ‘অবস্থানসমূহ পরিচালনা’ (Manage locations ) দেখুন। |
পূর্বশর্ত
আপনার এজেন্টকে যাচাই করার আগে, আপনাকে কিছু তথ্য সংগ্রহ করতে হবে:
অবস্থানের
nameআপনি যদি কোনো এজেন্টের নাম না জানেন, তাহলে ‘একটি ব্র্যান্ডের সমস্ত অবস্থানের তালিকা’ দেখুন।
আপনার ডেভেলপমেন্ট মেশিনে আপনার GCP প্রোজেক্টের সার্ভিস অ্যাকাউন্ট কী-এর পাথ
অবস্থান যাচাই করুন
আপনি যখন কোনো অবস্থানের যাচাইকরণের জন্য অনুরোধ করেন, তখন বিজনেস মেসেজেস নিশ্চিত করে যে অবস্থানটি সংশ্লিষ্ট এজেন্টের প্রতিনিধিত্ব করা ব্র্যান্ডের সাথে মেলে কিনা। অবস্থান যাচাইকরণ সম্পন্ন হলে আপনি একটি ইমেল পাবেন।
একবার কোনো অবস্থান যাচাই করার পর, আপনি তাতে আর কোনো আপডেট করতে পারবেন না। যাচাই করার পর কোনো অবস্থান আপডেট করতে হলে,আমাদের সাথে যোগাযোগ করুন। (আপনাকে প্রথমে একটি বিজনেস মেসেজেস গুগল অ্যাকাউন্ট দিয়ে সাইন ইন করতে হবে। অ্যাকাউন্ট নিবন্ধন করার জন্য, ‘বিজনেস মেসেজেস-এ নিবন্ধন করুন’ দেখুন।)
অবস্থান যাচাই করতে, নিম্নলিখিত কমান্ডটি চালান। পূর্বশর্তসমূহে উল্লেখিত মান দিয়ে ভেরিয়েবলগুলো প্রতিস্থাপন করুন।
cURL
# This code requests a verification of a location. # Read more: https://developers.google.com/business-communications/business-messages/reference/business-communications/rest/v1/brands.locations/requestVerification # Replace the __BRAND_ID__ and __LOCATION_ID__ # Make sure a service account key file exists at ./service_account_key.json curl -X POST \ "https://businesscommunications.googleapis.com/v1/brands/__BRAND_ID__/locations/__LOCATION_ID__:requestVerification" \ -H "Content-Type: application/json" \ -H "User-Agent: curl/business-communications" \ -H "$(oauth2l header --json ./service_account_key.json businesscommunications)"
নোড.জেএস
/** * This code snippet requests a verification for a location. * Read more: https://developers.google.com/business-communications/business-messages/reference/business-communications/rest/v1/brands.locations/requestVerification * * This code is based on the https://github.com/google-business-communications/nodejs-businesscommunications Node.js * Business Communications client library. */ /** * Edit the values below: */ const BRAND_ID = 'EDIT_HERE'; const LOCATION_ID = 'EDIT_HERE'; const PATH_TO_SERVICE_ACCOUNT_KEY = './service_account_key.json'; const businesscommunications = require('businesscommunications'); const {google} = require('googleapis'); // Initialize the Business Communications API const bcApi = new businesscommunications.businesscommunications_v1.Businesscommunications({}); // Set the scope that we need for the Business Communications API const scopes = [ 'https://www.googleapis.com/auth/businesscommunications', ]; // Set the private key to the service account file const privatekey = require(PATH_TO_SERVICE_ACCOUNT_KEY); async function main() { const authClient = await initCredentials(); const locationName = 'brands/' + BRAND_ID + '/locations/' + LOCATION_ID; if (authClient) { // Setup the parameters for the API call const apiParams = { auth: authClient, name: locationName, }; bcApi.brands.locations.requestVerification(apiParams, {}, (err, response) => { if (err !== undefined && err !== null) { console.dir(err); } else { // Agent found console.log(response.data); } }); } else { console.log('Authentication failure.'); } } /** * Initializes the Google credentials for calling the * Business Messages API. */ async function initCredentials() { // Configure a JWT auth client const authClient = new google.auth.JWT( privatekey.client_email, null, privatekey.private_key, scopes, ); return new Promise(function(resolve, reject) { // Authenticate request authClient.authorize(function(err, tokens) { if (err) { reject(false); } else { resolve(authClient); } }); }); } main();
জাভা
import com.google.api.client.googleapis.auth.oauth2.GoogleCredential; import com.google.api.client.googleapis.javanet.GoogleNetHttpTransport; import com.google.api.client.http.HttpTransport; import com.google.api.client.json.jackson2.JacksonFactory; import com.google.api.services.businesscommunications.v1.BusinessCommunications; import com.google.api.services.businesscommunications.v1.model.Agent; import java.io.FileInputStream; import java.util.Arrays; class Main { /** * Initializes credentials used by the Business Communications API. */ private static BusinessCommunications.Builder getBusinessCommunicationsBuilder() { BusinessCommunications.Builder builder = null; try { GoogleCredential credential = GoogleCredential .fromStream(new FileInputStream("PATH_TO_SERVICE_ACCOUNT_KEY")); credential = credential.createScoped(Arrays.asList( "https://www.googleapis.com/auth/businesscommunications")); credential.refreshToken(); HttpTransport httpTransport = GoogleNetHttpTransport.newTrustedTransport(); JacksonFactory jsonFactory = JacksonFactory.getDefaultInstance(); // Create instance of the Business Communications API builder = new BusinessCommunications .Builder(httpTransport, jsonFactory, null) .setApplicationName(credential.getServiceAccountProjectId()); // Set the API credentials and endpoint builder.setHttpRequestInitializer(credential); } catch (Exception e) { e.printStackTrace(); } return builder; } public static void main(String args[]) { try { // Create client library reference BusinessCommunications.Builder builder = getBusinessCommunicationsBuilder(); String locationName = "brands/BRAND_ID/locations/LOCATION_ID/verification"; BusinessCommunications.Brands.Locations.RequestVerification request = builder.build().brands().locations().requestVerification(locationName, new RequestLocationVerificationRequest()); System.out.println(request.execute().toPrettyString()); } catch (Exception e) { e.printStackTrace(); } } }
পাইথন
"""This code requests a verification of a location. Read more: https://developers.google.com/business-communications/business-messages/reference/business-communications/rest/v1/brands.locations/requestVerification This code is based on the https://github.com/google-business-communications/python-businessmessages Python Business Messages client library. """ from oauth2client.service_account import ServiceAccountCredentials from businesscommunications.businesscommunications_v1_client import BusinesscommunicationsV1 from businesscommunications.businesscommunications_v1_messages import ( BusinesscommunicationsBrandsLocationsRequestVerificationRequest, RequestLocationVerificationRequest ) # Edit the values below: BRAND_ID = 'EDIT_HERE' LOCATION_ID = 'EDIT_HERE' SCOPES = ['https://www.googleapis.com/auth/businesscommunications'] SERVICE_ACCOUNT_FILE = './service_account_key.json' credentials = ServiceAccountCredentials.from_json_keyfile_name( SERVICE_ACCOUNT_FILE, scopes=SCOPES) client = BusinesscommunicationsV1(credentials=credentials) locations_service = BusinesscommunicationsV1.BrandsLocationsService(client) location_name = 'brands/' + BRAND_ID + '/locations/' + LOCATION_ID verification_request = locations_service.RequestVerification(BusinesscommunicationsBrandsLocationsRequestVerificationRequest( name=location_name, requestLocationVerificationRequest=RequestLocationVerificationRequest() )) print(verification_request)
ফরম্যাটিং এবং ভ্যালু অপশনের জন্য, brands.locations.requestVerification দেখুন।
একটি অবস্থানের যাচাইকরণ অবস্থা জানুন
অবস্থান যাচাইয়ের অনুরোধ করার পর, আপনি অবস্থানটির যাচাইয়ের অবস্থা পরীক্ষা করতে পারবেন।
কোনো অবস্থানের যাচাইকরণ অবস্থা জানতে, নিম্নলিখিত কমান্ডটি চালান। পূর্বশর্তসমূহে উল্লেখিত মান দিয়ে ভেরিয়েবলগুলো প্রতিস্থাপন করুন।
cURL
# This code gets the verification state of a location. # Read more: https://developers.google.com/business-communications/business-messages/reference/business-communications/rest/v1/brands.locations/getVerification # Replace the __BRAND_ID__ and __LOCATION_ID__ # Make sure a service account key file exists at ./service_account_key.json curl -X GET \ "https://businesscommunications.googleapis.com/v1/brands/__BRAND_ID__/locations/__LOCATION_ID__/verification" \ -H "Content-Type: application/json" \ -H "User-Agent: curl/business-communications" \ -H "$(oauth2l header --json ./service_account_key.json businesscommunications)"
নোড.জেএস
/** * This code snippet gets the verification state of a location. * Read more: https://developers.google.com/business-communications/business-messages/reference/business-communications/rest/v1/brands.locations/getVerification?hl=en * * This code is based on the https://github.com/google-business-communications/nodejs-businesscommunications Node.js * Business Communications client library. */ /** * Edit the values below: */ const BRAND_ID = 'EDIT_HERE'; const LOCATION_ID = 'EDIT_HERE'; const PATH_TO_SERVICE_ACCOUNT_KEY = './service_account_key.json'; const businesscommunications = require('businesscommunications'); const {google} = require('googleapis'); // Initialize the Business Communications API const bcApi = new businesscommunications.businesscommunications_v1.Businesscommunications({}); // Set the scope that we need for the Business Communications API const scopes = [ 'https://www.googleapis.com/auth/businesscommunications', ]; // Set the private key to the service account file const privatekey = require(PATH_TO_SERVICE_ACCOUNT_KEY); async function main() { const authClient = await initCredentials(); const locationName = 'brands/' + BRAND_ID + '/locations/' + LOCATION_ID; if (authClient) { // Setup the parameters for the API call const apiParams = { auth: authClient, name: locationName + '/verification', }; bcApi.brands.locations.getVerification(apiParams, {}, (err, response) => { if (err !== undefined && err !== null) { console.dir(err); } else { // Agent found console.log(response.data); } }); } else { console.log('Authentication failure.'); } } /** * Initializes the Google credentials for calling the * Business Messages API. */ async function initCredentials() { // Configure a JWT auth client const authClient = new google.auth.JWT( privatekey.client_email, null, privatekey.private_key, scopes, ); return new Promise(function(resolve, reject) { // Authenticate request authClient.authorize(function(err, tokens) { if (err) { reject(false); } else { resolve(authClient); } }); }); } main();
জাভা
import com.google.api.client.googleapis.auth.oauth2.GoogleCredential; import com.google.api.client.googleapis.javanet.GoogleNetHttpTransport; import com.google.api.client.http.HttpTransport; import com.google.api.client.json.jackson2.JacksonFactory; import com.google.api.services.businesscommunications.v1.BusinessCommunications; import com.google.api.services.businesscommunications.v1.model.Agent; import java.io.FileInputStream; import java.util.Arrays; class Main { /** * Initializes credentials used by the Business Communications API. */ private static BusinessCommunications.Builder getBusinessCommunicationsBuilder() { BusinessCommunications.Builder builder = null; try { GoogleCredential credential = GoogleCredential .fromStream(new FileInputStream("PATH_TO_SERVICE_ACCOUNT_KEY")); credential = credential.createScoped(Arrays.asList( "https://www.googleapis.com/auth/businesscommunications")); credential.refreshToken(); HttpTransport httpTransport = GoogleNetHttpTransport.newTrustedTransport(); JacksonFactory jsonFactory = JacksonFactory.getDefaultInstance(); // Create instance of the Business Communications API builder = new BusinessCommunications .Builder(httpTransport, jsonFactory, null) .setApplicationName(credential.getServiceAccountProjectId()); // Set the API credentials and endpoint builder.setHttpRequestInitializer(credential); } catch (Exception e) { e.printStackTrace(); } return builder; } public static void main(String args[]) { try { // Create client library reference BusinessCommunications.Builder builder = getBusinessCommunicationsBuilder(); String locationName = "brands/BRAND_ID/locations/LOCATION_ID/verification"; BusinessCommunications.Brands.Locations.GetVerification request = builder.build().brands().locations().getVerification(locationName); System.out.println(request.execute().toPrettyString()); } catch (Exception e) { e.printStackTrace(); } } }
পাইথন
"""This code gets the verification state of a location. Read more: https://developers.google.com/business-communications/business-messages/reference/business-communications/rest/v1/brands.locations/getVerification This code is based on the https://github.com/google-business-communications/python-businessmessages Python Business Messages client library. """ from oauth2client.service_account import ServiceAccountCredentials from businesscommunications.businesscommunications_v1_client import BusinesscommunicationsV1 from businesscommunications.businesscommunications_v1_messages import ( BusinesscommunicationsBrandsLocationsGetVerificationRequest, ) # Edit the values below: BRAND_ID = 'EDIT_HERE' LOCATION_ID = 'EDIT_HERE' SCOPES = ['https://www.googleapis.com/auth/businesscommunications'] SERVICE_ACCOUNT_FILE = './service_account_key.json' credentials = ServiceAccountCredentials.from_json_keyfile_name( SERVICE_ACCOUNT_FILE, scopes=SCOPES) client = BusinesscommunicationsV1(credentials=credentials) locations_service = BusinesscommunicationsV1.BrandsLocationsService(client) location_name = 'brands/' + BRAND_ID + '/locations/' + LOCATION_ID + '/verification' verification_state = locations_service.GetVerification(BusinesscommunicationsBrandsLocationsGetVerificationRequest( name=location_name )) print(verification_state)
ফরম্যাটিং এবং মানের বিকল্পগুলির জন্য, brands.locations.getVerification দেখুন।
পরবর্তী পদক্ষেপ
আপনার এজেন্ট এবং এর সাথে যুক্ত অবস্থানগুলো যাচাই হয়ে গেলে, আপনি সেগুলোকে চালু করতে প্রস্তুত, যাতে সেগুলো ব্যবহারকারীদের সাথে যোগাযোগ করতে পারে।