使用 UserService 建立/更新使用者角色時,請務必小心不要將非必要的權限授予使用者。可透過一組角色組合存取 API 的許多功能,而不是為使用者指派管理員角色。決定要指派哪些角色時,請參閱權限說明文件。此外,身為第三方應用程式開發人員,在要求網路為您建立使用者時,請務必決定應用程式需要哪種存取層級。相較於管理員的權限,這類角色的權限可能不夠。
遵守配額限制
Ad Manager API 會強制執行多項配額限制,以維護穩定性。請務必將應用程式保持在這些限制內,並瞭解如何回應 API 可能傳回的任何配額錯誤。
API 配額
套用至 API 要求的第一個配額是網路層級的配額。Ad Manager 360 帳戶的每秒要求數上限為每秒 8 個要求;如果是 Ad Manager 帳戶,則上限為每秒 2 次。如果超過這項限制,就會產生
QuotaError.EXCEEDED_QUOTA 錯誤。所有在您網路發出的 API 要求都會計入這項配額,包括您或貴公司其他人已經授予 API 存取網路的第三方應用程式。
[[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["缺少我需要的資訊","missingTheInformationINeed","thumb-down"],["過於複雜/步驟過多","tooComplicatedTooManySteps","thumb-down"],["過時","outOfDate","thumb-down"],["翻譯問題","translationIssue","thumb-down"],["示例/程式碼問題","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["上次更新時間:2025-05-22 (世界標準時間)。"],[[["This page provides best practices for developing applications using the Google Ad Manager API to enhance performance and efficiency."],["Developers should reuse service clients, use paging for large data sets, and batch update requests to optimize interactions with the API."],["PQL bind parameters are recommended for improved code readability and reusability, while user privileges should be granted judiciously."],["Ad Manager API enforces quota limits; developers should implement strategies to handle quota errors and stay within allowed usage."]]],["Optimize Google Ad Manager API usage by reusing service clients, creating them once per execution. When retrieving objects, use paging with `LIMIT` and `OFFSET` clauses, aiming for 200-500 items per page. For updates, batch multiple objects in a single request. Employ bind parameters in PQL for readability and reusability. Grant user privileges sparingly, avoiding unnecessary administrative roles. Respect quota limits, implementing retry strategies with exponential backoff, particularly for reporting and forecast requests.\n"]]