Bitrise.io API v0.1 (Work In Progress)

@viktorbenei Am I missing something or is the documentation on https://devcenter.bitrise.io/api/v0.1/ very incomplete and half-hearted at the moment? What I mean is this:

POST /apps/register ⚓

Add a new application
Example curl request ⚓

curl -H 'Authorization: token THE-ACCESS-TOKEN' 'https://api.bitrise.io/v0.1/apps/APP-SLUG' -d '{"provider":"github","is_public":false,"repo_url":"git@github.com:api_demo/example-repository.git","type":"git","git_repo_slug":"example-repository","git_owner":"api_demo"}'

Example response ⚓

{
  "status": "ok",
  "slug": "022d8a3124f1225d"
}

This is all information there is for the “new app” API endpoint. The data I need to send is totally undocumented, there’s only an example. What I’m missing at least:

  • [ ] A short description for each request parameter.
  • [ ] All possible values for enum cases.

For example, I have no idea how to setup a new project which is hosted on a self-hosted GitLab server. What’s the right value for provider? What’s the git_owner? And on registering webhook, the example doesn’t even include any sent data – how does it work, then? I have do find these things out through trial and error now.

Also it’s totally unclear to me how the entire app creation process works given there are separate API endpoints for register-ssh-key, register-webhook and app/APP-SLUG/finish … will I have to wait and check some status until the scanner has completed? What if the scanner finds errors, how do I get them?

A complete documentation for the currently existing APIs would be very helpful!

I have done some digging by now and managed to find out some stuff. When I try to finish the creation process though, I get an internal server error. Specifically this is what I’m sending:

Request to 'https://api.bitrise.io/v0.1/apps/<SOME-SLUG>/finish' failed.
Request body:
{"project_type":"ios","envs":{},"organization_slug":"<SOME-SLUG>","mode":"manual","stack_id":"osx-xcode-edge"}

The response is this:

{"status":500,"error":"Internal Server Error"}

Since it’s a 500 status code, there must be an issue on the backend side…

@gergelybekesi any suggestion? :thinking:

Hi @viktorbenei!
It seems there is a new status for builds (status 4, “abordted-with-success”), right? Any reason why it does not appear on the documentation?
Unfortunately this makes my iOS app crash :frowning_face:

Indeed we introduced that a while ago and missed to add it to the docs, sorry @ghislainfrs - I’ll create a card for the docs team to update it!

2 Likes

Can anyone provide me a way to assign the path of my profile and certificate which is already in my cloned code to bitrise.(using git)
right now, i am giving
{“mapped_to”:"$BITRISE_PROVISION_URL",“value”:“file://./profile/bitdist.mobileprovision | file://./profile/bitdev.mobileprovision”,“is_expand”:true}
but it is not working…

Hey @jamitlabs

Sorry for the late response, I’ve updated the documentation on DevCenter, there was an issue in the description and also I’ve added some more details :slight_smile: Here you can find the documentation for the finish endpoint, the issue was that the description mentioned config_id field in the request body, however it has to be called config. Sorry for the inconvenience!

Hi @viktorbenei, have you got more info about « Trigger Build » ? Indeed there is a solved FR which seems to be related or maybe I misunderstand something… :face_with_monocle: Was there any rollback ? Thanks.

Hi @jessyhanzo what’s the issue you’re facing exactly? Don’t forget you can contact us on our on-site chat anytime! :slight_smile:

Hey - just following on as I feel like I’m seeing the same issue regarding your build trigger docs.

Within that you don’t mention how to trigger a build just using Personal Access Token which was discussed and apparently implemented here:

Just wondering if this was still the case & something got missed from the trigger docs or whether that’s changed?

@gergelybekesi is the documentation (swagger) update?

Is this is what you are looking for?

" POST /apps/{APP-SLUG}/builds Trigger a new build."

This is still missing in swagger docs but API works.

1 Like

It looks like it - just to confirm that this does or doesn’t required the build_token? I’m trying to create something which can start a new build just from what I get from the API rather than users having to trundle through the web interface if that’s at all possible.

Could very well be my misunderstanding from that other link I posted

Doesn’t require build token, only your API access key. I use it in my desktop client (https://github.com/deszip/BitBot) and it works just fine.

1 Like

That’s exactly it then, thanks!

1 Like

Guys! Could you help me with the register-ssh-key endpoint?
For every time the request was sent, I receive:
{
“error_msg”: “Failed to register SSH key for service: bitbucket. Try to register the Public Key manually on bitbucket.”,
“error_type_code”: 2
}

I checked my bitbucket account, it’s integrated and the ssh keys are generated correctly with key type RSA.

Please allow bitrise.yml to be sent as a binary using cUrl:

curl -X POST
  -H 'Authorization: token ACCESS-TOKEN'
  https://api.bitrise.io/v0.1/apps/APP-SLUG/bitrise.yml
  --data-binary @bitrise.yml
2 Likes

Not sure if this should be in a new thread somewhere but the API for listing workflows shows even deleted workflows. I guess this could be intentional but perhaps it should be optional.

Hello, is there any chance there will be an API to query the details of a build?

I know we have this endpoint " /apps/{app-slug}/builds/{build-slug}", but it only gives the data about the workflow, but I’m looking to query data for every individual step as well, like the start and stop time of each step, or the total time a step spent. For example, at the end of each build we can see the “bitrise summary”, which is something we would like to get via API for metrics purposes:

@sukoh Thanks for the #feature-request! We’ll definitely consider this :slight_smile: