Forum Discussion
How to programatically fetch the latest versions
Ahh, thanks for clarifying your usecase @balupton ,
I think I have just the endpoint for you - supply the current build number and whether or not you are interested in betas or not and the response will return a JSON response containing the latest version to update to.
Here is the GET endpoint: https://app-updates.agilebits.com/check/1/0/CLI2/en/{BUILD_NUMBER}/{Y or N for beta}
Our build number is in the format of: Mmmppbb so v2.0.0-01 would be represented by 2000001.
So to get the latest stable v2.x.x version number, one could call the endpoint using 2.0.0-0-1, the earliest v2 version:
https://app-updates.agilebits.com/check/1/0/CLI2/en/2000001/N
The response should look something like:
{"available":"1","version":"2.1.0","relnotes":"https://app-updates.agilebits.com/relnotes/CLI2/en/2/2010001"}
You can then parse the "version" value and interpolate it into our download links, that can be platform dependent, which you can see at https://app-updates.agilebits.com/product_history/CLI2
Hope this helps!