# Method: edits.apks.addexternallyhosted

- [HTTP request](https://developers.google.com/android-publisher/api-ref/rest/v3/edits.apks/addexternallyhosted#body.HTTP_TEMPLATE)
- [Path parameters](https://developers.google.com/android-publisher/api-ref/rest/v3/edits.apks/addexternallyhosted#body.PATH_PARAMETERS)
- [Request body](https://developers.google.com/android-publisher/api-ref/rest/v3/edits.apks/addexternallyhosted#body.request_body)
  - [JSON representation](https://developers.google.com/android-publisher/api-ref/rest/v3/edits.apks/addexternallyhosted#body.request_body.SCHEMA_REPRESENTATION)
- [Response body](https://developers.google.com/android-publisher/api-ref/rest/v3/edits.apks/addexternallyhosted#body.response_body)
  - [JSON representation](https://developers.google.com/android-publisher/api-ref/rest/v3/edits.apks/addexternallyhosted#body.ApksAddExternallyHostedResponse.SCHEMA_REPRESENTATION)
- [Authorization scopes](https://developers.google.com/android-publisher/api-ref/rest/v3/edits.apks/addexternallyhosted#body.aspect)
- [ExternallyHostedApk](https://developers.google.com/android-publisher/api-ref/rest/v3/edits.apks/addexternallyhosted#ExternallyHostedApk)
  - [JSON representation](https://developers.google.com/android-publisher/api-ref/rest/v3/edits.apks/addexternallyhosted#ExternallyHostedApk.SCHEMA_REPRESENTATION)
- [UsesPermission](https://developers.google.com/android-publisher/api-ref/rest/v3/edits.apks/addexternallyhosted#UsesPermission)
  - [JSON representation](https://developers.google.com/android-publisher/api-ref/rest/v3/edits.apks/addexternallyhosted#UsesPermission.SCHEMA_REPRESENTATION)
- [Try it!](https://developers.google.com/android-publisher/api-ref/rest/v3/edits.apks/addexternallyhosted#try-it)

Creates 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.

### HTTP request

`POST https://androidpublisher.googleapis.com/androidpublisher/v3/applications/{packageName}/edits/{editId}/apks/externallyHosted`

The URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.

### Path parameters

| Parameters ||
|---|---|
| `packageName` | `string` Package name of the app. |
| `editId` | `string` Identifier of the edit. |

### Request body

The request body contains data with the following structure:

| JSON representation |
|---|
| ``` { "externallyHostedApk": { object (`https://developers.google.com/android-publisher/api-ref/rest/v3/edits.apks/addexternallyhosted#ExternallyHostedApk`) } } ``` |

| Fields ||
|---|---|
| `externallyHostedApk` | ``object (`https://developers.google.com/android-publisher/api-ref/rest/v3/edits.apks/addexternallyhosted#ExternallyHostedApk`)`` The definition of the externally-hosted APK and where it is located. |

### Response body

Response for creating a new externally hosted APK.

If successful, the response body contains data with the following structure:

| JSON representation |
|---|
| ``` { "externallyHostedApk": { object (`https://developers.google.com/android-publisher/api-ref/rest/v3/edits.apks/addexternallyhosted#ExternallyHostedApk`) } } ``` |

| Fields ||
|---|---|
| `externallyHostedApk` | ``object (`https://developers.google.com/android-publisher/api-ref/rest/v3/edits.apks/addexternallyhosted#ExternallyHostedApk`)`` The definition of the externally-hosted APK and where it is located. |

### Authorization scopes

Requires the following OAuth scope:

- `https://www.googleapis.com/auth/androidpublisher`

## ExternallyHostedApk

Defines 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.

| JSON representation |
|---|
| ``` { "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 (`https://developers.google.com/android-publisher/api-ref/rest/v3/edits.apks/addexternallyhosted#UsesPermission`) } ] } ``` |

| Fields ||
|---|---|
| `packageName` | `string` The package name. |
| `applicationLabel` | `string` The application label. |
| `versionCode` | `integer` The version code of this APK. |
| `versionName` | `string` The version name of this APK. |
| `fileSize` | `string (https://developers.google.com/discovery/v1/type-format format)` The file size in bytes of this APK. |
| `fileSha1Base64` | `string` The sha1 checksum of this APK, represented as a base64 encoded byte array. |
| `fileSha256Base64` | `string` The sha256 checksum of this APK, represented as a base64 encoded byte array. |
| `iconBase64` | `string` The icon image from the APK, as a base64 encoded byte array. |
| `minimumSdk` | `integer` The minimum SDK targeted by this APK. |
| `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. |
| `externallyHostedUrl` | `string` The URL at which the APK is hosted. This must be an https URL. |
| `maximumSdk` | `integer` The maximum SDK supported by this APK (optional). |
| `nativeCodes[]` | `string` The native code environments supported by this APK (optional). |
| `usesFeatures[]` | `string` The features required by this APK (optional). |
| `usesPermissions[]` | ``object (`https://developers.google.com/android-publisher/api-ref/rest/v3/edits.apks/addexternallyhosted#UsesPermission`)`` The permissions requested by this APK. |

## UsesPermission

A permission used by this APK.

| JSON representation |
|---|
| ``` { "name": string, "maxSdkVersion": integer } ``` |

| Fields ||
|---|---|
| `name` | `string` The name of the permission requested. |
| `maxSdkVersion` | `integer` Optionally, the maximum SDK version for which the permission is required. |