question

newuser-e2377693-0f5b-412b-aae8-5dc66a4a5d59 avatar image

ETag is is missing when getting apk list

I'm trying to implement the Replace APK flow using the reference:

 
                
  1. get_apks_path = '/v1/applications/%s/edits/%s/apks' % (app_id, edit_id)
  2. get_apks_url = BASE_URL + get_apks_path
  3. apks = requests.get(get_apks_url, headers=headers)

  4. firstAPK = apks[0]
  5. apk_id = firstAPK['id']
  6. replace_apk_path = '/v1/applications/%s/edits/%s/apks/%s/replace' % (app_id, edit_id, apk_id)

  7. ## Open the apk file on your local machine
  8. local_apk = open(local_apk_path, 'rb').read()

  9. replace_apk_url = BASE_URL + replace_apk_path
  10. all_headers = { 'Content-Type': 'application/vnd.android.package-archive', 'If-Match': etag
  11. }
  12. all_headers.update(headers)
  13. 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.

app submission and updatesapi
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

lauren avatar image
lauren answered

For anyone else who comes across this - you won't get an etag with the list, only when you get an individual apk object - https://developer.amazon.com/docs/app-submission-api/appsubapi-endpoints.html#/Edits.apks/get_1

10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Levon@Amazon avatar image
Levon@Amazon answered

Hi Lauren,

Your observation is correct. Etag does not get generated for "/apks" top-level resource due to a technical limitation. It should get generated as expected for individual "/apks/{apkId}" resources. Thanks!

10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.