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

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

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

পূর্বশর্ত

গুগলের আপনার কাছ থেকে নির্দিষ্ট কিছু তথ্য প্রয়োজন। আপনার নিম্নলিখিত বিষয়গুলো অবশ্যই থাকতে হবে:

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

একটি ডেটা উৎস তৈরি করুন

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

অনুরোধের ধরণটি নিম্নরূপ:

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 feed", "merchantReviewDataSource":{} }

প্রতিক্রিয়া

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

আরও তথ্যের জন্য, ‘পণ্য পর্যালোচনা ডেটা উৎস তৈরি করুন’ দেখুন।

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

আপনি একজন বিক্রেতার রিভিউ তৈরি বা আপডেট করতে accounts.merchantReviews.insert মেথডটি ব্যবহার করতে পারেন। accounts.merchantReviews.insert মেথডটি ইনপুট হিসেবে একটি merchantreview রিসোর্স এবং একটি ডেটা সোর্স নেম গ্রহণ করে। সফল হলে, এটি নতুন বা আপডেট করা মার্চেন্ট রিভিউটি রিটার্ন করে। একটি মার্চেন্ট রিভিউ তৈরি করার জন্য datasource.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 ব্যবহার করুন। এটি শুধুমাত্র পঠনযোগ্য (read-only)। এর জন্য name ফিল্ডের অংশ হিসেবে আপনার merchantId এবং মার্চেন্ট রিভিউর ID প্রয়োজন। get মেথডটি সংশ্লিষ্ট মার্চেন্ট রিভিউ রিসোর্সটি রিটার্ন করে।

উদাহরণস্বরূপ:

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

কোনো নির্দিষ্ট মার্চেন্ট সেন্টার অ্যাকাউন্টের জন্য একটিমাত্র পণ্য খুঁজে পেতে, আপনি google.shopping.merchant.accounts.v1.GetProductRequest মেথডটি ব্যবহার করতে পারেন, যেমনটি নিচের নমুনায় দেখানো হয়েছে।

জাভা


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 void 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();

    // Calls the API and catches and prints any network failures/errors.
    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);
    } catch (Exception e) {
      System.out.println(e);
    }
  }

  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~US~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 মেথডের মতোই, এই মেথডটির জন্যও মার্চেন্ট রিভিউ তৈরির সময় প্রাপ্ত name ফিল্ডটির প্রয়োজন হয়।

উদাহরণস্বরূপ:

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

বণিক পর্যালোচনার অবস্থা

মার্চেন্ট রিভিউ রিসোর্সটিতে অন্যান্য এপিআই-এর মতোই স্ট্যাটাস থাকে, যা রিসোর্সটির একটি অবিচ্ছেদ্য অংশ এবং একই ইস্যু ও ডেস্টিনেশন কাঠামো অনুসরণ করে।