Merchant API ব্যবহার করে বিক্রেতাদের পর্যালোচনা করা

বিক্রেতা রিভিউ, গ্রাহকদের উচ্চ-কোয়ালিটির অভিজ্ঞতা প্রদান করে এমন ব্যবসা খুঁজে পেতে সাহায্য করে। এর ফলে বিশ্বাস তৈরি হয় এবং আরও তথ্য-ভিত্তিক কেনাকাটার সিদ্ধান্ত নেওয়া যায়। এর ফলে, দোকান রেটিং, ব্যবসাগুলিকে বিজ্ঞাপন ও অর্গানিক তালিকার পারফর্ম্যান্স উন্নত করতে এবং তাদের ল্যান্ডিং পৃষ্ঠায় আরও উপযুক্ত গ্রাহকদের নিয়ে আসতে সাহায্য করতে পারে।

Merchant API ব্যবহার করে কীভাবে আপনি বিক্রেতা রিভিউ ম্যানেজ করতে পারবেন তা এই পৃষ্ঠায় ব্যাখ্যা করা হয়েছে।

পূর্বশর্ত

Google-কে নির্দিষ্ট তথ্য দিতে হবে। আপনার কাছে নিম্নলিখিতগুলি থাকতে হবে:

  • Google Merchant Center-এ অ্যাক্টিভ মার্চেন্ট রিভিউ ডেটা সোর্স।
  • আপনার অ্যাকাউন্টকে অবশ্যই স্টোর রেটিং প্রোগ্রামে নথিভুক্ত করতে হবে। আপনি আগে থেকেই এনরোল করেছেন কিনা সেই ব্যাপারে নিশ্চিত না হলে, Merchant Center চেক করুন। আপনি এনরোল না করে থাকলে, অনুরোধ ফর্ম জমা দিন।

ডেটা সোর্স তৈরি করা

মার্চেন্ট রিভিউ ডেটা সোর্স তৈরি করতে, accounts.dataSources.create মেথড ব্যবহার করুন। আগে থেকে থাকা কোনও মার্চেন্ট পর্যালোচনা ডেটা সোর্স উপলভ্য থাকলে, accounts.dataSources.list ব্যবহার করে accounts.dataSources.name ফিল্ডটি পান।

ভবিষ্যতে API কলের সময় সরাসরি উল্লেখ করার জন্য, আমরা সাজেস্ট করি যে আপনি মার্চেন্ট রিভিউয়ের জন্য accounts.dataSources.name আপনার লোকাল ডেটাবেসে তৈরি করা ডেটা সোর্সের জন্য স্টোর করুন। আপনার আগে থেকে থাকা ডেটা সোর্সের জন্য, সেগুলির নাম সহ আপনার স্থানীয় ডেটাবেসের এককালীন ব্যাকফিল করুন।

অনুরোধের ফর্মটি নিচে দেওয়া হল:

POST https://merchantapi.googleapis.com/datasources/v1/accounts/{ACCOUNT_ID}/dataSources/{DATASOURCE_ID}

উদাহরণ

উদাহরণে একটি সাধারণ অনুরোধ ও উত্তর দেখানো হয়েছে।

অনুরোধ

POST https://merchantapi.googleapis.com/datasources/v1/accounts/123/dataSources {"displayName": "test api data source", "merchantReviewDataSource":{} }

উত্তর

{
  "name": "accounts/123/dataSources/1000000573361824",
  "dataSourceId": "1000000573361824",
  "displayName": "test api data source",
  "merchantReviewDataSource": {},
  "input": "API"
}

আরও তথ্যের জন্য, প্রোডাক্ট রিভিউ ডেটা সোর্স তৈরি করুন দেখুন।

মার্চেন্ট রিভিউ তৈরি করা

আপনি কোনও সেলার রিভিউ তৈরি বা আপডেট করতে accounts.merchantReviews.insert পদ্ধতি ব্যবহার করতে পারেন। accounts.merchantReviews.insert পদ্ধতিতে merchantreview রিসোর্স ও ডেটা সোর্সের নাম ইনপুট হিসেবে নেওয়া হয়। সফল হলে, এটি নতুন বা আপডেট করা মার্চেন্ট রিভিউ, রিটার্ন করে। মার্চেন্ট রিভিউ তৈরি করতে accounts.dataSources.name প্রয়োজন।

অনুরোধের ফর্ম:

POST https://merchantapi.googleapis.com/reviews/v1alpha/{parent=accounts/*/}merchantReviews:insert

রেফারেন্সের জন্য নিম্নলিখিত নমুনা মার্চেন্ট রিভিউ ভালো করে দেখুন।

POST https://merchantapi.googleapis.com/reviews/v1alpha/accounts/{ACCOUNT_ID}/merchantReviews:insert?dataSource=accounts/{ACCOUNT_ID}/dataSources/{DATASOURCE_ID}

  merchantReviewId = 'my_own_review'
  merchantReviewAttributes {
    merchantId = 'merchant_id'
    merchantDisplayName = 'merchant_display_name'
    merchantLink = 'publisher_name'
    merchantRatingLink = 'https://www.google.com'
    minRating = 1
    maxRating = 10
    rating = 7.9
    title = 'Amazing Merchant'
    content = 'This is an incredible merchant'
    reviewerId = 'reviewer_id'
    reviewerUsername = 'reviewer_username'
    isAnonymous = false
    collectionMethod = 'AFTER_FULFILLMENT'
    reviewTime = '2024-04-01T00:00:00Z'
    reviewLanguage = 'en'
    reviewCountry = 'US'
  }

