Page tree
Skip to end of metadata
Go to start of metadata
  • All actions are also available for project admins and users


URLMethodParametersresults
/api/v1/applicationsGET
  • packageName (optional) string - package name for Android
  • mainActivity (optional) string - main activity of android app
  • uniqueName (optional) string
  • osType (optional) - iOS / Android
  • bundleIdentifier (optional) string - application bundle id (only for iOS)
  • version (optional) string - app version
  • releaseVersion (optional) string - app release version
  • cameraSupport (optional) boolean - true / false
  • isForSimulator (optional) boolean - true / false
  • instrumentByProfile (optional) string
  • nonInstrumented (optional) boolean - true / false
  • hasCustomKeystore (optional) boolean - true / false

Without parameters - Gets a collection of all the applications this user has access to

If parameters were added - Gets a filtered collection of application.

  • The filter is defined by specifying the required property-name = property-value concatenated with commas.
  • When adding "fields=id" to the query, only the ids of the applications would be returned.


Examples

/api/v1/applications?osType=android&fields=id - would return only ids of the android applications

/api/v1/applications?osType=ios&version=1050 - would return ios applications which version is 1050

/api/v1/applications/newPOST

file - a multi-part file

camera (optional) boolean, true means that application will include camera libraries

touchId(optional) boolean, true means that application will include touch id libraries

uuid (optional) - profile to use on install

uniqueName (optional) - string that the user can use later to identify the app uniquely. (Appium, SeeTest)

project - mandatory for Cloud Administrator.


Users and Project Admins: should not use project parameter (it will not be used even if they provide it) Application will be uploaded to their login project

Custom Keystore (optional)

The following 4 parameters are used to upload a customkeystorefor this particular application.  If any of these are supplied, all should be supplied.

keystore- file (multipart) - containing the customkeystore

keystorePassword - string - thekeystorepassword.

keyAlias - string - the key alias to be used.

keyPassword - string - the key password.

Gets the id of the uploaded application.

Uploads the application file to the cloud.

If a uuid is given (iOS), the selected provisioning profile will be used for installation.

Project to which application will be assigned. Project name can be provided or a project id in the following format:

key: project value: id:<id>. For example key: project value: id:123

Custom Keystore

If a customkeystoreis supplied, it will be used for every subsequent (re)instrumenting of this app.

The Cloud UI will show a "Custom Keystore: Yes" indication in the application info panel for such applications.

/api/v1/applications/new-from-urlPOST

url - a string specifying the location from which to retrieve the application file

camera (optional) boolean, true means that application will include camera libraries

touchId(optional) boolean, true means that application will include touch id libraries

uuid (optional) - profile to use on install

uniqueName (optional) - string that the user can use later to identify the app uniquely. (Appium, SeeTest)

project - mandatory for Cloud Administrator.


Users and Project Admins: should not use project parameter (it will not be used even if they provide it) Application will be uploaded to their login project

Custom Keystore (optional)

The following 4 parameters are used to upload a customkeystorefor this particular application.  If any of these are supplied, all should be supplied.

keystore- file (multipart) - containing the customkeystore

keystorePassword - string - thekeystorepassword.

keyAlias - string - the key alias to be used.

keyPassword - string - the key password.

Gets the id of the uploaded application.

Uploads the application file to the cloud.

This call is exactly like /api/v1/applications/new, except that the application file is not provided as part of the call, but instead the url parameter specifies where to get the file.

If a uuid is given (iOS), the selected provisioning profile will be used for installation.

Project to which application will be assigned. Project name can be provided or project id in the following format: id:<id>. For example key: project value: id:<id>. For example key:project value: id:123

Custom Keystore

If a customkeystore is supplied, it will be used for every subsequent (re)instrumenting of this app.

The Cloud UI will show  a "Custom Keystore: Yes" indication in the application info panel for such applications.

/api/v1/applications/{applicationId}/deletePOST{applicationId} - the id of the application

Deletes an application file from the cloud

/api/v1/applications/{applicationId}/installPOST

{applicationId} - the id of the application

deviceId (optional) - id of device to install on

devicesList (optional) - list of id of devices (i.e. 1,2,3)

AllDevices (optional) - true

Exactly one of 3 previous flags must be used: deviceId / devicesList / AllDevices

instrument (optional) - true / false (Default is false)

Installs the application on the device/devices.

  • AllDevices=true is a short way to gives the id of all devices that are of the application's OS and are in an online status

instrument

  • true - the instrumented application will be installed.
  • false - the non-instrumented application will be installed.

Since version 11.0 default is instrument=false

/api/v1/applications/{applicationId}/uninstallPOST

{applicationId} - the id of the application

deviceId (optional) - id of device to install on

devicesList (optional) - list of id of devices (i.e. 1,2,3)

AllDevices (optional) - yes

Uninstalls the application from the device/devices.

  • AllDevices=yes is a short way to give the id of all devices that are of the application's OS and are in an online status



The examples below use the Unirest HTTP library.  To compile and run them, use the following Maven dependency:

<dependency>
    <groupId>com.mashape.unirest</groupId>
    <artifactId>unirest-java</artifactId>
    <version>1.4.9</version>
</dependency>


or Gradle dependency:

