Testsigma supports uploading Files to the Uploads section using REST API. One of the most prominent use case for this is updating the already uploaded app with the latest build or updating a test file periodically without manual process.


                                          Uploading new File to an Application


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

Request Format - cURL

curl --location --request POST 'https://app.testsigma.com/api/v1/uploads' --header 'Authorization: Bearer <API_KEY>' \
--form 'projectId="<PROJECT_ID>"' \
--form 'name="<UPLOAD_NAME>"' \
--form 'uploadType="APK/IPA/Attachment"' \
--form 'platformType="TestsigmaLab"' \
--form 'isPublic="true"' \
--form 'applicationId="<APPLICATION_ID>"' \
--form 'fileContent=@"<FILE_PATH>"'

Example:

curl --location --request POST 'https://app.testsigma.com/api/v1/uploads' --header 'Authorization: Bearer **********' \
--form 'projectId="106"' \
--form 'name="test-app"' \
--form 'uploadType="APK"' \
--form 'platformType="TestsigmaLab"' \
--form 'isPublic="true"' \
--form 'applicationId="136"' \
--form 'fileContent=@"/Users/$USER/Downloads/test-app.apk"'

For fetching Project ID and Application ID, refer article How to get Project ID and Application ID

Parameters Explanation

  • API_KEY : API Authentication key which is available under Testsigma--->Settings-->API Keys
  • The API endpoint for the REST Call
https://app.testsigma.com/api/v1/uploads
  • 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 inaccessible.
  • 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(IPA, APK, or Attachment)

Response Format

{
  "id": < id > ,
  "projectId": < project_id > ,
  "name": "<upload_name>",
  "appPath": "<server_file_path>",
  "fileName": < file_name > ,
  "uploadType": APK/IPA/Attachment,
  "platformType": < platform_id > ,
  "isPublic": null,
  "uploadStatus": 1,
  "comments": null,
  "uploadStatus": "In Progress/Completed"
}

                                                  

Update an existing Upload


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

Request Format - cURL

curl --location --request PUT 'https://app.testsigma.com/api/v1/uploads/<UPLOAD_ID>' \
--header 'Authorization: Bearer <API_KEY>' \
--form 'projectId="<PROJECT_ID>"' \
--form 'name="<UPLOAD_NAME>"' \
--form 'uploadType="APK/IPA/Attachment"' \
--form 'platformType="TestsigmaLab"' \
--form 'applicationId="<APPLICATION_ID>"' \
--form 'fileContent=@"<FILE_PATH>"'

Example:

curl --location --request PUT 'https://app.testsigma.com/api/v1/uploads/144' \
--header 'Authorization: Bearer ********' \
--form 'projectId="106"' \
--form 'name="Sample-app-2"' \
--form 'uploadType="APK"' \
--form 'platformType="TestsigmaLab"' \
--form 'applicationId="136"' \
--form 'fileContent=@"/Users/$USER/Downloads/Sample_V1.apk"'


Parameters Explanation

  • API_KEY : API Authentication key which is available under Testsigma--->Settings-->API Keys
  • The API endpoint for the REST Call
https://app.testsigma.com/api/v1/uploads
  • 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 inaccessible.
  • 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(IPA, APK, or Attachment)

Response Format

{
  "id": < id > ,
  "projectId": < project_id > ,
  "name": "<upload_name>",
  "appPath": "<server_file_path>",
  "fileName": < file_name > ,
  "uploadType": APK/IPA/Attachment,
  "platformType": < platform_id > ,
  "isPublic": null,
  "uploadStatus": 1,
  "comments": null,
  "uploadStatus": "In Progress/Completed"
}


API to get details of a specific Uploaded file

curl --location --request GET 'https://app.testsigma.com/api/v1/uploads/<UPLOAD_ID>' \
--header 'Authorization: Bearer <API_KEY>'

API to get details of all available Uploads in an Application:


curl --location --request GET 'https://app.testsigma.com/api/v1/uploads?query=applicationId:<APPLICATION_ID>' \
--header 'Authorization: Bearer <API_KEY>'


For fetching Project ID and Application ID, refer article How to get Project ID and Application ID