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

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
app_secret you can list your app secret using app list, use this command line.
apiToken you can generate a token following these instructions

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

Related

How do you know the current version of the Bamboo REST API?

I've written a small application which accesses the REST API of Atlassian Bamboo.
As the documentation describes:
To get the latest version of the API, you can also use the latest key-word.
So I used the latest keyword to access the version. But I noticed now, after migrating to the new Bamboo version, that this wasn't the best solution, because the new version seems to have changed some things in the API and breaks my application.
Now I would like to build my application with a specific API version. But how can I tell: which is the exact version of the current API?
The only thing which the documentation is saying about this:
The API version is independent of the Bamboo release number.
The API version may, or may not, change with a new Bamboo release. The API version number will change only when the updates to the API break the API contract, requiring changes in the code which uses the API. ...
The documentation of the single Bamboo versions (like the one for 6.6.2) only uses the latest keyword as reference.
And even the REST api itself (under /rest/api/latest/info) only tells me the Bamboo version, not the API version:
<info>
<version>6.6.2</version>
<edition/>
<buildDate>2018-08-14T09:01:47.000+02:00</buildDate>
<buildNumber>60606</buildNumber>
<state>RUNNING</state>
</info>
So how do I find the exact API version of my Bamboo installation?

Dialogflow API V2 unity SDK

Is there any workaround for using the new version (V2) of Dialogflow API in Unity? There used to be a SDK for the previous version but apparently it will be discontinued next year...
Since there is no official Dialogflow-Unity-SDK, you can use the Google.Api.Dialogflow.v2 library.
Details at
Authenticating Request with Google.Apis.DialogFlow.V2
Note: Remember that you can't use your token anymore. You need to create a credential file: Details at: https://medium.com/#tzahi/how-to-setup-dialogflow-v2-authentication-programmatically-with-node-js-b37fa4815d89

How to integrate an API Connect API as a BFF into a Bluemix mobile project?

Trying to use an API Connect generated app as the backend for my mobile project adding an OPENAPI_SPEC env variable as defined here:
https://console.ng.bluemix.net/docs/mobile/sdk_compute.html#definition
I can add the app as a compute instance in the Mobile Project UI but it can't generate the SDK, I guess it is because when published via APIC Editor to Bluemix the Loopback app isn't accessed directly but through the APIC gateway.
Any suggestion here?
I would presume that although you have an OPENAPI_SPEC environment variable, your Open API swagger doc isn't valid.
When you download the project, it will auto-generate an SDK corresponding with your backend's Open API document.
For instance, here is how you set the environment variable with an example relative path:
And here is a valid API doc that it's using (albeit not in the most elegant Open API compliant format yet but it works).
https://updatesdk.mybluemix.net/explorer/swagger.json
A good way to test the validity of your OPEN API swagger doc is using the new Bluemix SDK Gen CLI Plugin.
$ bx sdk validate
NAME:
validate - Determines if an OpenAPI specification is valid for SDK generation
USAGE:
bluemix sdk validate OPENAPI_DOC_LOCATION | APP_NAME
OPENAPI_DOC_LOCATION - is a raw OpenAPI specification (URL to spec or local file; json or yaml)
APP_NAME - is the name of an app running in your current space hosting
OpenAPI spec.
In addition, IBM provides a deployable BFF starter sample with an accompanying blog post which may be helpful.

IBM Bluemix - Kitura Swift - is missing a required environment variable: 'OPENAPI_SPEC'

