I'm trying to implement the Replace APK flow using the reference:
get_apks_path = '/v1/applications/%s/edits/%s/apks' % (app_id, edit_id)
get_apks_url = BASE_URL + get_apks_path
apks = requests.get(get_apks_url, headers=headers)
firstAPK = apks[0]
apk_id = firstAPK['id']
replace_apk_path = '/v1/applications/%s/edits/%s/apks/%s/replace' % (app_id, edit_id, apk_id)
## Open the apk file on your local machine
local_apk = open(local_apk_path, 'rb').read()
replace_apk_url = BASE_URL + replace_apk_path
all_headers = { 'Content-Type': 'application/vnd.android.package-archive', 'If-Match': etag
}
all_headers.update(headers)
replace_apk_response = requests.put(replace_apk_url, headers=all_headers, data=local_apk)
The problem is that in the response for requests.get(get_apks_url, headers=headers)
I'm missing the ETag that I need in order to replace the existing apk.