আপনি Google Photos Library API-এর জন্য লিগ্যাসি ডকুমেন্টেশন দেখছেন।
REST দিয়ে শুরু করুন
সেভ করা পৃষ্ঠা গুছিয়ে রাখতে 'সংগ্রহ' ব্যবহার করুন
আপনার পছন্দ অনুযায়ী কন্টেন্ট সেভ করুন ও সঠিক বিভাগে রাখুন।
Google ফটো লাইব্রেরি API ব্যবহার শুরু করতে, Google API কনসোলের মাধ্যমে API সক্ষম করে এবং একটি OAuth 2.0 ক্লায়েন্ট আইডি সেট আপ করে আপনার প্রকল্প কনফিগার করুন৷
আপনার অ্যাপ্লিকেশানটি Google Photos ব্যবহারকারীর হয়ে Google Photos-এর সাথে ইন্টারঅ্যাক্ট করে৷ উদাহরণস্বরূপ, আপনি যখন কোনো ব্যবহারকারীর Google Photos লাইব্রেরিতে অ্যালবাম তৈরি করেন বা কোনো ব্যবহারকারীর Google Photos অ্যাকাউন্টে মিডিয়া আইটেম আপলোড করেন, তখন ব্যবহারকারী OAuth 2.0 প্রোটোকলের মাধ্যমে এই API অনুরোধগুলি অনুমোদন করে।
OAuth 2.0 ক্লায়েন্ট আইডি আপনার অ্যাপ্লিকেশন ব্যবহারকারীদের সাইন ইন, প্রমাণীকরণ এবং এর মাধ্যমে লাইব্রেরি API ব্যবহার করার অনুমতি দেয়। লাইব্রেরি API পরিষেবা অ্যাকাউন্ট সমর্থন করে না; এই API ব্যবহার করতে, ব্যবহারকারীদের অবশ্যই একটি বৈধ Google অ্যাকাউন্টে সাইন ইন করতে হবে৷
API সক্ষম করুন
আপনি লাইব্রেরি API ব্যবহার করার আগে, আপনাকে অবশ্যই আপনার প্রকল্পের জন্য এটি সক্ষম করতে হবে৷
- Google API কনসোলে যান।
- মেনু বার থেকে, একটি প্রকল্প নির্বাচন করুন বা একটি নতুন প্রকল্প তৈরি করুন৷
- Google API লাইব্রেরি খুলতে, নেভিগেশন মেনু থেকে, APIs & Services > Library নির্বাচন করুন।
- "Google Photos Library API" অনুসন্ধান করুন। সঠিক ফলাফল নির্বাচন করুন এবং সক্রিয় ক্লিক করুন।
একটি OAuth 2.0 ক্লায়েন্ট আইডি অনুরোধ করুন
একটি OAuth ক্লায়েন্ট আইডি অনুরোধ করতে এবং আপনার অ্যাপ্লিকেশনের জন্য এটি কনফিগার করতে নীচের পদক্ষেপগুলি অনুসরণ করুন৷ এই উদাহরণটি এমন একটি অ্যাপ্লিকেশন ব্যবহার করে যেখানে সমগ্র OAuth প্রবাহ সার্ভার-সাইড পরিচালনা করা হয়, যেমন আমাদের নমুনাগুলির মধ্যে একটি। অন্যান্য বাস্তবায়ন পরিস্থিতির জন্য সেটআপ প্রক্রিয়া পরিবর্তিত হতে পারে।
- Google API কনসোলে যান এবং আপনার প্রকল্প নির্বাচন করুন।
- মেনু থেকে, APIs & Services > Credentials নির্বাচন করুন।
- শংসাপত্র পৃষ্ঠায়, শংসাপত্র তৈরি করুন > OAuth ক্লায়েন্ট আইডি ক্লিক করুন।
- আপনার আবেদনের ধরন নির্বাচন করুন। এই উদাহরণে, অ্যাপ্লিকেশনের ধরন হল ওয়েব অ্যাপ্লিকেশন ।
যেখান থেকে আপনার অ্যাপকে Google API গুলি অ্যাক্সেস করার অনুমতি দেওয়া হয়েছে তা নিম্নরূপ নিবন্ধন করুন:
- ক্লায়েন্ট আইডি সনাক্ত করতে, একটি নাম লিখুন।
অনুমোদিত জাভাস্ক্রিপ্ট অরিজিন ফিল্ডে, আপনার অ্যাপের মূল লিখুন। এই ক্ষেত্রটি ওয়াইল্ডকার্ডের অনুমতি দেয় না।
আপনার অ্যাপটিকে বিভিন্ন প্রোটোকল, ডোমেন বা সাবডোমেনে চালানোর অনুমতি দিতে আপনি একাধিক অরিজিন লিখতে পারেন। আপনি যে URLগুলি লিখছেন সেগুলিকে একটি OAuth অনুরোধ শুরু করার অনুমতি দেওয়া হয়েছে৷
নিম্নলিখিত উদাহরণ একটি স্থানীয় উন্নয়ন URL (আমাদের নমুনা localhost:8080
) এবং একটি উত্পাদন URL দেখায়।
http://localhost:8080
https://myproductionurl.example.com
অনুমোদিত পুনঃনির্দেশ URI ক্ষেত্র হল শেষ পয়েন্ট যা OAuth 2.0 সার্ভার থেকে প্রতিক্রিয়া গ্রহণ করে। সাধারণত, এটি আপনার বিকাশের পরিবেশকে অন্তর্ভুক্ত করে এবং আপনার অ্যাপ্লিকেশনে একটি পথ নির্দেশ করে।
http://localhost:8080/auth/google/callback
https://myproductionurl.example.com/auth/google/callback
তৈরি করুন ক্লিক করুন।
ফলে OAuth ক্লায়েন্ট ডায়ালগ থেকে, নিম্নলিখিত অনুলিপি করুন:
- ক্লায়েন্ট আইডি
- ক্লায়েন্ট গোপন
আপনার অ্যাপ এই মানগুলি ব্যবহার করে সক্রিয় Google APIগুলি অ্যাক্সেস করতে পারে৷
আপনি লাইব্রেরি API অ্যাক্সেস করে এমন একটি সর্বজনীন অ্যাপ্লিকেশন চালু করার আগে, আপনার অ্যাপটি অবশ্যই Google দ্বারা পর্যালোচনা করা উচিত। আপনি যখন আপনার আবেদন পরীক্ষা করেন তখন একটি "অযাচাই করা অ্যাপ" বার্তাটি স্ক্রিনে উপস্থিত হয়, যতক্ষণ না এটি যাচাই করা হয়৷
নমুনা চেষ্টা করুন
এখন আপনি লাইব্রেরি API এর সাথে ব্যবহারের জন্য আপনার প্রকল্পটি কনফিগার করেছেন, GitHub-এ নমুনা অ্যাপটি দেখুন। নমুনা অ্যাপটি দেখায় কিভাবে আপনি লাইব্রেরি API ব্যবহার করে একটি স্মার্ট ফটো ফ্রেম তৈরি করতে পারেন।
অন্য কিছু উল্লেখ না করা থাকলে, এই পৃষ্ঠার কন্টেন্ট Creative Commons Attribution 4.0 License-এর অধীনে এবং কোডের নমুনাগুলি Apache 2.0 License-এর অধীনে লাইসেন্স প্রাপ্ত। আরও জানতে, Google Developers সাইট নীতি দেখুন। Java হল Oracle এবং/অথবা তার অ্যাফিলিয়েট সংস্থার রেজিস্টার্ড ট্রেডমার্ক।
2025-08-29 UTC-তে শেষবার আপডেট করা হয়েছে।
[null,null,["2025-08-29 UTC-তে শেষবার আপডেট করা হয়েছে।"],[[["\u003cp\u003eTo use the Google Photos Library API, you must enable the API and set up an OAuth 2.0 client ID through the Google API Console.\u003c/p\u003e\n"],["\u003cp\u003eUsers must be signed in to a valid Google Account to use the Library API as it requires user authorization via OAuth 2.0 for actions like creating albums or uploading media.\u003c/p\u003e\n"],["\u003cp\u003eBefore launching publicly, your application needs to be reviewed and verified by Google to remove the "Unverified app" message during testing.\u003c/p\u003e\n"]]],["To utilize the Google Photos Library API, first enable it for your project in the Google API Console. Then, create an OAuth 2.0 client ID, specifying the application type, authorized JavaScript origins, and redirect URIs. Obtain the client ID and secret from the resulting dialog. Ensure your application is reviewed by Google before public launch. Note, only valid Google Account users can use this API as service accounts aren't supported.\n"],null,["# Get started with REST\n\nTo start using the Google Photos Library API, configure your project by enabling the API via\nthe Google API Console and setting up an OAuth 2.0 client ID.\n\nYour application interacts with Google Photos on behalf of a\nGoogle Photos user. For instance, when you create albums in a user's\nGoogle Photos library or upload media items to a user's\nGoogle Photos account, the user authorizes these API requests via the\n[OAuth 2.0](/identity/protocols/OAuth2) protocol.\n\nThe OAuth 2.0 client ID allows your application users to sign in, authenticate,\nand thereby use the Library API. The Library API does not support\nservice accounts; to use this API, users must be signed in to a valid Google\nAccount.\n\nConfigure your app\n------------------\n\n### Enable the API\n\nBefore you can use the Library API, you must enable it for your project.\n\n1. Go to the [Google API Console](https://console.developers.google.com/apis/library).\n2. From the menu bar, select a project or create a new project.\n3. To open the Google API Library, from the Navigation menu, select **APIs \\& Services \\\u003e Library**.\n4. Search for \"Google Photos Library API\". Select the correct result and click **Enable**.\n\n### Request an OAuth 2.0 client ID\n\nFollow the steps below to request an OAuth client ID and configure it for your\napplication. This example uses an application where the entire OAuth flow is\nhandled server-side, such as the one in our samples. The setup process may vary\nfor other [implementation scenarios](/identity/protocols/OAuth2).\n\n1. Go to the [Google API Console](https://console.developers.google.com/apis/library) and select your project.\n2. From the menu, select **APIs \\& Services \\\u003e Credentials**.\n3. On the **Credentials** page, click **Create Credentials \\\u003e OAuth client ID**.\n4. Select your **Application type** . In this example, the application type is **Web application**.\n5. Register the origins from which your app is allowed to access the Google APIs\n as follows:\n\n 1. To identify the client ID, enter a name.\n 2. In the **Authorized JavaScript origins** field, enter the origin for your\n app. This field doesn't allow wildcards.\n\n You can enter multiple origins to allow your app to run on different\n protocols, domains, or subdomains. The URLs you enter are allowed to\n start an OAuth request.\n\n The following example shows a local development URL (our samples use\n `localhost:8080`) and a production URL. \n\n http://localhost:8080\n https://myproductionurl.example.com\n\n 3. The **Authorized redirect URI** field is the endpoint that receives\n responses from the OAuth 2.0 server. Typically, this includes your\n development environment and points to a path in your application.\n\n http://localhost:8080/auth/google/callback\n https://myproductionurl.example.com/auth/google/callback\n\n 4. Click **Create**.\n\n\u003c!-- --\u003e\n\n6. From the resulting OAuth client dialog, copy the following:\n\n - Client ID\n - Client secret\n\n Your app can access the enabled Google APIs using these values.\n\nBefore you can launch a public application that accesses the Library API,\nyour app must be reviewed by Google. An \"Unverified app\" message appears on the\nscreen when you test your application, until it is\n[verified](https://support.google.com/cloud/answer/7454865).\n\nTry out the sample\n------------------\n\nNow that you've configured your project for use with the Library API,\ncheck out the [sample app](/photos/library/samples) on GitHub. The sample app\ndemonstrates how you can build a smart photo frame using the Library API."]]