সেভ করা পৃষ্ঠা গুছিয়ে রাখতে 'সংগ্রহ' ব্যবহার করুন
আপনার পছন্দ অনুযায়ী কন্টেন্ট সেভ করুন ও সঠিক বিভাগে রাখুন।
Manufacturer Center (MfC) API অ্যাপগুলিকে Manufacturer Center প্ল্যাটফর্মের সাথে সরাসরি ইন্টারঅ্যাক্ট করতে দেয়। আপনাকে শুরু করতে সাহায্য করার জন্য, আমরা Java এবং .NET-এ কোড নমুনা অফার করি।
এই নির্দেশিকা আপনাকে Manufacturer Center API ব্যবহার করে আপনার প্রথম অ্যাপ্লিকেশন তৈরি করতে সাহায্য করবে। আপনি কোডিং শুরু করার আগে, আপনাকে কিছু জিনিস করতে হবে।
REST সমর্থন
আমাদের REST API 2টি ভিন্ন ধরনের সম্পদের জন্য মৌলিক CRUD অপারেশন সমর্থন করে:
এই Manufacturer Center অ্যাকাউন্টটি তৈরি করতে আপনি কোন ইমেলটি ব্যবহার করেছেন তা মনে রাখতে ভুলবেন না, কারণ আপনার পরে এটির প্রয়োজন হবে। স্ক্রিনশটগুলিতে, আপনি এটিকে manufacturer_user@example.com হিসাবে উপস্থাপিত দেখতে পাবেন।
আপনার প্রথম API অনুরোধ করুন (কোডের একটি লাইন ছাড়া!)
Accounts.Products.list এর জন্য আমাদের ডেভেলপার ডকুমেন্টেশনে APIs এক্সপ্লোরার -এ যান।
নিশ্চিত করুন যে লগ ইন করা Google অ্যাকাউন্ট সেটিংস ট্যাবে 'ব্যবহারকারী' সেটিংয়ে তালিকাভুক্ত আছে।
APIs এক্সপ্লোরারে, নিশ্চিত করুন যে প্রমাণীকরণ ড্রপ-ডাউন মেনুতে Google OAuth 2.0 নির্বাচন করা হয়েছে:
accounts/{account_id} লিখুন, আপনার Manufacturer Center অ্যাকাউন্ট থেকে আপনার Manufacturer ID দিয়ে {account_id} প্রতিস্থাপন করুন, ফর্মের 'অভিভাবক' ফিল্ডে, এবং Execute এ ক্লিক করুন।
আপনি একটি সফল প্রতিক্রিয়া দেখতে হবে. অভিনন্দন! আপনি আপনার প্রথম Manufacturer Center API অনুরোধ করেছেন।
আপনার ম্যানুফ্যাকচারার সেন্টারে এখনও কোনও পণ্য না থাকলে, তালিকায় কোনও পণ্য থাকবে না। এই মুহুর্তে, আপনি অন্যান্য অনুরোধে যেতে পারেন এবং তারা কী করে তা দেখে নিতে পারেন। যেহেতু এটি একটি RESTful API, সমস্ত অনুরোধ একইভাবে কাজ করে। একটি ভাল পরবর্তী পদক্ষেপ, একবার আপনার পণ্য হয়ে গেলে, Accounts.Products.get চেষ্টা করা।
একটি Google API কনসোল প্রকল্প তৈরি করুন
আপনার API কনসোল প্রকল্পের মাধ্যমে Manufacturer Center API-এর কাছে অনুরোধ করা হয়। এখানে আমরা ধরে নিচ্ছি যে আপনি আপনার নিজস্ব Manufacturer Center অ্যাকাউন্ট অ্যাক্সেস করবেন, তাই আমরা প্রমাণীকরণ প্রবাহকে সহজ করতে পরিষেবা অ্যাকাউন্ট ব্যবহার করার পরামর্শ দিই। আপনার Manufacturer Center অ্যাকাউন্টের সাথে ব্যবহার করার জন্য কীভাবে একটি নতুন পরিষেবা অ্যাকাউন্ট সেট আপ করবেন তার বিশদ বিবরণের জন্য পরিষেবা অ্যাকাউন্ট গাইড দেখুন।
জাভা ব্যবহার করে আপনার প্রথম অনুমোদিত API অনুরোধ
এখন আপনি একটি পরিষেবা অ্যাকাউন্ট সেট আপ করেছেন এবং আপনার Manufacturer Center অ্যাকাউন্টে পরিষেবা অ্যাকাউন্ট ID যোগ করেছেন, আপনি উপলব্ধ নমুনা কোড ব্যবহার করে আপনার অ্যাকাউন্ট অ্যাক্সেস করতে পারেন। এই গাইড API ব্যবহার করে প্রদর্শন করতে জাভা নমুনা ব্যবহার করে।
Apache Maven ইনস্টল করুন, যদি আপনি ইতিমধ্যে না থাকেন।
আমাদের GitHub পৃষ্ঠা থেকে আমাদের কেনাকাটার নমুনা ডাউনলোড করুন।
java সাবডিরেক্টরি থেকে, জাভা নমুনা তৈরি করুন:
$mvncompile
এখন ProductsListSample চালান ( প্রোডাক্ট সার্টিফিকেশনের উদাহরণ হবে ListProductCertificationsSample ) কোড:
আপনি যদি সোর্স ফাইলগুলির সাথে README-এ কনফিগারেশন নির্দেশাবলী অনুসরণ না করে থাকেন, তাহলে আপনি একটি ত্রুটি পাবেন যে কোনও নমুনা কনফিগারেশন খুঁজে পাওয়া যায়নি। কনফিগারেশন ডিরেক্টরি তৈরি করতে এবং উপযুক্ত তথ্য দিয়ে এটিকে পূরণ করতে README-এর নির্দেশাবলী অনুসরণ করুন। আপনার পরিষেবা অ্যাকাউন্ট সেট আপ করার সময় আপনি যে JSON ফাইলটি ডাউনলোড করেছেন সেটি ফাইলের নাম service-account.json সহ সেই ডিরেক্টরিতে স্থাপন করা উচিত। নিম্নলিখিত এনভায়রনমেন্ট ভেরিয়েবল সেট করে আপনার ফাইলটি কোথায় আছে তা কোডটি বলতে ভুলবেন না।
এই মুহুর্তে, জাভা প্রোগ্রামটি কার্যকর করা শেষ করা উচিত, এবং এটি পাওয়া পণ্যগুলির একটি তালিকা প্রিন্ট আউট করা উচিত, অথবা একটি বার্তা যে আপনার অ্যাকাউন্টে কোন পণ্য নেই। আপনি যদি একটি ত্রুটি পান যেমন "ব্যবহারকারী অ্যাকাউন্ট 1234567890 অ্যাক্সেস করতে পারে না", এটি সম্ভবত কারণ আপনি ম্যানুফ্যাকচারার সেন্টারে অনুমোদিত ব্যবহারকারী হিসাবে পরিষেবা অ্যাকাউন্ট ব্যবহারকারীকে সেট আপ করেননি। API এর দৃষ্টিকোণ থেকে, API কনসোল প্রকল্পটি এমন একজন ব্যবহারকারীর পক্ষ থেকে একটি অনুরোধ পাঠিয়েছে যিনি অনুমোদিত প্রস্তুতকারক কেন্দ্র প্রশাসকদের তালিকায় ছিলেন না, তাই এটি অবশ্যই সেই অনুরোধ প্রত্যাখ্যান করবে।
আপনি যতবার চান ততবার ProductsListSample চালানোর সাথে পরীক্ষা করতে পারেন, যেহেতু এটি একটি শুধুমাত্র-পঠন অনুরোধ। আপনি অন্যান্য নমুনাগুলিও অন্বেষণ করতে পারেন যা আমরা Java এবং .NET উভয়ের জন্য তৈরি করেছি৷
[null,null,["2025-08-29 UTC-তে শেষবার আপডেট করা হয়েছে।"],[[["\u003cp\u003eThe Manufacturer Center API allows direct interaction with the Manufacturer Center platform, offering code samples in Java and .NET to facilitate application development.\u003c/p\u003e\n"],["\u003cp\u003eBefore using the API, you need to set up a Manufacturer Center account and make an initial API request using the API Explorer to authorize access.\u003c/p\u003e\n"],["\u003cp\u003eA Google API Console project with a service account is necessary to make requests to the Manufacturer Center API, enabling secure communication.\u003c/p\u003e\n"],["\u003cp\u003eYou can access your Manufacturer Center account using provided sample code (e.g., Java samples) after configuring a service account and adding it as an authorized user.\u003c/p\u003e\n"],["\u003cp\u003eThe samples demonstrate various API functionalities, including listing products and performing other read-only operations, allowing for experimentation and further exploration.\u003c/p\u003e\n"]]],[],null,["# Get Started\n\nThe Manufacturer Center (MfC) API allows apps to interact directly with the\n[Manufacturer Center platform](https://manufacturers.google.com). To help you\nget started, we offer [code samples](/manufacturers/libraries) in Java and .NET.\n\nThis guide will help you create your first application using the Manufacturer\nCenter API. Before you can start coding, there are a few things you need to do.\n\nREST Support\n------------\n\nOur REST API supports basic CRUD operations for 2 different types of resources:\n\n- [Product](/manufacturers/reference/rest/v1/accounts.products) for Brand Owners and Data Partners.\n- And [ProductCertification](/manufacturers/reference/rest/v1/accounts.languages.productCertifications) for Certification Bodies.\n\nThe rest of this documentation will be written mainly for [Product](/manufacturers/reference/rest/v1/accounts.products) but the process should be similar for [ProductCertification](/manufacturers/reference/rest/v1/accounts.languages.productCertifications).\n\nSet up your Manufacturer Center Account\n---------------------------------------\n\n1. Create a [Manufacturer Center\n Account](//support.google.com/manufacturers/answer/7064831).\n\n | **Note:** Certification Body users can't create an account this way but need to contact our support directly.\n2. Be sure to remember which email you used to create this Manufacturer Center\n account, as you will need that later. In the screenshots, you'll see it\n represented as **manufacturer_user@example.com**.\n\nMake your first API request (without a line of code!)\n-----------------------------------------------------\n\n1. Head over to the [APIs\n Explorer](/manufacturers/reference/rest/v1/accounts.products/list#try-it) in\n our developer documentation for `Accounts.Products.list`.\n\n2. Ensure that the logged in Google account is listed in the 'Users' setting\n in the Settings tab.\n\n3. In the APIs Explorer, make sure that **Google OAuth 2.0** is selected in the\n **Authentication** drop-down menu:\n\n4. Enter `accounts/{account_id}`, replacing `{account_id}` with your\n Manufacturer ID from your Manufacturer Center account, into the 'parent'\n field of the form, and click **Execute**.\n\n | **Note:** If you have not previously granted OAuth2 permission, you will now be asked to authorize the call.\n5. You should see a successful response. Congratulations! You've made your\n first Manufacturer Center API request.\n\n6. If you have no products in your Manufacturer Center yet, there won't be any\n in the list. At this point, you can hop to other requests and take a look at\n what they do. Since this is a RESTful API, all requests work similarly. A\n good next step, once you have products, is to try\n [`Accounts.Products.get`](/manufacturers/reference/rest/v1/accounts.products/get#try-it).\n\nCreate a Google API Console Project\n-----------------------------------\n\nRequests to the Manufacturer Center API are made through your API Console project. Here we assume you will be accessing your own\nManufacturer Center account, so we suggest using [service\naccounts](/identity/protocols/OAuth2ServiceAccount) to simplify the\nauthentication flow. See the [Service\nAccounts](/manufacturers/how-tos/service-accounts) Guide for details on how to\nset up a new service account to use with your Manufacturer Center account.\n| **Note:** If you are interested in making calls on behalf of clients with their own Manufacturer Center accounts, then see the [Authorize\n| Requests](/manufacturers/how-tos/authorizing) guide.\n\nYour first authorized API request using Java\n--------------------------------------------\n\nNow that you've set up a service account and added the service account ID to\nyour Manufacturer Center account, you can access your account using the\navailable [Samples code](/manufacturers/libraries). This guide uses the Java\nsamples to demonstrate using the API.\n\n1. Install [Apache Maven](https://maven.apache.org/), if you haven't already.\n\n2. Download our [Shopping\n samples](//github.com/googleads/googleads-shopping-samples/) from our GitHub\n page.\n\n3. From within the `java` subdirectory, build the Java samples:\n\n $ mvn compile\n\n4. Now run the `ProductsListSample` (the example for [ProductCertification](/manufacturers/reference/rest/v1/accounts.languages.productCertifications) would be `ListProductCertificationsSample`) code:\n\n $ mvn exec:java -Dexec.mainClass=\"shopping.manufacturers.v1.samples.products.ProductsListSample\"\n\n5. If you haven't followed the configuration directions in the README\n accompanying the source files, you will get an error that no sample\n configuration could be found. Follow the directions in the README to create\n the configuration directory and to populate it with the appropriate\n information. The JSON file you downloaded while setting up your service\n account should be placed in that directory with the filename\n `service-account.json`. Remember to tell the code where your file is by\n setting the following environment variable.\n\n export GOOGLE_APPLICATION_CREDENTIALS=\u003cPath to your JSON credentials file\u003e\n\n6. Now that you have set up the samples configuration, run the\n `ProductsListSample` code again.\n\n $ mvn exec:java -Dexec.mainClass=\"shopping.manufacturers.v1.samples.products.ProductsListSample\"\n\n7. At this point, the Java program should finish executing, and print out\n either a list of products that it found, or a message that there were no\n products in your account. If you get an error such as \"User cannot access\n account 1234567890\", it's most likely because you have not set up the\n service account user as an authorized user in Manufacturer Center. From the\n API's standpoint, the API Console project sent a request on\n behalf of a user who was not on the list of authorized Manufacturer Center\n administrators, so it would, of course, reject that request.\n\n8. You can experiment with running `ProductsListSample` as many times as you\n want, since it is a read-only request. You can also explore the other\n samples that we've created for both Java and .NET."]]