dependencies {
	compile group: 'com.mashape.unirest', name: 'unirest-java', version: '1.4.9'
}


Code Examples

AddApplicationToCloud
import org.junit.*; 
import com.mashape.unirest.http.HttpResponse; 
import com.mashape.unirest.http.Unirest; 
import com.mashape.unirest.http.exceptions.UnirestException; 


public class FromFile() {

	String urlBase = "http://localhost:8088/"; // modify hostname and port as applicable your environment 
	String user = "admin"; 
	String password = "......."; // modify the admin password as applicable your environment 
	String url = urlBase + "api/v1/applications/new"; 
	Sting uniqueName = "SomeName"; 

	@Test 
	public void newAppFromFile () throws UnirestException { 
		File f = new File(path_to_file); 
		HttpResponse<String> response = Unirest.post(url) 
			.basicAuth (user, password) 
			.queryString("project", "id:"+projectId) // mandatory for Cloud Administrator 
			.queryString("uniqueName", uniqueName) // optional field 		
			.queryString("camera", "true") // optional field 
			.queryString("touchId", "true") // optional field 
			.field ("file", f) // mandatory field 
			.asString (); 
		System.out.println(response.getBody());
 	} 
}
Add application to cloud from URL
import org.junit.*; 
import com.mashape.unirest.http.HttpResponse; 
import com.mashape.unirest.http.Unirest; 
import com.mashape.unirest.http.exceptions.UnirestException; 

public class FromUrl(){
	String urlBase = "http://localhost:8088/"; // modify hostname and port as applicable your environment 
	String user = "admin"; String password = "......."; // modify the admin password as applicable your environment 
	String applicationUrl = "http://......../"; // modify as needed 
	Sting uniqueName = "SomeName"; 


	@Test 
	public void newAppFromUrl () throws UnirestException { 
		String url = urlBase + "api/v1/applications/new-from-url"; 
		HttpResponse<String> response = Unirest.post(url) 
			.basicAuth (user, password) 
			.queryString ("url", applicationUrl) 
			.queryString("project", "id:"+projectId2) // mandatory field for cloud administrators 
			.queryString("camera", "true") // optional field 
			.queryString("touchId", "true") // optional field 
			.queryString("uniqueName",uniqueName) // optional field 
			.asString (); 
		System.out.println(response.getBody()); 
	}
}
GetApplications
import org.junit.*;
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;
import com.mashape.unirest.http.exceptions.UnirestException;

public class GetApplications(){
	String urlBase = "http://localhost:8088/"; // modify hostname and port as applicable your environment
	String user = "admin";
	String password = "......."; // modify the admin password as applicable your environment

	@Test
	public void getApplications() throws UnirestException {
		String url = urlBase + "api/v1/applications"
		System.out.println(url);
		HttpResponse<String> response = Unirest.get(url)
			.basicAuth (user, password)
			.asString ();
		System.out.println (response.getBody());     
	}
}
DeleteApplicationFromCloud
import org.junit.*;
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;
import com.mashape.unirest.http.exceptions.UnirestException;


public class DeleteApplications{

  String urlBase = "http://localhost:8088/"; // modify hostname and port as applicable your environment
  String user = "admin";
  String password = "......."; // modify the admin password as applicable your environment
  Sting application_id= ".."; // ID of the application we wish to delete


  @Test
  public void deleteApplication() throws UnirestException {
     String url = urlBase + "api/v1/applications/"+ application_id + "/delete";
     HttpResponse<String> response = Unirest.post(url)
      .basicAuth (user, password)
      .asString ();
    System.out.println (response.getBody());
  }
} 
UninstallApplication
import org.junit.*;
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;
import com.mashape.unirest.http.exceptions.UnirestException;

public UninstallApplication(){
	
	String urlBase = "http://localhost:8088/"; // modify hostname and port as applicable your environment
	String user = "admin";
	String password = "......."; // modify the admin password as applicable your environment
	String application_id=".." // ID of the application we wish to uninstall
	
	@Test
	public void uninstallAppAPI() throws UnirestException {
		String url = urlBase + FOLDER_URL + APPLICATIONS_URL + "/" + application_id + "/uninstall";
		HttpResponse<String> response = Unirest.post(url)
				.basicAuth (user, password)
				.queryString("AllDevices", "yes")
				.asString ();
		System.out.println (response.getBody());  
	}  
}
InstallApplication
import org.junit.*;
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;
import com.mashape.unirest.http.exceptions.UnirestException;

public InstallApplication(){
	
	String urlBase = "http://localhost:8088/"; // modify hostname and port as applicable your environment
	String user = "admin";
	String password = "......."; // modify the admin password as applicable your environment
	String application_id=".." // ID of the application we wish to install
	String device_id = ".." // ID of the device we want to install on
	
	@Test
	public void installAppAPI() throws UnirestException {
		String url = urlBase + /api/v1/applications + "/" + application_id +"/install";
		System.out.println(url);
		HttpResponse<String> response = Unirest.post(url)
				.basicAuth (user, password)
				.queryString("deviceId", device_id)
				.queryString("instrument", "true") // or "false" - optional field
				.asString ();
		System.out.println (response.getBody());     
	}
}
  • No labels