با مجموعهها، منظم بمانید
ذخیره و طبقهبندی محتوا براساس اولویتهای شما.
Alert Center API به شما امکان می دهد هشدارهایی را که دامنه شما را تحت تأثیر قرار می دهند مدیریت کنید. هشدار یک هشدار درباره یک مشکل امنیتی بالقوه است که Google شناسایی کرده است. هشدارها شامل اطلاعات زیر است:
منبعی که هشدار از آن سرچشمه گرفته است.
نام هشدار
زمان وقوع این هشدار
داده های خاص مرتبط با این هشدار.
سرپرستان دامنه می توانند هشدارها را به صورت دستی از کنسول مدیریت Google مشاهده و مدیریت کنند. Alert Center API به برنامههایی که میسازید اجازه میدهد دادههای هشدار و بازخورد هشدار را بازیابی کنند. API همچنین می تواند بازخورد هشدار جدیدی برای هشدارهای موجود ایجاد کند.
به عنوان مثال، یک برنامه نظارتی میتواند از Alert Center API برای بازیابی جدیدترین هشدارها برای یک دامنه، اولویتبندی آنها و سپس اطلاع اعضای سازمان شما استفاده کند. پس از اینکه تیم شما به هشدار پاسخ داد، برنامه میتواند بر اساس یافتههای خود بازخوردی را به هشدار اضافه کند.
هنگامی که برنامه شما دارای یک پروژه Cloud است که پیش نیازها را برآورده می کند و به درستی مجاز است، می تواند درخواست های Alert Center API REST را ارائه دهد. هنگام استفاده از کتابخانه های مشتری موجود، ایجاد درخواست های API آسان تر است.
مثال زیر نحوه فهرست کردن هشدارهای موجود با استفاده از API را نشان میدهد:
جاوا
// First, authorize the API and create a client to make requests with.URLserviceAccountUrl=AuthUtils.class.getResource("/client_secret.json");GoogleCredentialscredentials=ServiceAccountCredentials.fromStream(serviceAccountUrl.openStream()).createDelegated("admin@xxxx.com").createScoped(Collections.singleton("https://www.googleapis.com/auth/apps.alerts"));ApacheHttpTransporttransport=newApacheHttpTransport();HttpCredentialsAdapteradapter=newHttpCredentialsAdapter(credentials);AlertCenteralertCenter=newAlertCenter.Builder(transport,newJacksonFactory(),adapter).setApplicationName("Alert Center client").build();// List alerts in pages, printing each alert discovered.StringpageToken=null;do{ListAlertsResponselistResponse=service.alerts().list().setPageToken(pageToken).setPageSize(20).execute();if(listResponse.getAlerts()!=null){for(Alertalert:listResponse.getAlerts()){System.out.println(alert);}}pageToken=listResponse.getNextPageToken();}while(pageToken!=null);
تاریخ آخرین بهروزرسانی 2025-08-29 بهوقت ساعت هماهنگ جهانی.
[null,null,["تاریخ آخرین بهروزرسانی 2025-08-29 بهوقت ساعت هماهنگ جهانی."],[],[],null,["# Overview\n\nThe Alert Center API lets you manage *alerts* affecting your domain.\nAn alert is a warning of a potential security issue that Google has detected.\nAlerts include the following information:\n\n- Source that the alert originated from.\n- Name of the alert.\n- Time this alert happened.\n- Specific data associated with this alert.\n\nDomain administrators can see and manage alerts manually from the\n[Google Admin console](https://support.google.com/a/topic/2413312). The\nAlert Center API lets apps you build retrieve alert data and alert feedback. The\nAPI can also create new alert feedback for existing alerts.\n\nFor example, a monitoring app could use the Alert Center API to retrieve the\nmost recent alerts for a domain, prioritize them, and then notify members\nof your organization. After your team responds to the alert, the app could then\nattach feedback to the alert based on their findings.\n\nUse Alert Center API\n--------------------\n\n| **Note:** The current version of this API (v1beta1) is available to all Google Workspace customers.\n\nBefore using the Alert Center API you need to set up\n[a new Cloud Platform project and enable Alert Center API](/workspace/admin/alertcenter/guides/prerequisites).\nYour project must use a [service account](/identity/protocols/OAuth2ServiceAccount)\nwhen accessing the API.\n\nOnce your app has a Cloud project that meets the prerequisites and is properly\n[authorized](/workspace/admin/alertcenter/guides/authorizing), it can make\nAlert Center API REST requests. Making API requests is easier when using the\navailable [client libraries](/workspace/admin/alertcenter/guides/libraries).\n\nThe following example shows how to list available alerts using the API: \n\n### Java\n\n```java\n// First, authorize the API and create a client to make requests with.\nURL serviceAccountUrl = AuthUtils.class.getResource(\"/client_secret.json\");\nGoogleCredentials credentials = ServiceAccountCredentials\n .fromStream(serviceAccountUrl.openStream())\n .createDelegated(\"admin@xxxx.com\")\n .createScoped(Collections.singleton(\"https://www.googleapis.com/auth/apps.alerts\"));\nApacheHttpTransport transport = new ApacheHttpTransport();\nHttpCredentialsAdapter adapter = new HttpCredentialsAdapter(credentials);\nAlertCenter alertCenter = new AlertCenter.Builder(transport, new JacksonFactory(), adapter)\n .setApplicationName(\"Alert Center client\")\n .build();\n\n// List alerts in pages, printing each alert discovered.\nString pageToken = null;\ndo {\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 \n```"]]