মার্চেন্ট রিভিউ তৈরি করার পরে, রিভিউটি প্রোপাগেট হতে কয়েক মিনিট সময় লাগতে পারে।

মার্চেন্ট রিভিউ দেখা

মার্চেন্ট রিভিউ দেখতে, accounts.merchantReviews.get ব্যবহার করুন। এটি শুধু পড়া যাবে। এতে আপনার merchantId এবং মার্চেন্টের আইডি নামের ফিল্ডের অংশ হিসেবে পর্যালোচনা করা প্রয়োজন। get পদ্ধতিতে সংশ্লিষ্ট মার্চেন্ট রিভিউ রিসোর্স ফেরত পাওয়া যায়।

যেমন:

GET https://merchantapi.googleapis.com/reviews/v1alpha/{name=accounts/*/merchantReviews/*}

কোনও নির্দিষ্ট Merchant Center অ্যাকাউন্টের জন্য একটি প্রোডাক্ট পুনরুদ্ধার করতে, আপনি google.shopping.merchant.accounts.v1.GetProductRequest পদ্ধতি ব্যবহার করতে পারেন, যেমনটি নিম্নলিখিত নমুনাতে দেখানো হয়েছে।

Java


import com.google.api.gax.core.FixedCredentialsProvider;
import com.google.auth.oauth2.GoogleCredentials;
import com.google.common.io.BaseEncoding;
import com.google.shopping.merchant.products.v1.GetProductRequest;
import com.google.shopping.merchant.products.v1.Product;
import com.google.shopping.merchant.products.v1.ProductsServiceClient;
import com.google.shopping.merchant.products.v1.ProductsServiceSettings;
import java.nio.charset.StandardCharsets;
import shopping.merchant.samples.utils.Authenticator;
import shopping.merchant.samples.utils.Config;

/** This class demonstrates how to get a single product for a given Merchant Center account */
public class GetProductSample {

  // Base64Url encoder/decoder without padding
  private static final BaseEncoding BASE64URL_NOPADDING = BaseEncoding.base64Url().omitPadding();

  // Encodes a string to base64url without padding
  public static String encodeProductId(String productId) {
    return BASE64URL_NOPADDING.encode(productId.getBytes(StandardCharsets.UTF_8));
  }

  public static Product getProduct(Config config, String accountId, String productId)
      throws Exception {

    // Obtains OAuth token based on the user's configuration.
    GoogleCredentials credential = new Authenticator().authenticate();

    // Creates service settings using the credentials retrieved above.
    ProductsServiceSettings productsServiceSettings =
        ProductsServiceSettings.newBuilder()
            .setCredentialsProvider(FixedCredentialsProvider.create(credential))
            .build();

    try (ProductsServiceClient productsServiceClient =
        ProductsServiceClient.create(productsServiceSettings)) {

      // The name has the format: accounts/{account}/products/{productId}
      String name = "accounts/" + accountId + "/products/" + productId;

      // The name has the format: accounts/{account}/products/{productId}
      GetProductRequest request = GetProductRequest.newBuilder().setName(name).build();

      System.out.println("Sending get product request:");
      Product response = productsServiceClient.getProduct(request);

      System.out.println("Retrieved Product below");
      System.out.println(response);
      return response;
    }
  }

  public static void main(String[] args) throws Exception {
    Config config = Config.load();
    String accountId = config.getAccountId().toString();

    // The name of the `product`, returned after a `Product.insert` request. We recommend
    // having stored this value in your database to use for all future requests.
    String productId = "en~GB~sku123"; // Replace with your actual product ID

    // Uncomment the following line if the product name contains special characters (such as forward
    // slashes) and needs base64url encoding.
    // productId = encodeProductId(productId);

    getProduct(config, accountId, productId);
  }
}

মার্চেন্ট রিভিউ তালিকাভুক্ত করা

তৈরি করা সব মার্চেন্ট রিভিউ দেখতে আপনি accounts.merchantReviews.list পদ্ধতি ব্যবহার করতে পারেন।

GET https://merchantapi.googleapis.com/reviews/v1alpha/accounts/{ACCOUNT_ID}/merchantReviews

মার্চেন্ট রিভিউ মুছে দেওয়া

মার্চেন্ট রিভিউ মুছে দিতে, accounts.merchantReviews.delete ব্যবহার করুন। accounts.merchantReviews.get পদ্ধতির মতো, এই পদ্ধতিতে ক্রিয়েশনের সময় ফেরত আসা মার্চেন্ট পর্যালোচনার নাম ফিল্ড প্রয়োজন।

যেমন:

DELETE https://merchantapi.googleapis.com/reviews/v1alpha/{name=accounts/*/merchantReviews/*}

মার্চেন্ট রিভিউয়ের স্ট্যাটাস

মার্চেন্ট রিভিউ রিসোর্সে অন্যান্য API-এর মতো একই ধরনের স্ট্যাটাস থাকে, যা রিসোর্সের অবিচ্ছেদ্য অংশ এবং একই ধরনের সমস্যা ও গন্তব্য সংক্রান্ত স্ট্রাকচার মেনে চলে।