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

api

#83

@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!


#84

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…


#85

@gergelybekesi any suggestion? :thinking:


#86

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:


#87

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!


#88

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…


#89

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!


#90

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.


#91

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:


#92

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?


#93

@gergelybekesi is the documentation (swagger) update?


#94

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.


#95

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


#96

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.


#97

That’s exactly it then, thanks!