Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
Để cập nhật theo thời gian thực, bạn cần gửi yêu cầu đến Maps Booking API. API Đặt phòng trên Maps yêu cầu bạn xác thực các yêu cầu của mình thông qua OAuth 2.0 bằng một tài khoản dịch vụ GCP có quyền truy cập vào API và đã được phân bổ QPS cần thiết. Hướng dẫn này sẽ hướng dẫn bạn thực hiện các bước để:
Bạn có thể tạo dự án mới hoặc sử dụng dự án hiện có cho mục đích này.
Vui lòng ghi lại số dự án trên đám mây vì bạn sẽ cần số này trong các bước tiếp theo. Bạn cũng có thể tìm thấy số dự án trên đám mây trên Trang chủ của Google Cloud Platform. Số dự án trên đám mây luôn chỉ có chữ số.
Hoàn tất bước 1 trên trang Việc cần làm khi bắt đầu sử dụng của Cổng đối tác bằng cách gửi mã dự án trên đám mây và địa chỉ email của dự án trên đám mây (địa chỉ email dùng để quản trị dự án trên đám mây).
Chỉ định cho tài khoản dịch vụ mới vai trò phù hợp nhất với nhu cầu của ứng dụng.
Lựa chọn vai trò cho tài khoản dịch vụ sẽ không ảnh hưởng đến những lệnh gọi có thể thực hiện đến API Đặt phòng trên Google Maps, vì việc phân bổ đủ hạn mức để sử dụng các lệnh gọi này được xác định bằng mối liên kết của số dự án trong cấu hình Trung tâm hành động.
Nếu bạn không chắc nên chọn vai trò nào, hãy chọn Project (Dự án) > Viewer (Người xem).
Sau khi nhấp vào "tiếp tục" ở bước (6), bạn sẽ có lựa chọn tạo khoá JSON.
Lưu thông tin xác thực json. Hãy nhớ lưu trữ các tệp này ở nơi an toàn vì bạn sẽ không thể truy xuất các tệp này sau này.
Đăng nhập lại vào Cổng đối tác và hoàn tất các việc cần làm còn lại trên trang Việc cần làm khi bắt đầu của Cổng đối tác.
Có nhiều lý do khiến bạn có thể gặp vấn đề về việc uỷ quyền khi thực hiện yêu cầu Cập nhật theo thời gian thực. Nếu bạn cần hướng dẫn chung về cách thực hiện yêu cầu Cập nhật theo thời gian thực, hãy xem phần cập nhật API theo thời gian thực trong Hướng dẫn toàn diện về quảng cáo Dịch vụ địa phương. Bạn cũng có thể tìm thấy các ứng dụng mẫu bằng nhiều ngôn ngữ trong phần Mã mẫu.
Nếu bạn gặp lỗi 403, hãy kiểm tra để đảm bảo rằng bạn đang tuân thủ tất cả các yêu cầu sau:
[null,null,["Cập nhật lần gần đây nhất: 2025-07-26 UTC."],[[["\u003cp\u003eReal-time updates require using the Maps Booking API with OAuth 2.0 authentication via a GCP service account.\u003c/p\u003e\n"],["\u003cp\u003eYou need to set up a Google Cloud project, create a service account, and enable the Maps Booking API.\u003c/p\u003e\n"],["\u003cp\u003eCommon errors can arise from incorrect endpoint usage, authorization issues, or scope mismatches, requiring careful setup.\u003c/p\u003e\n"],["\u003cp\u003eDetailed troubleshooting information, including project details, service account, and request specifics, is crucial for resolving issues with Actions Center support.\u003c/p\u003e\n"]]],["To enable real-time updates via the Maps Booking API, authenticate requests using OAuth 2.0 with a GCP service account. This involves setting up a Google Cloud project, creating a service account with appropriate roles, and enabling the Maps Booking API. Use the project number in the Partner Portal. Save the JSON credentials securely. If encountering 403 errors, verify the use of a Google Client Library, OAuth credentials, correct scope (`https://www.googleapis.com/auth/mapsbooking`), and the proper API endpoint.\n"],null,["# Authenticate with Maps Booking API\n\nIn order to make\n[real-time updates](/actions-center/verticals/local-services/e2e/integration-steps/real-time-api-updates), you need to make requests to the\n[Maps Booking API](/maps-booking/reference/maps-booking-api/rest). The Maps Booking API requires that you\nauthenticate your requests via OAuth 2.0 using a GCP service account which\nhas access to the API, and has been allocated the necessary QPS. This guide will walk you through the steps to:\n\n1. Set up your Google Cloud project\n2. Create a service account\n3. Enable the Maps Booking API in your GCP project\n4. Debug common issues\n\nFor information on how to make requests to the API, see our\n[real-time API updates](/actions-center/verticals/local-services/e2e/integration-steps/real-time-api-updates) section of the Local Services Ads End-to-End guide.\n\nSetting up your Google Cloud project with the Actions Center\n------------------------------------------------------------\n\n| **Note:** If you have already set up your Partner Portal account, you must use the Google Cloud project that was entered as part of the setup. If you no longer have access to that Google Cloud Platform project, or need help identifying it, reach out to your Actions Center contact.\n\n1. Log in to your [Google Cloud Platform account](https://cloud.google.com/).\n2. You can [create a new project](https://support.google.com/googleapi/answer/6251787) or use an existing project for this purpose.\n - Please note down the cloud project number as you will require it in the next steps. Your cloud project number can also be found on Google Cloud Platform Home Page. The cloud project number is always numeric only.\n3. Log in to the [Partner Portal](https://partnerdash.google.com/apps/reservewithgoogle/onboarding).\n4. Complete step 1 on the Onboarding Tasks page of the Partner Portal by submitting the cloud project number and the cloud project email address (the email addressed used to administer the cloud project).\n\nCreating a Service Account and OAuth credentials\n------------------------------------------------\n\n| **Note:** These steps must be performed by the account with the developer email that was entered in the onboarding tasks steps.\n\n1. Log back into your [Google Cloud Platform account](https://cloud.google.com/).\n2. Navigate to [IAM \\& admin \\\u003e Service accounts](https://console.cloud.google.com/iam-admin/serviceaccounts).\n3. Search for your existing or newly created cloud project id.\n4. [Create](https://console.cloud.google.com/iam-admin/serviceaccounts/create) a service account.\n5. Fill out the service account details.\n6. Assign the new service account the role that is most suitable for your application needs. The choice of role for the service account will not have any effect on what calls can be made to the Google Maps Booking API, as the allocation of sufficient quota to use them is determined instead by the association of your project number in the Actions Center configuration. If you are unsure what role to pick, just pick Project \\\u003e Viewer.\n7. After clicking \"continue\" in step (6), you will be given an option to create JSON keys.\n8. Save the json credentials. Make sure to store these in a safe place, as you will not be able to retrieve them at a later time.\n9. Log back into Partner Portal and complete remaining tasks on the [Onboarding Tasks](https://partnerdash.google.com/apps/reservewithgoogle/onboarding) page of the Partner Portal.\n\nEnable the MapsBooking API\n--------------------------\n\n1. Log in to your [Google Cloud Platform account](https://cloud.google.com/).\n2. Navigate to [API \\& Services \\\u003e Dashboard](https://console.cloud.google.com/apis/dashboard).\n3. Click on [Enable APIs and Services](https://console.cloud.google.com/apis/library) and search for `Google Maps Booking API`.\n4. Enable the following APIs:\n - Google Maps Booking API\n - Google Maps Booking API (Dev)\n\n| **Note:** If you have already completed the onboarding steps and would like to update your existing cloud project to a new one, please reach out to your Actions Center contact.\n\nCommon Errors\n-------------\n\nThere are a variety of reasons that you may experience authorization issues\nwhen making Real-Time Update requests. If you need general guidance on how to\nmake Real-Time Updates requests, see our\n[real-time API updates](/actions-center/verticals/local-services/e2e/integration-steps/real-time-api-updates) section of the Local Services Ads End-to-End guide. You can also find\nsample clients in multiple languages in the\n[Code Samples](/actions-center/verticals/local-services/e2e/reference/real-time-updates-rest/code-samples/code-sample)\nsection.\n\nIf you are encountering 403 errors, check that you are following all of the\nfollowing requirements:\n\n1. Use a [Google Client Library](/api-client-library).\n2. Create [OAuth Credentials using Service Account Auth](/identity/protocols/OAuth2ServiceAccount#authorizingrequests).\n3. Authorize against the **appropriate scope**.\n4. Make calls to the **appropriate endpoint** (listed below).\n\nEnsure you are **making calls to the correct endpoint:**\n\n1. Sandbox: `https://partnerdev-mapsbooking.googleapis.com/v1alpha/...`\n2. Production: `https://mapsbooking.googleapis.com/v1alpha/...`\n\nEnsure you are **authorizing your OAuth credentials requests properly:**\n\n1. You are authorizing against the scope \"https://www.googleapis.com/auth/mapsbooking\".\n2. You are using the service account key created in [Creating a Service Account and OAuth credentials](#creating-a-service-account-and-OAuth-credentials).\n\n### Still seeing errors?\n\nIf you are still seeing errors after following these steps,\nreach out to your Actions Center contact with the following information:\n\n- Cloud project number and project id with a screenshot\n- Service account id\n- Email used to create the service account\n- End-point details attempted to make requests to\n- Time of request attempts\n- Full request and error messages received when making requests."]]