1

Recently the hockey moved to app center and i want to download the latest version of android and iOS version on the fly using the API.

What I tried ?

checked the official swagger api-specs

1. @GET("/v0.1/apps/{owner_name}/{app_name}/recent_releases")
2. @GET("/v0.1/apps/{owner_name}/{app_name}/builds/{build_id}/downloads/{download_type}")

but the download url provided by the second url has a different host and it doesn't work.

Simson
  • 3,373
  • 2
  • 24
  • 38
Navneet kumar
  • 1,696
  • 1
  • 17
  • 26

3 Answers3

3

This API:

@GET("/v0.1/apps/{owner_name}/{app_name}/builds/{build_id}/downloads/{download_type}")

is to download builds if you use the Build service from App Center. If you only use Distribute service, try one of these APIs to get the release details, which includes the download url:

https://openapi.appcenter.ms/#/distribute/releases_getLatestByUser https://openapi.appcenter.ms/#/distribute/releases_getLatestByDistributionGroup

dennispan
  • 136
  • 5
1

UPDATED

The api's has been changed, and the new api we can use is

@GET("/v0.1/public/sdk/apps/{app_secret}/releases/latest")
    fun latestRelease(@Header("X-API-Token") apiToken: String, @Path("app_secret") secret: String): Call<JsonObject>

offical swagger api

Navneet kumar
  • 1,696
  • 1
  • 17
  • 26
0

The API's changed, and /v0.1/public/sdk/apps/{app_secret}/releases/latest is no longer supported. you can use instead

https://api.appcenter.ms/v0.1/sdk/apps/{app_secret}/releases/latest

Another better option then you can easily get any version is to use

https://api.appcenter.ms/v0.1/apps/{owner_name}/{app_name}/releases/{release_id}

Get a release with id release_id or 'latest' to get the latest release that was distributed to the current user (from all the distribution groups).

Swagger

shlomo
  • 1