এই টিউটোরিয়াল থেকে আপনি জানতে পারবেন যে কীভাবে রিভিউ তালিকাভুক্ত, ফেরত, উত্তর এবং মুছে ফেলতে হয়। Google My Business API আপনাকে রিভিউ ডেটা ব্যবহার করে নিম্নলিখিত অপারেশনগুলি করার সুবিধা প্রদান করে:
- সব রিভিউয়ের তালিকা তৈরি করুন।
- নির্দিষ্ট রিভিউ পান।
- একাধিক লোকেশন থেকে রিভিউ পান।
- কোনও রিভিউয়ের উত্তর দিন।
- রিভিউয়ের উত্তর মুছে দেওয়া।
শুরু করার আগে
Google My Business API ব্যবহার করার আগে, আপনাকে অ্যাপ্লিকেশন রেজিস্টার করতে হবে এবং OAuth 2.0 ক্রেডেনশিয়াল পেতে হবে। Google My Business API-এর মাধ্যমে কীভাবে শুরু করবেন সেই সম্পর্কে বিস্তারিত জানতে, প্রাথমিক সেট-আপ দেখুন।
সব রিভিউয়ের তালিকা দেখুন
একসাথে অনেক রিভিউ অডিট করার জন্য কোনও লোকেশনের সব রিভিউয়ের তালিকা তৈরি করুন। কোনও লোকেশনের সাথে যুক্ত সব রিভিউ ফেরত পেতে accounts.locations.reviews.list API ব্যবহার করুন।
কোনও লোকেশনের সাথে সম্পর্কিত সব রিভিউ ফিরিয়ে আনতে, নিম্নলিখিত পদ্ধতি ব্যবহার করুন:
GET
https://mybusiness.googleapis.com/v4/accounts/{accountId}/locations/{locationId}/reviews
নিম্নলিখিত ফাংশন Mybusiness.Accounts.Locations.Reviews.List ব্যবহার করে।
/** * Returns a list of reviews. * @param locationName Name of the location to retrieve reviews for. * @return List<Reviews> A list of reviews. * @throws Exception */ public static List<Review> listReviews(String locationName) throws Exception { Mybusiness.Accounts.Locations.Reviews.List reviewsList = mybusiness.accounts().locations().reviews().list(locationName); ListReviewsResponse response = reviewsList.execute(); List<Reviews> reviews = response.getReviews(); for (Reviews review : reviews) { System.out.println(review.toPrettyString()); } return reviews; }
নির্দিষ্ট রিভিউ পান
নাম অনুযায়ী নির্দিষ্ট রিভিউ ফিরিয়ে দিন। কোনও লোকেশনের সাথে যুক্ত নির্দিষ্ট রিভিউ পেতে accounts.locations.reviews.get API ব্যবহার করুন।
নির্দিষ্ট রিভিউ ফেরাতে, নিম্নলিখিত পদ্ধতি ব্যবহার করুন:
GET
https://mybusiness.googleapis.com/v4/accounts/{accountId}/locations/{locationId}/reviews/{reviewId}
নিম্নলিখিত ফাংশন Mybusiness.Accounts.Locations.Reviews.Get ব্যবহার করে।
/** * Demonstrates getting a review by name. * @param reviewName The name (resource path) of the review to retrieve. * @return Account The requested review. */ private static Review getReview(String reviewName) throws Exception { Mybusiness.Accounts.Locations.Reviews.Get review = mybusiness.accounts().locations().reviews().get(reviewName); Review response = review.execute(); return response; }
অতিরিক্ত ডেটা
Java ক্লায়েন্ট লাইব্রেরি আপনাকে পর্যালোচনার ইনস্ট্যান্সের জন্য অতিরিক্ত ফিল্ড ডেটাতে অ্যাক্সেস দেয়। রিভিউ সম্পর্কে অতিরিক্ত ডেটা ফেরত পেতে নিম্নলিখিত পদ্ধতিগুলি ব্যবহার করুন:
getReviewId()getComment()getReviewer()getStarRating()getCreateTime()getReviewReply()
একাধিক লোকেশন থেকে রিভিউ পান
একাধিক লোকেশন থেকে রিভিউ পান। একটি অনুরোধে একাধিক লোকেশন থেকে রিভিউ পেতে accounts.locations.batchGetReviews API ব্যবহার করুন।
একাধিক লোকেশন থেকে রিভিউ পেতে, নিম্নলিখিত পদ্ধতি ব্যবহার করুন:
POST
https://mybusiness.googleapis.com/v4/accounts/{accountId}/locations:batchGetReviews
{
"locationNames": [
string
],
"pageSize": number,
"pageToken": string,
"orderBy": string,
"ignoreRatingOnlyReviews": boolean
}
রিভিউতে উত্তর দিন
নির্দিষ্ট কোনও রিভিউয়ের উত্তর দিন অথবা উত্তর না থাকলে নতুন উত্তর তৈরি করুন। কোনও লোকেশনের সাথে যুক্ত নির্দিষ্ট রিভিউয়ের উত্তর দিতে accounts.locations.reviews.updateReply API ব্যবহার করুন।
কোনও নির্দিষ্ট রিভিউয়ের উত্তর দিতে, নিম্নলিখিত পদ্ধতি অনুসরণ করুন:
PUT
https://mybusiness.googleapis.com/v4/accounts/{accountId}/locations/{locationId}/reviews/{reviewId}/reply
{
"comment": "Thank you for visiting our business!"
}
নিম্নলিখিত ফাংশন Mybusiness.accounts.locations.reviews.reply ব্যবহার করে।
/* * Updates the reply for a location review. * If a review does not exist, creates a new one. * @param reviewName Name of the review being responded to. * @param comment A string containing the review response body. * @throws IOException */ private static Reply reply(String reviewName, String comment) throws IOException { MyBusiness.Accounts.Locations.Reviews.Reply reply = mybusiness().accounts().locations().reviews().reply(reviewName, comment); Reply response = reply.execute(); return response; }
রিভিউয়ের উত্তর মুছে ফেলা
নির্দিষ্ট কোনও রিভিউয়ের উত্তর মুছে ফেলা। কোনও লোকেশনের সাথে যুক্ত নির্দিষ্ট রিভিউয়ের উত্তর মুছতে accounts.locations.reviews.deleteReply API ব্যবহার করুন।
কোনও রিভিউয়ের নির্দিষ্ট উত্তর মুছতে, নিম্নলিখিত পদ্ধতি অনুসরণ করুন:
DELETE
https://mybusiness.googleapis.com/v4/accounts/{accountId}/locations/{locationId}/reviews/{reviewId}/reply
নিম্নলিখিত ফাংশন Mybusiness.Accounts.Locations.Reviews.DeleteReply ব্যবহার করে।
/** * Demonstrates deleting a review reply by name. * @param reviewName The name (resource path) of the review reply to delete. * @return Account The requested review. */ private static DeleteReply deleteReply(String reviewName) throws Exception { Mybusiness.Accounts.Locations.Reviews.DeleteReply toDelete = mybusiness.accounts().locations().reviews().deleteReply(reviewName); DeleteReply response = toDelete.execute(); return response; }