REST API
App Live supports REST API to upload, view and delete apps via command line interface or automation scripts.
Upload App
An API to upload the App you want to test on the BrowserStack servers for interactive app testing. Use it to upload via CLI or automation scripts. Uploaded apps are automatically shared with all team members, allowing you to test collaboratively.
curl -u "USERNAME:ACCESS_KEY" -X POST "https://api-cloud.browserstack.com/app-live/upload" -F "file=@/path/to/app/file/Application-debug.apk"
Upload app from a Public Location
If you do not have your app file on the local machine from where you are running the test and it is hosted on a different location, you can upload it to the BrowserStack servers from any public hosted location. You can achieve that by just providing the app public url in the API call to upload an app. The url should be accessible over the internet so that BrowserStack can directly upload it from that location. Use the below API call to upload app from a publicly accessible location.
curl -u "USERNAME:ACCESS_KEY" -X POST "https://api-cloud.browserstack.com/app-live/upload" -F "data={\"url\": \"https://www.browserstack.com/app-live/sample-apps/android/WikipediaSample.apk\"}"
Define Custom Id for your app
You can choose to set a custom_id for your apps. You can use this custom_id while executing your test in step 3. Every time you upload an app with the same custom id, the test execution will pick the last uploaded app for the custom_id you used. Custom Id is optional.
curl -u "USERNAME:ACCESS_KEY" -X POST "https://api-cloud.browserstack.com/app-live/upload" -F "file=@/path/to/app/file/Application-debug.apk" -F "data={\"custom_id\": \"MyApp\"}"
Get recent uploads
An API to retrieve details about your recent App uploads. The response will not include the deleted apps
curl -u "USERNAME:ACCESS_KEY" -X GET "https://api-cloud.browserstack.com/app-live/recent_apps"
Get recent uploads for custom id
An API to retrieve details about your recent App uploads under a specific custom id. The response will not include the deleted apps
curl -u "USERNAME:ACCESS_KEY" -X GET "https://api-cloud.browserstack.com/app-live/recent_apps/<custom_id>"
Get recent uploads for entire group
An API to retrieve details about your recent App uploads for the entire group. The response will not include the deleted apps
curl -u "USERNAME:ACCESS_KEY" -X GET "https://api-cloud.browserstack.com/app-live/recent_group_apps"
Delete App
An API to DELETE an uploaded App
curl -u "USERNAME:ACCESS_KEY" -X DELETE "https://api-cloud.browserstack.com/app-live/app/delete/<app_id>"
Parameters
Limits
To further refine the results, you can specify how many of the results should be displayed by using the parameter limit. The default value is 10. The following example restricts the number of displayed results to 5.
curl -u "USERNAME:ACCESS_KEY" -X GET "https://api-cloud.browserstack.com/app-live/recent_apps?limit=5"