简体   繁体   中英

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

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.

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

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 will hockeyapp API still work after hockeyapp > appcenter migration that happens at 16 Nov?

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM