Google Business Performance API memiliki metode API
BARU yang memungkinkan pengambilan beberapa `DailyMetrics` dalam satu permintaan API.
Tinjau
jadwal penghentian dan petunjuk untuk bermigrasi dari metode API reportInsights v4 ke Google Business Profile Performance API.
Mengelola notifikasi real-time
Tetap teratur dengan koleksi
Simpan dan kategorikan konten berdasarkan preferensi Anda.
Di My Business Notifications API, notifikasi dipublikasikan di layanan Cloud Pub/Sub. Setelah
menyiapkan Cloud Pub/Sub dan membuat topik, Anda dapat melakukan tindakan
berikut pada notifikasi:
Ulasan dan tanya jawab terkini atau yang diperbarui, media yang diupload,
update Google untuk ulasan, perubahan status lokasi, dan lainnya didukung.
Objek NotificationType
mendeskripsikan dan menampilkan daftar jenis notifikasi yang tersedia.
Sebelum memulai
Untuk menggunakan My Business Notifications API, daftarkan aplikasi Anda dan dapatkan kredensial OAuth 2.0. Untuk mengetahui detail cara mulai menggunakan API,
lihat Penyiapan dasar.
Penyiapan Cloud Pub/Sub
Untuk menyiapkan notifikasi API dengan Cloud Pub/Sub, lakukan langkah-langkah berikut:
- Ikuti panduan Cloud Pub/Sub untuk
menyiapkan aplikasi Anda.
- Buat topik
di project Cloud Pub/Sub dan catat nama topik yang dibuat.
- Berikan setidaknya izin
pubsub.topics.publish
untuk mybusiness-api-pubsub@system.gserviceaccount.com.
- Ikuti panduan Ringkasan pelanggan
untuk menyiapkan notifikasi push atau pull.
- Untuk menerima notifikasi, panggil endpoint
accounts.updateNotificationSetting
di My Business Notifications API. Pada panggilan, gunakan nama topik
yang Anda buat di Cloud Pub/Sub untuk menautkan akun Profil Bisnis Anda ke topik tersebut.
- (Opsional) Ulangi langkah 5 untuk setiap akun Profil Bisnis yang
notifikasinya ingin Anda terima.
Mengambil setelan notifikasi
Endpoint accounts.getNotificationSetting
menampilkan setelan notifikasi Cloud Pub/Sub saat ini untuk
akun. Tabel berikut menunjukkan cara memanggilnya:
GET
https://mybusinessnotifications.googleapis.com/v1/accounts/{accountId}/notificationSetting
Mengubah setelan notifikasi
Endpoint accounts.updateNotificationSetting
memperbarui setelan notifikasi Cloud Pub/Sub yang terkait dengan
akun. Tabel berikut menunjukkan cara memanggilnya:
PATCH
https://mybusinessnotifications.googleapis.com/v1/accounts/{accountId}/notificationSetting?updateMask={commaSeparatedFieldsToUpdate}
{
pubsubTopic: your/pubsub/topicName
}
Menghapus setelan notifikasi
Memanggil accounts.updateNotificationSetting
dengan pubsubTopic
kosong akan menghapus setelan notifikasi Cloud Pub/Sub dari akun.
Tabel berikut menunjukkan cara memanggilnya:
PATCH
https://mybusinessnotifications.googleapis.com/v1/accounts/{accountId}/notificationSetting?updateMask=pubsubTopic
Kecuali dinyatakan lain, konten di halaman ini dilisensikan berdasarkan Lisensi Creative Commons Attribution 4.0, sedangkan contoh kode dilisensikan berdasarkan Lisensi Apache 2.0. Untuk mengetahui informasi selengkapnya, lihat Kebijakan Situs Google Developers. Java adalah merek dagang terdaftar dari Oracle dan/atau afiliasinya.
Terakhir diperbarui pada 2025-08-29 UTC.
[null,null,["Terakhir diperbarui pada 2025-08-29 UTC."],[[["\u003cp\u003eThe My Business Notifications API uses Cloud Pub/Sub to deliver notifications about various business events, such as new reviews, Q&As, and location updates.\u003c/p\u003e\n"],["\u003cp\u003eTo receive notifications, you must set up a Cloud Pub/Sub topic, grant necessary permissions, and link your Business Profile account to the topic using the API.\u003c/p\u003e\n"],["\u003cp\u003eYou can manage your notification settings using the API to retrieve, update (including setting a new topic or deleting the setting), or delete them.\u003c/p\u003e\n"],["\u003cp\u003eThe API provides endpoints for retrieving, updating, and deleting notification settings associated with your Business Profile account.\u003c/p\u003e\n"],["\u003cp\u003eRefer to the provided links for detailed instructions on setting up Cloud Pub/Sub and using the My Business Notifications API.\u003c/p\u003e\n"]]],[],null,["# Manage real-time notifications\n\n\u003cbr /\u003e\n\nIn the My Business Notifications API, notifications are published in\nthe [Cloud Pub/Sub](https://cloud.google.com/pubsub/) service. After\nyou set up Cloud Pub/Sub and create a topic, you can perform the following\noperations on notifications:\n\n- [Retrieve notification settings.](#retrieve_notification_settings)\n- [Update notification settings.](#update_notification_settings)\n- [Delete notification settings.](#delete_notification_settings)\n\nNew or updated reviews, questions and answers, media uploads,\nGoogle updates for review, location state changes, and more are supported.\nThe [NotificationType](/my-business/reference/notifications/rest/v1/NotificationSetting#NotificationType) object\nlists and describes the available notification types.\n\nBefore you begin\n----------------\n\nTo use the My Business Notifications API, register your application and obtain\nOAuth 2.0 credentials. For details on how to get started with the API,\nsee [Basic setup](/my-business/content/basic-setup).\n\nCloud Pub/Sub setup\n-------------------\n\nTo set up API notifications with\n[Cloud Pub/Sub](https://cloud.google.com/pubsub/), perform the following steps:\n\n1. Follow the Cloud Pub/Sub guide to [set up your application](https://cloud.google.com/pubsub/docs/quickstart-client-libraries).\n2. [Create a topic](https://cloud.google.com/pubsub/docs/admin#create_a_topic) in your Cloud Pub/Sub project and note the name of the created topic.\n3. Give at least [`pubsub.topics.publish`](https://cloud.google.com/pubsub/docs/access-control#tbl_roles) permissions to mybusiness-api-pubsub@system.gserviceaccount.com.\n4. Follow the [Subscriber overview](https://cloud.google.com/pubsub/docs/subscriber) guide to set up either push or pull notifications.\n5. To receive notifications, call the [`accounts.updateNotificationSetting`](/my-business/reference/notifications/rest/v1/accounts/updateNotificationSetting) endpoint in the My Business Notifications API. In the call, use the topic name you created in Cloud Pub/Sub to link your Business Profile account to the topic.\n6. (Optional) Repeat step 5 for each Business Profile account that you want to receive notifications for.\n\nRetrieve notification settings\n------------------------------\n\nThe [`accounts.getNotificationSetting`](/my-business/reference/notifications/rest/v1/accounts/getNotificationSetting)\nendpoint returns the current Cloud Pub/Sub notification settings for an\naccount. The following table shows how to call it:\nHTTP \n\n```\nGET\nhttps://mybusinessnotifications.googleapis.com/v1/accounts/{accountId}/notificationSetting\n```\n\nUpdate notification settings\n----------------------------\n\nThe [`accounts.updateNotificationSetting`](/my-business/reference/notifications/rest/v1/accounts/updateNotificationSetting)\nendpoint updates the Cloud Pub/Sub notification settings associated with an\naccount. The following table shows how to call it:\nHTTP \n\n```\nPATCH\nhttps://mybusinessnotifications.googleapis.com/v1/accounts/{accountId}/notificationSetting?updateMask={commaSeparatedFieldsToUpdate}\n\n{\n pubsubTopic: your/pubsub/topicName\n}\n```\n\nDelete notification settings\n----------------------------\n\nCalling the [`accounts.updateNotificationSetting`](/my-business/reference/notifications/rest/v1/accounts/updateNotificationSetting)\nwith an empty `pubsubTopic` deletes the Cloud Pub/Sub notification settings from an account.\nThe following table shows how to call it:\nHTTP \n\n```\nPATCH\nhttps://mybusinessnotifications.googleapis.com/v1/accounts/{accountId}/notificationSetting?updateMask=pubsubTopic\n```"]]