उपयोगकर्ता और ऐक्सेस मैनेजमेंट को माइग्रेट करना
संग्रह की मदद से व्यवस्थित रहें
अपनी प्राथमिकताओं के आधार पर, कॉन्टेंट को सेव करें और कैटगरी में बांटें.
Content API for Shopping में, उपयोगकर्ताओं और उनके ऐक्सेस के अधिकारों को मैनेज करने के लिए, Account
रिसोर्स में मौजूद फ़ील्ड का इस्तेमाल किया जाता था. Merchant API, इसे User
नाम के खास संसाधन और उससे जुड़े तरीकों (create, delete, get, list, path) से बदल देता है. ज़्यादा जानकारी के लिए, अपने खाते का ऐक्सेस कंट्रोल करना लेख पढ़ें.
मुख्य अंतर
Content API for Shopping की तुलना में, Merchant API से उपयोगकर्ता मैनेजमेंट के लिए ये फ़ायदे मिलते हैं:
- खास संसाधन: इससे यह कंट्रोल किया जा सकता है कि कौन आपके Merchant Center खाते को ऐक्सेस कर सकता है और वे क्या कर सकते हैं.
- RESTful संसाधन के नाम: Merchant API में,
User
संसाधनों की पहचान पूरे संसाधन के नाम से करें. उदाहरण के लिए, accounts/12345/users/example@example.com
.
me
उपनाम: पुष्टि किए गए उपयोगकर्ता को रेफ़र करने के लिए, संसाधन के नाम में ईमेल पते की जगह me
उपनाम का इस्तेमाल किया जा सकता है. उदाहरण के लिए, accounts/12345/users/me
.
- ऐक्सेस करने के अधिकार: Merchant API, Content API से बूलियन ऐक्सेस फ़ील्ड (उदाहरण के लिए,
admin
, reportingManager
) को एक साथ जोड़कर, access_rights
फ़ील्ड में शामिल करता है. इस फ़ील्ड को दोहराया जा सकता है.
- उपयोगकर्ता को न्योता भेजना और उसकी पुष्टि करना: Merchant API में उपयोगकर्ता की स्थिति (
PENDING
या VERIFIED
) के बारे में साफ़ तौर पर बताया गया है. नया उपयोगकर्ता बनाने पर, वह PENDING
स्थिति में होता है. ऐसा तब तक होता है, जब तक वह न्योता स्वीकार नहीं कर लेता. इससे एपीआई को उपयोगकर्ता की स्थिति के बारे में जानकारी मिलती है. यह जानकारी, Content API for Shopping में उपलब्ध नहीं थी.
## अनुरोध जोड़ें
Merchant API, उपयोगकर्ताओं को मैनेज करने के लिए इन अनुरोध यूआरएल का इस्तेमाल करता है:
GET /accounts/v1/accounts/{account}/users/{email}
GET /accounts/v1/accounts/{account}/users
POST /accounts/v1/accounts/{account}/users
PATCH /accounts/v1/accounts/{account}/users/{email}
DELETE /accounts/v1/accounts/{account}/users/{email}
इस टेबल में, Content API for Shopping और Merchant API के अनुरोध यूआरएल की तुलना की गई है.
अनुरोध का ब्यौरा |
Shopping के लिए Content API |
Merchant API |
किसी खाते के लिए उपयोगकर्ताओं की जानकारी पाना |
GET {api_version}/{merchantId}/accounts/{accountId} |
GET {api_version}/accounts/{account}/users |
उपयोगकर्ता बनाना |
PATCH {api_version}/{merchantId}/accounts/{accountId} |
POST {api_version}/accounts/{account}/users |
किसी उपयोगकर्ता की जानकारी अपडेट करना |
PATCH {api_version}/{merchantId}/accounts/{accountId} |
PATCH {api_version}/accounts/{account}/users/{email} |
उपयोगकर्ता को हटाना |
PATCH {api_version}/{merchantId}/accounts/{accountId} |
DELETE {api_version}/accounts/{account}/users/{email} |
आइडेंटिफ़ायर
इस टेबल में, Content API for Shopping और Merchant API के बीच किए गए अनुरोधों में इस्तेमाल किए गए आइडेंटिफ़ायर की तुलना की गई है.
आइडेंटिफ़ायर की जानकारी |
Shopping के लिए Content API |
Merchant API |
खाता आइडेंटिफ़ायर |
accountId |
accounts/{account} में account |
उपयोगकर्ता आइडेंटिफ़ायर |
AccountUser ऑब्जेक्ट में email_address |
accounts/{account}/users/{email} में email |
तरीके
यहां दी गई टेबल में, Content API for Shopping और Merchant API के तरीकों की तुलना की गई है.
Shopping के लिए Content API |
Merchant API |
उपलब्धता और नोट |
accounts.update |
users.create |
यह किसी खाते के लिए नया उपयोगकर्ता बनाता है. |
accounts.get |
users.get |
यह कुकी, किसी एक उपयोगकर्ता की जानकारी को फिर से हासिल करती है. |
accounts.get |
users.list |
यह किसी खाते के सभी उपयोगकर्ताओं की सूची बनाता है. |
accounts.update |
users.update |
यह कुकी, उपयोगकर्ता के ऐक्सेस के अधिकारों को अपडेट करती है. |
accounts.update |
users.delete |
इस तरीके का इस्तेमाल करके, किसी खाते से उपयोगकर्ता को मिटाया जा सकता है. |
फ़ील्ड में किए गए बदलावों की पूरी जानकारी
फ़ील्ड का इस्तेमाल करने के तरीके को इस तरह अपडेट करें:
Shopping के लिए Content API |
Merchant API |
ब्यौरा |
users (AccountUser को बार-बार दोहराया गया) |
users (User को बार-बार दोहराया गया) |
User संसाधन अब टॉप-लेवल का संसाधन है और इसकी अपनी सेवा है. |
AccountUser.email_address |
CreateUserRequest.user_id और User.name का हिस्सा |
उपयोगकर्ता का ईमेल पता अब संसाधन के नाम का हिस्सा है. इसे बनाते समय, user_id फ़ील्ड में डालें. |
AccountUser.admin |
access_rights: "ADMIN" |
Merchant API, बूलियन admin फ़ील्ड को access_rights enum में मौजूद ADMIN वैल्यू से बदल देता है. |
AccountUser.order_manager , AccountUser.payments_manager , AccountUser.payments_analyst |
access_rights: "STANDARD" |
Merchant API, इन भूमिकाओं को STANDARD ऐक्सेस के अधिकार से बदल देता है. |
AccountUser.reporting_manager |
access_rights: "PERFORMANCE_REPORTING" |
reporting_manager की भूमिका को अब PERFORMANCE_REPORTING ऐक्सेस करने का अधिकार कहा जाता है. |
AccountUser.read_only |
access_rights: "READ_ONLY" |
read_only की भूमिका को अब READ_ONLY ऐक्सेस करने का अधिकार कहा जाता है. |
उपलब्ध नहीं है |
User.name |
इसमें उपयोगकर्ता के संसाधन का पूरा नाम होता है. उदाहरण के लिए, accounts/{account}/users/{email} . |
उपलब्ध नहीं है |
User.state |
यह कुकी, ऐप्लिकेशन इस्तेमाल करने वाले व्यक्ति के न्योते की स्थिति दिखाती है. यह PENDING या VERIFIED में से कोई एक हो सकती है. |
जब तक कुछ अलग से न बताया जाए, तब तक इस पेज की सामग्री को Creative Commons Attribution 4.0 License के तहत और कोड के नमूनों को Apache 2.0 License के तहत लाइसेंस मिला है. ज़्यादा जानकारी के लिए, Google Developers साइट नीतियां देखें. Oracle और/या इससे जुड़ी हुई कंपनियों का, Java एक रजिस्टर किया हुआ ट्रेडमार्क है.
आखिरी बार 2025-08-08 (UTC) को अपडेट किया गया.
[null,null,["आखिरी बार 2025-08-08 (UTC) को अपडेट किया गया."],[],[],null,["# Migrate user and access management\n\nIn Content API for Shopping, you managed users and their access rights with a\nfield in the `Account` resource. Merchant API replaces this with the dedicated\nresource named\n[`User`](/merchant/api/reference/rest/accounts_v1/accounts.users) and\ncorresponding methods (create, delete, get, list, path). For more information,\nsee [Control access to your\naccount](/merchant/api/guides/accounts/control-access).\n\nKey differences\n---------------\n\nCompared to Content API for Shopping, Merchant API offers the following\nadvantages for user management:\n\n- **Dedicated resource**: This provides a more granular and direct way to control who can access your Merchant Center account and what they can do.\n- **RESTful resource names** : In Merchant API, identify `User` resources by a full resource name, for example, `accounts/12345/users/example@example.com`.\n- **`me` alias** : You can use the alias `me` in place of an email address in the resource name to refer to the authenticated user, for example, `accounts/12345/users/me`.\n- **Consolidated access rights** : Merchant API consolidates boolean access fields from Content API (for example, `admin`, `reportingManager`) into a single, repeatable`access_rights` field.\n- **User invitation and verification** : Merchant API introduces an explicit user state (`PENDING` or `VERIFIED`). When you create a new user, they are in a `PENDING` state until they accept the invitation. This provides API visibility into the user's status, which was not available in the Content API for Shopping. Add ## Requests\n\nMerchant API uses the following request URLs to manage users:\n\n- `GET /accounts/v1/accounts/{account}/users/{email}`\n- `GET /accounts/v1/accounts/{account}/users`\n- `POST /accounts/v1/accounts/{account}/users`\n- `PATCH /accounts/v1/accounts/{account}/users/{email}`\n- `DELETE /accounts/v1/accounts/{account}/users/{email}`\n\nThe following table compares the request URLs between the Content API for\nShopping and Merchant API.\n\n| Request description | Content API for Shopping | Merchant API |\n|--------------------------|---------------------------------------------------------|---------------------------------------------------------|\n| Get users for an account | `GET {api_version}/{merchantId}/accounts/{accountId}` | `GET {api_version}/accounts/{account}/users` |\n| Create a user | `PATCH {api_version}/{merchantId}/accounts/{accountId}` | `POST {api_version}/accounts/{account}/users` |\n| Update a user | `PATCH {api_version}/{merchantId}/accounts/{accountId}` | `PATCH {api_version}/accounts/{account}/users/{email}` |\n| Delete a user | `PATCH {api_version}/{merchantId}/accounts/{accountId}` | `DELETE {api_version}/accounts/{account}/users/{email}` |\n\nIdentifiers\n-----------\n\nThe following table compares the identifiers used in requests between the\nContent API for Shopping and Merchant API.\n\n| Identifier description | Content API for Shopping | Merchant API |\n|------------------------|-------------------------------------------------|-----------------------------------------------|\n| Account identifier | `accountId` | `account` in `accounts/{account}` |\n| User identifier | `email_address` within the `AccountUser` object | `email` in `accounts/{account}/users/{email}` |\n\nMethods\n-------\n\nThe following table compares the methods between the Content API for Shopping\nand Merchant API.\n\n| Content API for Shopping | Merchant API | Availability \\& notes |\n|--------------------------|----------------------------------------------------------------------------------|------------------------------------|\n| `accounts.update` | [`users.create`](/merchant/api/reference/rest/accounts_v1/accounts.users/create) | Creates a new user for an account. |\n| `accounts.get` | [`users.get`](/merchant/api/reference/rest/accounts_v1/accounts.users/get) | Retrieves a single user. |\n| `accounts.get` | [`users.list`](/merchant/api/reference/rest/accounts_v1/accounts.users/list) | Lists all users for an account. |\n| `accounts.update` | [`users.update`](/merchant/api/reference/rest/accounts_v1/accounts.users/update) | Updates a user's access rights. |\n| `accounts.update` | [`users.delete`](/merchant/api/reference/rest/accounts_v1/accounts.users/delete) | Deletes a user from an account. |\n\nDetailed field changes\n----------------------\n\nUpdate your use of fields as follows:\n\n| Content API for Shopping | Merchant API | Description |\n|---------------------------------------------------------------------------------------------|-----------------------------------------------------|---------------------------------------------------------------------------------------------------------------|\n| `users` (repeated `AccountUser`) | `users` (repeated `User`) | The `User` resource is now a top-level resource with its own service. |\n| `AccountUser.email_address` | `CreateUserRequest.user_id` and part of `User.name` | The user's email address is now part of the resource name. Specify it in the `user_id` field during creation. |\n| `AccountUser.admin` | `access_rights: \"ADMIN\"` | Merchant API replaces the boolean `admin` field by the `ADMIN` value in the `access_rights` enum. |\n| `AccountUser.order_manager`, `AccountUser.payments_manager`, `AccountUser.payments_analyst` | `access_rights: \"STANDARD\"` | Merchant API replaces these roles to `STANDARD` access right. |\n| `AccountUser.reporting_manager` | `access_rights: \"PERFORMANCE_REPORTING\"` | The `reporting_manager` role is now the `PERFORMANCE_REPORTING` access right. |\n| `AccountUser.read_only` | `access_rights: \"READ_ONLY\"` | The `read_only` role is now the `READ_ONLY` access right. |\n| Not available | `User.name` | Contains the full resource name of the user, for example, `accounts/{account}/users/{email}`. |\n| Not available | `User.state` | Indicates the status of the user's invitation, either `PENDING` or `VERIFIED`. |"]]