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

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

এই পৃষ্ঠাটি ব্যাখ্যা করে যে আপনি কীভাবে মার্চেন্ট 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 ব্যবহার করুন। এটি কেবল পঠনযোগ্য। এর জন্য আপনার merchantId এবং নাম ক্ষেত্রের অংশ হিসেবে মার্চেন্ট রিভিউয়ের আইডি প্রয়োজন। 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 পদ্ধতির মতো, এই পদ্ধতিতে তৈরির সময় ফেরত আসা মার্চেন্ট রিভিউয়ের নাম ক্ষেত্রটি প্রয়োজন।

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

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

মার্চেন্ট পর্যালোচনার স্ট্যাটাস

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