সেভ করা পৃষ্ঠা গুছিয়ে রাখতে 'সংগ্রহ' ব্যবহার করুন
আপনার পছন্দ অনুযায়ী কন্টেন্ট সেভ করুন ও সঠিক বিভাগে রাখুন।
কুইকস্টার্ট ব্যাখ্যা করে যে কীভাবে একটি অ্যাপ সেট আপ করতে হয় এবং চালাতে হয় যেটি একটি Google Workspace API কল করে। এই কুইকস্টার্ট একটি সরলীকৃত প্রমাণীকরণ পদ্ধতি ব্যবহার করে যা একটি পরীক্ষার পরিবেশের জন্য উপযুক্ত। একটি উত্পাদন পরিবেশের জন্য, আমরা আপনার অ্যাপের জন্য উপযুক্ত অ্যাক্সেসের শংসাপত্রগুলি বেছে নেওয়ার আগে প্রমাণীকরণ এবং অনুমোদন সম্পর্কে শেখার পরামর্শ দিই৷
একজন Google Workspace অ্যাডমিনিস্ট্রেটর হিসেবে, আপনি আপনার ডোমেনকে প্রভাবিত করে এমন সমস্যার জন্য সতর্কতা অ্যাক্সেস করতে Alert Center API ব্যবহার করতে পারেন।
Google API ব্যবহার করার আগে, আপনাকে একটি Google ক্লাউড প্রকল্পে সেগুলি চালু করতে হবে। আপনি একটি একক Google ক্লাউড প্রকল্পে এক বা একাধিক API চালু করতে পারেন৷
Google ক্লাউড কনসোলে, সতর্কতা কেন্দ্র API চালু করুন।
একটি পরিষেবা অ্যাকাউন্ট হল একটি বিশেষ ধরনের অ্যাকাউন্ট যা কোনো ব্যক্তির পরিবর্তে একটি অ্যাপ্লিকেশন দ্বারা ব্যবহৃত হয়। আপনি ডেটা অ্যাক্সেস করতে বা রোবট অ্যাকাউন্টের মাধ্যমে ক্রিয়া সম্পাদন করতে বা Google Workspace বা Cloud Identity ব্যবহারকারীদের হয়ে ডেটা অ্যাক্সেস করতে একটি পরিষেবা অ্যাকাউন্ট ব্যবহার করতে পারেন। আরও তথ্যের জন্য, পরিষেবা অ্যাকাউন্ট বোঝার দেখুন।
আপনাকে একটি পাবলিক/প্রাইভেট কী জোড়া আকারে শংসাপত্র প্রাপ্ত করতে হবে। এই শংসাপত্রগুলি আপনার কোড দ্বারা আপনার অ্যাপের মধ্যে পরিষেবা অ্যাকাউন্ট ক্রিয়াগুলি অনুমোদন করতে ব্যবহার করা হয়৷
Google ক্লাউড কনসোলে, মেনু menu>IAM & Admin>Service Accounts- এ যান।
আপনার নতুন পাবলিক/প্রাইভেট কী জোড়া তৈরি করা হয়েছে এবং একটি নতুন ফাইল হিসেবে আপনার মেশিনে ডাউনলোড করা হয়েছে। ডাউনলোড করা JSON ফাইলটিকে আপনার কাজের ডিরেক্টরিতে credentials.json হিসাবে সংরক্ষণ করুন। এই ফাইলটি এই কীটির একমাত্র অনুলিপি। কীভাবে আপনার কী নিরাপদে সংরক্ষণ করবেন সে সম্পর্কে তথ্যের জন্য, পরিষেবা অ্যাকাউন্ট কীগুলি পরিচালনা করা দেখুন।
InputStreamin=AdminSDKAlertCenterQuickstart.class.getResourceAsStream(CREDENTIALS_FILE_PATH);if(in==null){thrownewFileNotFoundException("Resource not found: "+CREDENTIALS_FILE_PATH);}GoogleCredentialscredentials=ServiceAccountCredentials.fromStream(in).createDelegated(delegatedAdminEmail).createScoped(SCOPES);
[null,null,["2025-08-21 UTC-তে শেষবার আপডেট করা হয়েছে।"],[],[],null,["# Java quickstart\n\nQuickstarts explain how to set up and run an app that calls a\nGoogle Workspace API. This quickstart uses a\nsimplified authentication approach that is appropriate for a testing\nenvironment. For a production environment, we recommend learning about\n[authentication and authorization](/workspace/guides/auth-overview)\nbefore\n[choosing the access credentials](/workspace/guides/create-credentials#choose_the_access_credential_that_is_right_for_you)\nthat are appropriate for your app.\n\nAs a Google Workspace administrator, you can use the Alert Center API to access\nalerts for issues affecting your domain.\n\nObjectives\n----------\n\n- Set up your environment.\n- Set up and run the sample.\n\nPrerequisites\n-------------\n\n- Java 1.8 or greater\n- [A Google Cloud project](/workspace/guides/create-project)\n- A Google Account\n\nSet up your environment\n-----------------------\n\n### Turn on the API\n\nBefore using Google APIs, you need to turn them on in a Google Cloud project. You can turn on one or more APIs in a single Google Cloud project.\n\n- In the Google Cloud console, turn on the Alert Center API.\n\n [Turn on the API](https://console.cloud.google.com/flows/enableapi?apiid=alertcenter.googleapis.com)\n\n### Create a service account\n\nA service account is a special kind of account used by an application, rather than a person. You can use a service account to access data or perform actions by the robot account, or to access data on behalf of Google Workspace or Cloud Identity users. For more information, see [Understanding service accounts](https://cloud.google.com/iam/docs/understanding-service-accounts).\n\n### Google Cloud console\n\n1. In the Google Cloud console, go to Menu menu \\\u003e **IAM \\& Admin** \\\u003e **Service Accounts** .\n\n [Go to Service Accounts](https://console.cloud.google.com/iam-admin/serviceaccounts)\n2. Click **Create service account**.\n3. Fill in the service account details, then click **Create and continue** . Note: By default, Google creates a unique service account ID. If you would like to change the ID, modify the ID in the service account ID field.\n4. Optional: Assign roles to your service account to grant access to your Google Cloud project's resources. For more details, refer to [Granting, changing, and revoking access to resources](https://cloud.google.com/iam/docs/granting-changing-revoking-access).\n5. Click **Continue**.\n6. Optional: Enter users or groups that can manage and perform actions with this service account. For more details, refer to [Managing service account impersonation](https://cloud.google.com/iam/docs/impersonating-service-accounts).\n7. Click **Done**. Make a note of the email address for the service account.\n\n### gcloud CLI\n\n1. Create the service account: \n\n gcloud iam service-accounts create \u003cvar translate=\"no\"\u003e\u003ccode translate=\"no\" dir=\"ltr\"\u003eSERVICE_ACCOUNT_NAME\u003c/code\u003e\u003c/var\u003e \\\n --display-name=\"\u003cvar translate=\"no\"\u003e\u003ccode translate=\"no\" dir=\"ltr\"\u003eSERVICE_ACCOUNT_NAME\u003c/code\u003e\u003c/var\u003e\"\n\n2. Optional: Assign roles to your service account to grant access to your Google Cloud project's resources. For more details, refer to [Granting, changing, and revoking access to resources](https://cloud.google.com/iam/docs/granting-changing-revoking-access).\n\n#### Create credentials for a service account\n\nYou need to obtain credentials in the form of a public/private key pair. These credentials are used by your code to authorize service account actions within your app.\n\n1. In the Google Cloud console, go to Menu menu \\\u003e **IAM \\& Admin** \\\u003e **Service Accounts** .\n\n [Go to Service Accounts](https://console.cloud.google.com/iam-admin/serviceaccounts)\n2. Select your service account.\n3. Click **Keys** \\\u003e **Add key** \\\u003e **Create new key**.\n4. Select **JSON** , then click **Create** .\n\n Your new public/private key pair is generated and downloaded to your\n machine as a new file. Save the downloaded JSON file as `credentials.json` in your\n working directory. This file is the only copy of this key. For information about how to store\n your key securely, see\n [Managing service account keys](https://cloud.google.com/iam/docs/best-practices-for-managing-service-account-keys).\n5. Click **Close**.\n\nSet up and run the sample\n-------------------------\n\n1. Get credentials:\n\n adminSDK/alertcenter/quickstart/src/main/java/AdminSDKAlertCenterQuickstart.java \n [View on GitHub](https://github.com/googleworkspace/java-samples/blob/main/adminSDK/alertcenter/quickstart/src/main/java/AdminSDKAlertCenterQuickstart.java) \n\n ```java\n InputStream in = AdminSDKAlertCenterQuickstart.class.getResourceAsStream(CREDENTIALS_FILE_PATH);\n if (in == null) {\n throw new FileNotFoundException(\"Resource not found: \" + CREDENTIALS_FILE_PATH);\n }\n GoogleCredentials credentials = ServiceAccountCredentials\n .fromStream(in)\n .createDelegated(delegatedAdminEmail)\n .createScoped(SCOPES);\n ```\n2. Create an instance of the client:\n\n adminSDK/alertcenter/quickstart/src/main/java/AdminSDKAlertCenterQuickstart.java \n [View on GitHub](https://github.com/googleworkspace/java-samples/blob/main/adminSDK/alertcenter/quickstart/src/main/java/AdminSDKAlertCenterQuickstart.java) \n\n ```java\n NetHttpTransport transport = GoogleNetHttpTransport.newTrustedTransport();\n AlertCenter service = new AlertCenter.Builder(transport, JSON_FACTORY,\n new HttpCredentialsAdapter(getCredentials(DELEGATED_ADMIN_EMAIL)))\n .setApplicationName(APPLICATION_NAME)\n .build();\n ```\n3. Display all alerts:\n\n adminSDK/alertcenter/quickstart/src/main/java/AdminSDKAlertCenterQuickstart.java \n [View on GitHub](https://github.com/googleworkspace/java-samples/blob/main/adminSDK/alertcenter/quickstart/src/main/java/AdminSDKAlertCenterQuickstart.java) \n\n ```java\n String pageToken = null;\n do {\n ListAlertsResponse listResponse = service.alerts().list().setPageToken(pageToken)\n .setPageSize(20).execute();\n if (listResponse.getAlerts() != null) {\n for (Alert alert : listResponse.getAlerts()) {\n System.out.println(alert);\n }\n }\n pageToken = listResponse.getNextPageToken();\n } while (pageToken != null);\n ```\n4. Provide feedback on a given alert:\n\n adminSDK/alertcenter/quickstart/src/main/java/AdminSDKAlertCenterQuickstart.java \n [View on GitHub](https://github.com/googleworkspace/java-samples/blob/main/adminSDK/alertcenter/quickstart/src/main/java/AdminSDKAlertCenterQuickstart.java) \n\n ```java\n AlertFeedback newFeedback = new AlertFeedback();\n newFeedback.setType(\"VERY_USEFUL\");\n AlertFeedback feedback = service.alerts().feedback().create(alertId, newFeedback).execute();\n System.out.println(feedback);\n ```"]]