Bitbar Testing API
For continued mobile development project Bitbar Testing can be integrated to your continuous integration environment and tests run through API rather than manually uploading and configuring test projects.
Bitbar Testing provides a very powerful and useful API for its users to manage all aspects of mobile development and testing automatically. The API allows access to our device farm, manage projects, test runs and results, plus many other things through a RESTful architecture returning JSON structures with appropriate HTTP response codes.
A good starting point on using REST communication can be found here.
Full API documentation is available here.
By default all of the api calls respond in XML format. To switch to JSON_ format, include header
Accept: application/json to the header.
Note that all request timeouts are in seconds.
This example shows how to get access to Bitbar Testing Cloud using the API. Bitbar Testing API uses OAuth 2.0 - an open standard for authorization. The OAuth 2.0 focuses on client developer simplicity while providing specific authorization flows for web apps. As it is seamlessly used with Bitbar Testing API, you can use it to authorize further API calls to our cloud back-end.
An optional, but better suited for shared scripts, is to identify user using the apiKey approach. An apiKey is a secret token that is available from Bitbar Testing from under My Account link. If needed the apiKey token can also be re-generate to invalidate old scripts.
curl -H "Accept: application/json" -u xYY5hsdPXAXsBBd1G3ijnb18wlqPeOA6: https://cloud.testdroid.com/api/me
Create a Bitbar Testing Project
To create a new project from the command line using cURL and apiKey:
curl -H "Accept: application/json" -u xYY5hsdPXAXsBBd1G3ijnb18wlqPeOA6: -X POST -d "name=NewProject" https://cloud.testdroid.com/api/me/projects
Returns project listing containing details, Test Runs and Device Runs (accept application JSON).
curl -H "Accept: application/json" -u xYY5hsdPXAXsBBd1G3ijnb18wlqPeOA6: -X GET https://cloud.testdroid.com/api/me/projects
Details of a Specific Project
Query the details of a specific project defined by the project’s id PROJECT_ID and authenticating using apiKey:
curl -H "Accept: application/json" -u xYY5hsdPXAXsBBd1G3ijnb18wlqPeOA6: -X GET https://cloud.testdroid.com/api/me/projects/PROJET_ID
Get Test Run Details
Get a test run’s details by authenticating using the apiKey:
url -H "Accept: application/json" -u xYY5hsdPXAXsBBd1G3ijnb18wlqPeOA6: -X GET https://cloud.testdroid.com/api/me/projects/PROJECT_ID/runs
Get Details of Certain Device Run
Authenticating using the API key:
url -H "Accept: application/json" -u xYY5hsdPXAXsBBd1G3ijnb18wlqPeOA6: -X GET https://cloud.testdroid.com/api/me/projects/PROJECT_ID/runs/RUN_ID/device-runs