Method: edits.apks.addexternallyhosted
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.
Tạo APK mới mà không cần tải chính APK lên Google Play, thay vào đó lưu trữ APK tại một URL được chỉ định. Chức năng này chỉ dành cho các tổ chức sử dụng Managed Play có ứng dụng được định cấu hình để hạn chế phân phối trong phạm vi các tổ chức.
Yêu cầu HTTP
POST https://androidpublisher.googleapis.com/androidpublisher/v3/applications/{packageName}/edits/{editId}/apks/externallyHosted
URL sử dụng cú pháp Chuyển mã gRPC.
Tham số đường dẫn
Tham số |
packageName |
string
Tên gói của ứng dụng.
|
editId |
string
Giá trị nhận dạng của nội dung chỉnh sửa.
|
Nội dung yêu cầu
Nội dung yêu cầu chứa dữ liệu có cấu trúc sau:
Trường |
externallyHostedApk |
object (ExternallyHostedApk )
Định nghĩa về tệp APK được lưu trữ bên ngoài và vị trí của tệp APK đó.
|
Nội dung phản hồi
Phản hồi về việc tạo một APK mới được lưu trữ bên ngoài.
Nếu thành công, phần nội dung phản hồi sẽ chứa dữ liệu có cấu trúc sau:
Trường |
externallyHostedApk |
object (ExternallyHostedApk )
Định nghĩa về tệp APK được lưu trữ bên ngoài và vị trí của tệp APK đó.
|
Phạm vi uỷ quyền
Yêu cầu phạm vi OAuth sau:
https://www.googleapis.com/auth/androidpublisher
ExternallyHostedApk
Xác định một tệp APK có sẵn cho ứng dụng này, đây là tệp APK được lưu trữ bên ngoài và không tải lên Google Play. Chức năng này chỉ dành cho các tổ chức sử dụng Managed Play có ứng dụng được định cấu hình để hạn chế phân phối trong phạm vi các tổ chức.
Biểu diễn dưới dạng JSON |
{
"packageName": string,
"applicationLabel": string,
"versionCode": integer,
"versionName": string,
"fileSize": string,
"fileSha1Base64": string,
"fileSha256Base64": string,
"iconBase64": string,
"minimumSdk": integer,
"certificateBase64s": [
string
],
"externallyHostedUrl": string,
"maximumSdk": integer,
"nativeCodes": [
string
],
"usesFeatures": [
string
],
"usesPermissions": [
{
object (UsesPermission )
}
]
} |
Trường |
packageName |
string
Tên gói.
|
applicationLabel |
string
Nhãn ứng dụng.
|
versionCode |
integer
Mã phiên bản của APK này.
|
versionName |
string
Tên phiên bản của APK này.
|
fileSize |
string (int64 format)
Kích thước tệp tính bằng byte của APK này.
|
fileSha1Base64 |
string
Giá trị tổng kiểm sha1 của APK này, được biểu thị dưới dạng một mảng byte được mã hoá base64.
|
fileSha256Base64 |
string
Giá trị tổng kiểm sha256 của APK này, được biểu thị dưới dạng một mảng byte được mã hoá base64.
|
iconBase64 |
string
Hình ảnh biểu tượng từ APK, dưới dạng một mảng byte mã hoá base64.
|
minimumSdk |
integer
SDK tối thiểu mà APK này nhắm mục tiêu.
|
certificateBase64s[] |
string
Một chứng chỉ (hoặc mảng chứng chỉ nếu sử dụng chuỗi chứng chỉ) được dùng để ký APK này, được biểu thị dưới dạng một mảng byte mã hoá base64.
|
externallyHostedUrl |
string
URL lưu trữ tệp APK. Đây phải là một URL loại https.
|
maximumSdk |
integer
SDK tối đa mà APK này hỗ trợ (không bắt buộc).
|
nativeCodes[] |
string
Môi trường mã gốc mà APK này hỗ trợ (không bắt buộc).
|
usesFeatures[] |
string
Các tính năng mà tệp APK này yêu cầu (không bắt buộc).
|
usesPermissions[] |
object (UsesPermission )
Các quyền mà APK này yêu cầu.
|
UsesPermission
Quyền mà APK này sử dụng.
Biểu diễn dưới dạng JSON |
{
"name": string,
"maxSdkVersion": integer
} |
Trường |
name |
string
Tên quyền được yêu cầu.
|
maxSdkVersion |
integer
Đây là phiên bản SDK tối đa cần có quyền.
|
Trừ phi có lưu ý khác, nội dung của trang này được cấp phép theo Giấy phép ghi nhận tác giả 4.0 của Creative Commons và các mẫu mã lập trình được cấp phép theo Giấy phép Apache 2.0. Để biết thông tin chi tiết, vui lòng tham khảo Chính sách trang web của Google Developers. Java là nhãn hiệu đã đăng ký của Oracle và/hoặc các đơn vị liên kết với Oracle.
Cập nhật lần gần đây nhất: 2025-07-26 UTC.
[null,null,["Cập nhật lần gần đây nhất: 2025-07-26 UTC."],[[["\u003cp\u003eCreates a new APK hosted at a specified URL instead of uploading it to Google Play, restricted to Managed Play organizations.\u003c/p\u003e\n"],["\u003cp\u003eRequires an HTTP POST request to \u003ccode\u003ehttps://androidpublisher.googleapis.com/androidpublisher/v3/applications/{packageName}/edits/{editId}/apks/externallyHosted\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThe request body defines the externally-hosted APK with details like package name, version code, checksums, and hosting URL.\u003c/p\u003e\n"],["\u003cp\u003eThe response provides the details of the successfully created externally hosted APK.\u003c/p\u003e\n"],["\u003cp\u003eThis functionality requires the \u003ccode\u003ehttps://www.googleapis.com/auth/androidpublisher\u003c/code\u003e authorization scope.\u003c/p\u003e\n"]]],["This document details the process of creating an externally hosted APK for Managed Play applications. The core action is sending a `POST` request to a specific endpoint with the `packageName` and `editId`. The request body includes an `externallyHostedApk` object, defining the APK's metadata like its URL, version, checksums, supported SDKs, and required permissions. The server returns the same object in the response upon successful creation. This process is authorized with the `androidpublisher` scope.\n"],null,["# Method: edits.apks.addexternallyhosted\n\n- [HTTP request](#body.HTTP_TEMPLATE)\n- [Path parameters](#body.PATH_PARAMETERS)\n- [Request body](#body.request_body)\n - [JSON representation](#body.request_body.SCHEMA_REPRESENTATION)\n- [Response body](#body.response_body)\n - [JSON representation](#body.ApksAddExternallyHostedResponse.SCHEMA_REPRESENTATION)\n- [Authorization scopes](#body.aspect)\n- [ExternallyHostedApk](#ExternallyHostedApk)\n - [JSON representation](#ExternallyHostedApk.SCHEMA_REPRESENTATION)\n- [UsesPermission](#UsesPermission)\n - [JSON representation](#UsesPermission.SCHEMA_REPRESENTATION)\n- [Try it!](#try-it)\n\nCreates a new APK without uploading the APK itself to Google Play, instead hosting the APK at a specified URL. This function is only available to organizations using Managed Play whose application is configured to restrict distribution to the organizations.\n\n### HTTP request\n\n`POST https://androidpublisher.googleapis.com/androidpublisher/v3/applications/{packageName}/edits/{editId}/apks/externallyHosted`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Path parameters\n\n| Parameters ||\n|---------------|-----------------------------------|\n| `packageName` | `string` Package name of the app. |\n| `editId` | `string` Identifier of the edit. |\n\n### Request body\n\nThe request body contains data with the following structure:\n\n| JSON representation |\n|---------------------------------------------------------------------------------------------------------------------------------------|\n| ``` { \"externallyHostedApk\": { object (/android-publisher/api-ref/rest/v3/edits.apks/addexternallyhosted#ExternallyHostedApk) } } ``` |\n\n| Fields ||\n|-----------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `externallyHostedApk` | `object (`[ExternallyHostedApk](/android-publisher/api-ref/rest/v3/edits.apks/addexternallyhosted#ExternallyHostedApk)`)` The definition of the externally-hosted APK and where it is located. |\n\n### Response body\n\nResponse for creating a new externally hosted APK.\n\nIf successful, the response body contains data with the following structure:\n\n| JSON representation |\n|---------------------------------------------------------------------------------------------------------------------------------------|\n| ``` { \"externallyHostedApk\": { object (/android-publisher/api-ref/rest/v3/edits.apks/addexternallyhosted#ExternallyHostedApk) } } ``` |\n\n| Fields ||\n|-----------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `externallyHostedApk` | `object (`[ExternallyHostedApk](/android-publisher/api-ref/rest/v3/edits.apks/addexternallyhosted#ExternallyHostedApk)`)` The definition of the externally-hosted APK and where it is located. |\n\n### Authorization scopes\n\nRequires the following OAuth scope:\n\n- `https://www.googleapis.com/auth/androidpublisher`\n\nExternallyHostedApk\n-------------------\n\nDefines an APK available for this application that is hosted externally and not uploaded to Google Play. This function is only available to organizations using Managed Play whose application is configured to restrict distribution to the organizations.\n\n| JSON representation |\n|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ``` { \"packageName\": string, \"applicationLabel\": string, \"versionCode\": integer, \"versionName\": string, \"fileSize\": string, \"fileSha1Base64\": string, \"fileSha256Base64\": string, \"iconBase64\": string, \"minimumSdk\": integer, \"certificateBase64s\": [ string ], \"externallyHostedUrl\": string, \"maximumSdk\": integer, \"nativeCodes\": [ string ], \"usesFeatures\": [ string ], \"usesPermissions\": [ { object (/android-publisher/api-ref/rest/v3/edits.apks/addexternallyhosted#UsesPermission) } ] } ``` |\n\n| Fields ||\n|------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `packageName` | `string` The package name. |\n| `applicationLabel` | `string` The application label. |\n| `versionCode` | `integer` The version code of this APK. |\n| `versionName` | `string` The version name of this APK. |\n| `fileSize` | `string (`[int64](https://developers.google.com/discovery/v1/type-format)` format)` The file size in bytes of this APK. |\n| `fileSha1Base64` | `string` The sha1 checksum of this APK, represented as a base64 encoded byte array. |\n| `fileSha256Base64` | `string` The sha256 checksum of this APK, represented as a base64 encoded byte array. |\n| `iconBase64` | `string` The icon image from the APK, as a base64 encoded byte array. |\n| `minimumSdk` | `integer` The minimum SDK targeted by this APK. |\n| `certificateBase64s[]` | `string` A certificate (or array of certificates if a certificate-chain is used) used to sign this APK, represented as a base64 encoded byte array. |\n| `externallyHostedUrl` | `string` The URL at which the APK is hosted. This must be an https URL. |\n| `maximumSdk` | `integer` The maximum SDK supported by this APK (optional). |\n| `nativeCodes[]` | `string` The native code environments supported by this APK (optional). |\n| `usesFeatures[]` | `string` The features required by this APK (optional). |\n| `usesPermissions[]` | `object (`[UsesPermission](/android-publisher/api-ref/rest/v3/edits.apks/addexternallyhosted#UsesPermission)`)` The permissions requested by this APK. |\n\nUsesPermission\n--------------\n\nA permission used by this APK.\n\n| JSON representation |\n|------------------------------------------------------|\n| ``` { \"name\": string, \"maxSdkVersion\": integer } ``` |\n\n| Fields ||\n|-----------------|-------------------------------------------------------------------------------------|\n| `name` | `string` The name of the permission requested. |\n| `maxSdkVersion` | `integer` Optionally, the maximum SDK version for which the permission is required. |"]]