संग्रह की मदद से व्यवस्थित रहें
अपनी प्राथमिकताओं के आधार पर, कॉन्टेंट को सेव करें और कैटगरी में बांटें.
जब आपका ऐप्लिकेशन निजी डेटा को ऐक्सेस करने का अनुरोध करता है, तब इस अनुरोध की अनुमति किसी ऐसे उपयोगकर्ता को देनी चाहिए जिसके पास डेटा का ऐक्सेस हो.
जब आपका ऐप्लिकेशन सार्वजनिक डेटा को ऐक्सेस करने का अनुरोध करता है, तो अनुरोध को अनुमति देने की ज़रूरत नहीं होती. हालांकि, अनुरोध के साथ एपीआई पासकोड जैसे आइडेंटिफ़ायर की ज़रूरत होती है.
आपका ऐप्लिकेशन, Google Play EMM API को जो अनुरोध भेजता है उसमें अनुमति वाला टोकन शामिल होना चाहिए. इस टोकन से Google आपके ऐप्लिकेशन की पहचान भी करता है.
अनुमति देने के प्रोटोकॉल के बारे में जानकारी
अनुरोधों को अनुमति देने के लिए, आपके ऐप्लिकेशन में OAuth 2.0 का इस्तेमाल किया जाना चाहिए. अनुमति देने वाले दूसरे प्रोटोकॉल इस्तेमाल नहीं किए जा सकते. अगर आपका ऐप्लिकेशन Google से साइन इन करने की सुविधा इस्तेमाल करता है, तो अनुमति देने से जुड़े कुछ पहलुओं को Google आपके लिए खुद मैनेज करता है.
OAuth 2.0 से अनुरोधों को अनुमति देना
Google Play EMM API के सभी अनुरोधों को, पुष्टि किए गए किसी उपयोगकर्ता ने अनुमति दी हो.
OAuth 2.0 के लिए अनुमति देने की प्रक्रिया या "तरीका" अलग-अलग हो सकता है. यह इस बात पर निर्भर करता है कि ऐप्लिकेशन किस तरह का है. सभी तरह के ऐप्लिकेशन के लिए नीचे दी गई सामान्य प्रक्रिया लागू होती है:
ऐप्लिकेशन बनाने के बाद, उसे Google API (एपीआई) कंसोल का इस्तेमाल करके, रजिस्टर किया जाता है. इसके बाद, Google आपको क्लाइंट आईडी और क्लाइंट सीक्रेट जैसी जानकारी देगा.
Google API कंसोल में Google Play EMM API चालू करें. (अगर एपीआई को 'API कंसोल' की सूची में नहीं जोड़ा गया है, तो यह चरण छोड़ दें.)
जब आपके ऐप्लिकेशन को उपयोगकर्ता के डेटा को ऐक्सेस करने की ज़रूरत होती है, तब वह Google से, डेटा के खास लिंक का अनुरोध करता है.
Google, उपयोगकर्ता को सहमति वाली स्क्रीन दिखाता है, जिसमें उनसे आपके ऐप्लिकेशन को उनके कुछ डेटा को ऐक्सेस करने की अनुमति मांगी जाती है.
अगर उपयोगकर्ता इसकी अनुमति दे देता है, तो Google आपके ऐप्लिकेशन को कुछ समय के लिए इस्तेमाल किए जा सकने वाला ऐक्सेस टोकन देता है.
आपका ऐप्लिकेशन, ऐक्सेस टोकन से उपयोगकर्ता के डेटा को ऐक्सेस करने का अनुरोध करता है.
अगर Google को पता चलता है कि आपका अनुरोध और टोकन मान्य है, तो वह आपके ऐप्लिकेशन को अनुरोध किए गए डेटा का ऐक्सेस दे देता है.
कुछ तरीकों में दूसरे चरण भी शामिल हो सकते हैं, जैसे कि रिफ़्रेश टोकन इस्तेमाल करके, नया ऐक्सेस टोकन पाना. अलग-अलग तरह के ऐप्लिकेशन के लिए डेटा ऐक्सेस करने के तरीकों के बारे में ज़्यादा जानकारी पाने के लिए, Google का OAuth 2.0 दस्तावेज़ पढ़ें.
Google Play ईएमएम एपीआई के लिए, OAuth 2.0 के दायरे की जानकारी यहां दी गई है:
https://www.googleapis.com/auth/androidenterprise
OAuth 2.0 का इस्तेमाल करके, डेटा ऐक्सेस करने का अनुरोध करने के लिए, आपके ऐप्लिकेशन को अनुरोध के तरीके की जानकारी देनी होगी. साथ ही, वह जानकारी भी देनी होगी जो आपको ऐप्लिकेशन रजिस्टर करते समय, Google से मिली थी, जैसे कि क्लाइंट आईडी और क्लाइंट सीक्रेट.
[[["समझने में आसान है","easyToUnderstand","thumb-up"],["मेरी समस्या हल हो गई","solvedMyProblem","thumb-up"],["अन्य","otherUp","thumb-up"]],[["वह जानकारी मौजूद नहीं है जो मुझे चाहिए","missingTheInformationINeed","thumb-down"],["बहुत मुश्किल है / बहुत सारे चरण हैं","tooComplicatedTooManySteps","thumb-down"],["पुराना","outOfDate","thumb-down"],["अनुवाद से जुड़ी समस्या","translationIssue","thumb-down"],["सैंपल / कोड से जुड़ी समस्या","samplesCodeIssue","thumb-down"],["अन्य","otherDown","thumb-down"]],["आखिरी बार 2025-05-08 (UTC) को अपडेट किया गया."],[[["\u003cp\u003eRequests for private data require authorization from an authenticated user with access, while public data requests need an identifier like an API key but no authorization.\u003c/p\u003e\n"],["\u003cp\u003eAll requests to the Google Play EMM API must include an OAuth 2.0 authorization token for authentication and application identification.\u003c/p\u003e\n"],["\u003cp\u003eApplications must use OAuth 2.0 for authorization, involving registration, API activation, scope definition, user consent, and access token acquisition.\u003c/p\u003e\n"],["\u003cp\u003eThe OAuth 2.0 scope for the Google Play EMM API is \u003ccode\u003ehttps://www.googleapis.com/auth/androidenterprise\u003c/code\u003e, and applications need this scope along with registration information like client ID and secret for access.\u003c/p\u003e\n"]]],[],null,["# Authorize Requests\n\nWhen your application requests private data, the request must be authorized by an authenticated user who has access to that data.\n\nWhen your application requests public data, the request doesn't need to be authorized, but does need to be accompanied by an identifier, such as an API key.\n\nEvery request your application sends to the Google Play EMM API must include an authorization token. The token also identifies your application to Google.\n\nAbout authorization protocols\n-----------------------------\n\nYour application must use [OAuth 2.0](https://developers.google.com/identity/protocols/OAuth2) to authorize requests. No other authorization protocols are supported. If your application uses [Sign In With Google](https://developers.google.com/identity/gsi/web), some aspects of authorization are handled for you.\n\nAuthorizing requests with OAuth 2.0\n-----------------------------------\n\nAll requests to the Google Play EMM API must be authorized by an authenticated user.\n\nThe details of the authorization process, or \"flow,\" for OAuth 2.0 vary somewhat depending on what kind of application you're writing. The following general process applies to all application types:\n\n1. When you create your application, you register it using the [Google API Console](https://console.cloud.google.com/). Google then provides information you'll need later, such as a client ID and a client secret.\n2. Activate the Google Play EMM API in the Google API Console. (If the API isn't listed in the API Console, then skip this step.)\n3. When your application needs access to user data, it asks Google for a particular **scope** of access.\n4. Google displays a **consent screen** to the user, asking them to authorize your application to request some of their data.\n5. If the user approves, then Google gives your application a short-lived **access token**.\n6. Your application requests user data, attaching the access token to the request.\n7. If Google determines that your request and the token are valid, it returns the requested data.\n\nSome flows include additional steps, such as using **refresh tokens** to acquire new access tokens. For detailed information about flows for various types of applications, see Google's [OAuth 2.0 documentation](https://developers.google.com/identity/protocols/OAuth2).\n\nHere's the OAuth 2.0 scope information for the Google Play EMM API: \n\n```\nhttps://www.googleapis.com/auth/androidenterprise\n```\n\nTo request access using OAuth 2.0, your application needs the scope information, as well as\ninformation that Google supplies when you register your application (such as the client ID and the\nclient secret)."]]