您必須先將 Google Play 管理中心連結到 API 專案,才能存取 Publishing API。在大部分情況下,我們會建議使用者建立新的 API 專案,不過目前的 Google Play Developer Publishing API 的使用者可以連結至現有 API 專案。請注意,每個 API 專案都只能連結到一個 Google Play 管理中心帳戶。
[[["容易理解","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-07-27 (世界標準時間)。"],[],[],null,["# Get started with the Play Games Services Publishing API\n\nTo start making calls to the Publishing API, you must link to an API\nproject directly from the\n[Google Play Console](//play.google.com/apps/publish/)\nand enable the Publishing API for that project. Once your API project is\nset up, it can be used to manage other game projects you own.\n\nThe Publishing API can only be configured by the owner of your\n[Google Play Developer account](/distribute/googleplay/developer-console#account-details).\nThe following instructions explain how to:\n\n- Set up a new or existing API project\n- Manage OAuth clients\n- Use a service account to access the Publishing API\n\nSet up your API Project\n-----------------------\n\nBefore you can access the Publishing API, you must link Google Play Console\nto an API project. In most cases, you are encouraged to create a new API\nproject, though current\n[Google Play Developer Publishing API](https://developer.android.com/distribute/googleplay/developer-console.html#account-details)\nusers can link to an existing API project. Keep in mind that each API project\ncan only be linked to a single Google Play Console account.\n\n### Create a new API project\n\n1. Go to the [API Access](https://play.google.com/apps/publish/#ApiAccessPlace) page on the Google Play Console.\n2. Accept the Terms of Service.\n3. Click **Create new project**. An API project is automatically generated and linked to your Google Play Console.\n4. Turn the Game Services Publishing API option to **ON**.\n\nYour API project is now configured to access the Publishing API.\n\n### Use an existing API project\n\nIf you are already a user of the\n[Google Play Developer API](https://developers.google.com/android-publisher),\nyou can set up your existing API project by following these steps. If the API\nproject you want to set up is not listed, verify that your Google Play Console\naccount is designated as an Owner, and the\n[Google Play Developer API](https://developers.google.com/android-publisher/#publishing)\nis enabled.\n\n1. Go to the [API Access](https://play.google.com/apps/publish/#ApiAccessPlace) page on the Google Play Console.\n2. Accept the API Terms of Service.\n3. Choose the project you'd like to set up.\n4. Click **Link**. Your Google Play Console is now linked to the API project.\n5. Turn the Game Services Publishing API option to **ON**.\n\nYour API project is now configured to access the Publishing API.\n\nSet Up API Access Clients\n-------------------------\n\nYou access the Publishing API through an OAuth client or a service account.\n\n### Use OAuth clients\n\nYou can allow users to perform actions via the Publishing API under their\nown credentials using an\n[OAuth](https://developers.google.com/accounts/docs/OAuth2) client.\n| **Note:** Your Oauth client must share the same project as your [service account](#using_a_service_account).\n\nA user's actions are limited to those permitted via the\n[User Accounts \\& Rights](https://play.google.com/apps/publish/#AdminPlace)\npage on the Google Play Console.\n\n1. Go to the [API Access](https://play.google.com/apps/publish/#ApiAccessPlace) page on the Google Play Console.\n2. Under **OAuth Clients** , click **Create OAuth Client**.\n3. Configure your product's branding information, and click **Continue**.\n4. Click **Create Client ID**.\n\nThe details of your new OAuth client are displayed in a list on this page.\n\n### Use a service account\n\nYou can also create a\n[service account](https://developers.google.com/accounts/docs/OAuth2ServiceAccount)\nto access the Publishing API from a build server without providing your personal\nuser credentials:\n\n1. Go to the [API Access](https://play.google.com/apps/publish/#ApiAccessPlace) page on the Google Play Console.\n2. Under **Service Accounts** , click **Create Service Account**.\n3. Follow the instructions on the page to create your service account.\n4. Once you've created the service account on the Google Developers Console, click **Done** . The [API Access](https://play.google.com/apps/publish/#ApiAccessPlace) page automatically refreshes, and your service account will be listed.\n5. Click **Grant Access** to provide the service account the necessary rights to perform actions.\n\nFor more information, see\n[Using OAuth 2.0 for Server to Server Applications](https://developers.google.com/accounts/docs/OAuth2ServiceAccount).\n\nAccessing the Google Play Games Services Publishing API\n-------------------------------------------------------\n\nYou can access the Publishing API directly via HTTP. For more information, see\n[Publishing API reference](https://developers.google.com/games/services/publishing/api)\nand the\n[sample app](//github.com/playgameservices/management-tools)."]]