google-apis-explorerandroidpublisher

systemapks.variants.download doesn't pop up any error message and download anything


After execute create method, use valid variantId to execute request as "https://developers.google.com/android-publisher/api-ref/rest/v3/systemapks.variants/download" suggested, no error pops up and nothing is downloaded.

service = build('androidpublisher', 'v3', http=http_auth, cache_discovery=False)

variant = service.systemapks().variants().download(packageName=package_name, versionCode=version_code, variantId=variant_id).execute()

Solution

  • You should add "&alt=media" to the URL, like this:

    https://www.googleapis.com/androidpublisher/v3/applications/<package_name>/systemAPKs/<version_code>/variants/<variant_id>:download?alt=media
    

    Then the request body will contain the binary of the APK.