Testsigma provides a robust API to manage the Executions and Execution Data using RESTful API Calls. Below given are some of the utilities provided by Testsigma API.

Note: We need to make sure the API request is authenticated. Otherwise, it may return a 401 Unauthorized Error as response.


1. Starting a Test Plan Execution (POST)

Request URL
https://app.testsigma.com/api/v1/execution_results
Request Header
Content-type: application/json
Request BodyNo Additional Body Content required
Expected ResponseJSON response with RUN_ID and other Testplan execution details.


CURL command Format:

ccurl -X POST -H "Content-type: application/json" -H "Accept:application/json" -H "Authorization: Bearer <API_KEY>" https://app.testsigma.com/api/v1/execution_results -d "{\"executionId\": \"<EXECUTION_ID>\"}"


API_KEY : You can use an existing API KEY or can generate a new one  from Testsigma Application(Settings-->API Keys)

EXECUTION_ID:  Every test plan will have an execution id that does not change. You can find the execution ID under Test Plans--><TEST_PLAN_NAME>-->CI/CD Integrations . 

In below Image 233 is the Execution ID of Test Plan with the name "Add Item to Cart".



For more details on Test Plan execution related REST APIs, refer to the article - Start/Trigger an execution in Testsigma using REST API

2. Uploading APK/IPA/Attachment files to Testsigma Uploads (POST)

Base URL
https://app.testsigma.com/api/v1/uploads
Response TypeJSON


CURL command Format:

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"' \
--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 more details, refer the article Uploading files to Testsigma Uploads using REST API



3. Global/Environment Parameters 


For Global Parameters REST API details, refer article Creating and Updating Global/Environment Parameters using REST API