I am stuck for the moment. I cannot obtain the source code for the mobile project and I do not know where is the problem. All my researches was without positive result.
My intention with IBM Bluemix is to develop myself a small project only in Swift (server side + iOS) because I am iOS mobile developer.
When I try to get the code for mobile project (iOS) I get these error:
Error Notification:
The Cloud Foundry App 'XXX' is missing a required environment variable: 'OPENAPI_SPEC'.
I want to use OpenWhisk SDK for iOS. I do not know where to set the variable OPENAPI_SPEC and what value to put in it.
I have setup a Cloud Foundry App started from "Runtime for Swift - Kitura" and a mobile project named started from "Code Starter - OpenWhisk".
Can you help me with some advice or some sample?
Thank you!
If you added a Swift server side Compute to your mobile project, you will need to add an environment variable called OPENAPI_SPEC to your backend to point to a valid Open API swagger document outlining the API.
This way when you download the project, it will auto-generate an SDK corresponding with your backend's Open API.
For instance, here is how you set the environment variable:
And here is a valid API doc that it's using (albeit not in the most elegant Open API compliant format yet but it works).
https://updatesdk.mybluemix.net/explorer/swagger.json
The idea is that the "project" concept takes an abstracted view of a Compute runtime (Cloud Foundry, Docker, etc.) and only cares that it exposes an API compliant with the Open API specification. Using that defined Open API spec, you can dynamically generate an SDK for a "project" when it's downloaded (for iOS, Android, etc.).
If your backend Compute exposes no Open API specification at this time, and you just want to download the code of OpenWhisk for iOS, you can just deassociate that backend Compute from your mobile project for now, and it should download the code. If you ever build on top of that backend and want to reconnect it in the future, you can add it and redownload at a later time (doing a git diff or using the Bluemix CLI SDK plugin to download an SDK from your Open API specification later in your project's lifecycle).

Grails Facebook-Graph Plugin Oauth2

We have been using the Grails Facebook-graph plugin for a while now - it has been working perfectly until earlier this month when FB apparently turned off their old authentication scheme, and indirectly forced everybody to use oauth2 instead.
This post from FB https://developers.facebook.com/blog/post/525/ describes the changes, and the issue in the Grails plugin seems to be that it does not comply with the new standard.
The main issue appears to be in the way the active user data is being maintained in the plugin. This is currently based on the FB provided cookie "fbs", which contains all the necessary session data related to the active user. Unfortunately, this is no longer provided by FB (apparently replaced by a "fbsr" cookie instead).
I have searched the FB documentation, and in various forums for details on how to upgrade the plugin, but unfortunately without luck.
Can anyone help with a hint or two on what steps should be performed in order to get the plugin updated?
EDIT: I think the updated version of the plugin (0.14) has been pushed the public repository. You should try grabbing that one first before reading the rest of my answer.
It looks like the plugin maintainer, Jesus Lanchas, made some updates over the last few days to enable oauth2 support. It has not been pushed to the plugin repository yet, but I was able to get it working with my project. Here's what I did:
#Install a local copy of the plugin WITHIN my project
mkdir plugins-local
cd plugins-local
git clone git://github.com/chechu/grails-facebook-graph.git
mv grails-facebook-graph facebook-graph
Update BuildConfig.groovy and tell grails where to load the plugin from. I put this line before grails.project.dependency.resolution
grails.plugin.location.'facebook-graph' = "plugins-local/facebook-graph"
Uninstall the existing facebook-graph plugin from my project
grails uninstall-plugin facebook graph
This is a temporary solution for me until the offical update hits the repo, but it allows me to make sure I'm using the same new code everywhere.
EDIT: we released our Facebook Grails SDK on GitHub :
https://github.com/benorama/facebook-grails-sdk.
Currently only tested on Grails 2.0…
Any feedback is welcome before we release it officially to Grails.org.
Indeed, it looks like Grails Facebook-graph plugin does not support OAuth2 Facebook authentication (which is required since October 1st 2011).
We have already ported the official PHP SDK V3.1.1 to ColdFusion 9 (https://github.com/affinitiz/facebook-cf-sdk).
Last month, we started to implement it as a plugin in Grails 2.0.
It is currently at an alpha stage so we have not released it yet, but it is working on our prototype.
To connect to the Facebook Graph API, it uses RestFB internally.
If you want to give it a try and give us some feedbacks, let me know, I'll sent it to you by email.