Bitrise Public API

Ah yes sorry you’re right :laughing:

Defining a workflow which only install dependencies and push cache… Correct.
Thanks for this idea. I dont know why I make it so complex :frowning:

1 Like

No problem, it’s not trivial to find the easiest solution when there are multiple solutions (each one might be the easiest solution for a given use case ;)).

1 Like

It’d be useful for us to track the size of the build artifacts over time - say for tracking significant changes in app binary size. I noticed that the WIP endpoint for getting details on a build artifact doesn’t include file size. It’d be great if it did, does that sound reasonable?

There is a workaround to get arttifact file size. I’ve used the following pipe:

curl -sH ‘Authorization: token THE-ACCESS-TOKEN’ ‘https://api.bitrise.io/v0.1/apps/APP-SLUG/builds/BUILD-SLUG/artifacts/ARTIFACT-SLUG’ | jq -r .data.expiring_download_url | xargs curl -sD - | dd count=1 2>/dev/null | grep -e Content-Length | cut -d" " -f 2

1 Like

@jeffremer definitely makes sense and shouldn’t take too much time - I’ll schedule a task for this!

@koral that’s a nice trick, thanks for sharing! :wink:

Hello @viktorbenei!

Thanks for a nice API!

Is there a way i can get all apps including the latest build info?
Either by default including it or adding a query parameter.

I’m requesting this because it will not be good performance in an app.
Lets say there is a list with 50 apps and then need to fetch 50 builds afterwards?

I hope you understand me :slight_smile:

// Kim

Not yet, you’ll have to iterate over all the apps (/me/apps) and then get the builds for those (to get only the latest one you can use ../builds?limit=1).

1 Like

Okay!

Is the latest build in the pipeline? :smile:

1 Like

@kimdv latest build can be retrieved with the ../builds endpoint, if you specify limit=1. It’s not in the API docs yet but should be, just created an issue for it :wink:

https://github.com/bitrise-io/devcenter/issues/157

That said you can already see examples in the API docs, e.g. at the builds list endpoint docs, curl example: http://devcenter.bitrise.io/api/v0.1/#example-curl-request_3

@viktorbenei maybe I wasn’t clear in my question.
Is the latest build within the apps endpoints, something similar to the example below?

For app usage it will be a lot more performant to download a lot of data at once, instead of downloading a single build for every app. :slight_smile:

{
	"slug": "slug",
	"title": "Test",
	"project_type": "ios",
	"provider": "github",
	"repo_owner": "kimdv",
	"repo_url": "git@github.com:kimdv/Test.git",
	"repo_slug": "Test",
	"is_disabled": false,
	"latestBuild": {
		"slug": "slug"
		// MORE DATA
	}
}
1 Like

Ahh I see. Not planned yet, feel free to create a separate #feature-request for it :slight_smile: (we’ll close this one soon and will start to track api related feature requests separately)

2 Likes

@jeffremer & @koral Artifact file size is now included in the response, no need for hacks/workarounds anymore :wink:

See e.g. http://devcenter.bitrise.io/api/v0.1/#get-appsapp-slugbuildsbuild-slugartifactsartifact-slug - file_size_bytes

2 Likes

Hi guys, thanks for the idea of the API, it’s great !
I use Bitrise for quite a long time for my company and I start using it for me.

I have started a postman collections about the API, you can find this here :
https://www.getpostman.com/collections/f0e338f8eaebe68d9779

You will have to add some environnements variables (with bulk edit it will be very fast)

bearer: —your token----
appSlug: —someAppSlug----
buildSlug: —someBuildSlug—
artifactSlug:—someArtifactSlug—

I think of creating a small Android application to handle bitrise , but the main problem for this is the authentification. Is there no way to handle a auth workflow, where we send email/password?
We send userName, password, and the api such as bitrise/auth do a callback with the token?
That way, no need to go to the website, in security and generate a token.
If it is not something you are going to do, i’ll do with a webview but it is not very user friendly ^^

Well, thanks a lot for your projects, it is really much easier to use than jenkins/gitlab or else, so i wanted to be involved in my way :stuck_out_tongue:

Cheers,

Jocelyn

3 Likes

Awesome, thank you @z17jdavi for sharing! I’m sure this’ll help others too - we’re also working on an auto generated Swagger definition, that will hopefully help as well :slight_smile:

Re: auth: we don’t have plans for it right now, but feel free to create a separate #feature-request for it. Personally I’d love to see this, but we might have to wait it until the end of the “v1” scope, or can work on it after the “v1” scope, so a separate #feature-request would be really helpful! :slight_smile:

1 Like

Hi @viktorbenei,
I builded a new dashboard on Google Data Studio, but i wanted only count of all builds of each apps without pagging and with period time, because this way would more easy to obtain.

It is possible to add in the future?!

@ipirangamobile sure, definitely possible - please create a separate Feature Requests for it (at Feature Requests - Bitrise Discussions ), as it’s a bit out of scope for this one (as we already have the required API endpoints as far as I know) and it’s more about a dashboard / UI than about the API.

P.S.: actually this feature request seems to be related: Build dashboard / Build Time Trend / Stats / Analytics so feel free to just vote & comment there! :wink:

Hi guys,
I am currently developping an android app in order to download very quickly apk that are create with bitrise.

For that I have been able to connect with writing a token using a webview, and go from build to the artifacts and download it.

It would be easier for user if there was an endpoint to generate a token, using email/password , is it in your roadmap?

Now I am looking for ways to start a build from the app but it seems difficult for some reasons :

  • I don’t find informations about the existing worflows. Is there any endpoint such as /apps/{appSlug}/worflows ?
  • I don’t have the app api token, it can be found only on the web as well it seems, maybe a /apps/{appSlug}/api_token

Anyway, thanks for the good work :slight_smile: , I’ll send you an APK for the app when it will be almost done (a bitrise link for sure ;D)

1 Like

Hey @z17jdavi :wave:

There’s no endpoint for getting the workflows right now, but we definitely plan to provide two related endpoints in the near future:

  1. One you will be able to use to get the list of workflows which were previously triggered (the ones you see on the build list). This might not include every workflow from the config if there’s a workflow which was never triggered
  2. An endpoint to get the whole bitrise.yml config (in JSON format), from which you can filter the workflows
  3. If required we’ll also provide a separate endpoint to get only the workflows from the config, but this might be redundant if #2 will be available. We’ll see :wink: Of course feel free to create a Feature Requests if you’d need this, if there’s enough demand we will definitely consider adding this endpoint even if we don’t need it. But again it’s not yet decided whether we need it or not, so we might provide this endpoint as well, without a Feature Requests too :slight_smile:

Definitely a great idea! Can you please create a Feature Requests for this? It’s definitely on our roadmap, but a Feature Requests would bump its priority :wink:

Glad to hear, thank you! :slight_smile: If you’d have any questions just let us know! Happy Building! :wink:

1 Like

It would be great to have more data on the artifacts, especially version (and build number). This is already displayed on the public install page but currently not exposed via the api.

1 Like

Hi @viktorbenei! Can you give me a list of all possible values for artifact_type and project_type? The only ones mentioned in the documentation are:

  • artifact_type: file, android-apk, ios-ipa
  • project_type: android, ios, xamarin, macos