Download latest artifacts from app center / Hockey app using API (token)

4k views Asked by At

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.

3

There are 3 answers

0
Navneet kumar On BEST ANSWER

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

0
dennispan On

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

0
shlomo On

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