Testsigma allows you to use REST API to upload files. This allows you to use the latest builds for executing the Tests.


New File Upload API

Here's a sample format for the new Upload API:


Request Format

curl - u "<username>:<password>" - X POST http://app.testsigma.com/rest/storage/upload -H "Content-Type=multipart/form-data" -F "app=@</path/to/the/apkfile.apk>" 
-F 'data={
"name": "<app_name>",
"type": "<file_type>",
"version": "<version_name>",
"project": "<Project_name>"
};type = application/json'


Parameters Explanation

  • The login details for your Testsigma Account need to be specified in <username>:<password>
  • The API endpoint for the REST Call
http://app.testsigma.com/rest/storage/upload
  • The location of the file to be uploaded is given by the 'app' parameter. The '@' symbol needs to be a prefix to the file path. It will throw an error if the file is not present or accesible.
  • The name of the file can be given in the 'name' parameter.
  • The extension or type of the file can be given in the 'type' parameter.
  • The version of the file can be given in the 'version' parameter.
  • The Project under which the file is to be uploaded needs to be specified as 'project' parameter. It will throw an error if an existing project with the provided name is not available.


Response Format

{
  "id": < id > ,
  "createdBy": null,
  "createdDate": < created_date > ,
  "updatedBy": < name > ,
  "updatedDate": < name > ,
  "active": 1,
  "projectId": < project_id > ,
  "name": "<upload_name>",
  "appPath": "<server_file_path>",
  "fileName": < file_name > ,
  "type": 1,
  "version": "<version_name>",
  "testsigmaAppId": "<testsigma_app_id>",
  "browserstackAppId": < id > ,
  "sauselabsAppId": < sauce_id > ,
  "platformType": < platform_id > ,
  "isPublic": null,
  "uploadStatus": 1,
  "comments": null,
  "message": "<message>",
  "status": 1,
  "nameFromApp": null,
  "versionFromApp": null,
  "fileSize": < uploaded_file_size >
}


The "testsigmaAppId" is the most important value in this response and we need to use it for further updations to the file.




Update File API

Here's a sample format for the API to update existing files:


Request Format

curl - u "<username>:<password>" - X PUT http://app.testsigma.com/rest/storage/upload/<id> -H "Content-Type=multipart/form-data" -F "app=@</path/to/the/apkfile.apk>" -F 'data=
{
"name": "<app_name>",
"version": "<version_name>",
"project": "<Project_name>"
}
;type = application/json'


Parameters:

  • The login details for your Testsigma Account - <username>:<password>
  • The API endpoint for the REST Call where <id> denotes App ID for previously uploaded file. The "testsigmaAppId" from the response of file upload can be used here.
http://app.testsigma.com/rest/storage/upload/<id>
  • The location of the file to be uploaded is given by the 'app' parameter. The '@' needs to be prepended to the file path
  • The name of the file can be given in the 'name' parameter.
  • The version of the file can be given in the 'version' parameter.
  • The Project under which the file is to be uploaded needs to be specified as 'project' parameter. It will throw an error if an existing project with the provided name is not available.


Response Format

{
  "id": < id > ,
  "createdBy": null,
  "createdDate": < created_date > ,
  "updatedBy": < name > ,
  "updatedDate": < name > ,
  "active": 1,
  "projectId": < project_id > ,
  "name": "<upload_name>",
  "appPath": "<server_file_path>",
  "fileName": < file_name > ,
  "type": 1,
  "version": "<version_name>",
  "testsigmaAppId": "<testsigma_id>",
  "browserstackAppId": < id > ,
  "sauselabsAppId": < sauce_id > ,
  "platformType": < platform_id > ,
  "isPublic": null,
  "uploadStatus": 1,
  "comments": null,
  "message": "<message>",
  "status": 1,
  "nameFromApp": null,
  "versionFromApp": null,
  "fileSize": < uploaded_file_size >
}