Skip to content

Commit

Permalink
Updated Testsigma API Overview doc (#315)
Browse files Browse the repository at this point in the history
Updated Testsigma API Overview doc with GET IDs of Projects, Applications and Uploads content.
  • Loading branch information
bharathk08 authored Oct 31, 2023
1 parent 10d711d commit 75088db
Show file tree
Hide file tree
Showing 2 changed files with 106 additions and 19 deletions.
19 changes: 9 additions & 10 deletions src/pages/docs/api/examples/update-test-case-results-using-API.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,34 +6,32 @@ noindex: false
order: 21.65
page_id: "Update Test Case results using API"
warning: false
contextual_links:
- type: section
name: "Contents"
- type: link
name: "Update Test Case results using REST API"
url: "#update-test-case-results-using-rest-api"
---

<br>
---

In Testsigma, you can update the Test Case Results using API. This article discusses how to update Test Case results as Passed, Failed, and Not Executed using REST API.


This endpoint allows users to update the Test Case result using REST API.


|**Request Type**|**PUT**|
|---|---|
|**Endpoint**|https://app.testsigma.com/api/v1/executions/results/&lt;run_id&gt;/override<br> The &lt;run_id&gt; can be obtained from the Run Results.|
|**Endpoint**|https://app.testsigma.com/api/v1/execution_results/&lt;run_id&gt;/override<br> The &lt;run_id&gt; can be obtained from the Run Results.|
|**Authorization**|Bearer **<API\_Token>**<br>Same as the Testsigma API key mentioned above.|
|**Request Body Type (JSON)**|Raw|
|**Request Body**|[<br>{<br>"testCaseResultId": 3646,<br>"comment": "Modifying the results 1",<br>"result": "SUCCESS"<br>}<br>]<br>|
|**Response Body(JSON)**|{<br>"errors": [],<br>"message": "Overridden the results successfully"<br>}|

**Request fields**<br>

### **Request fields**
**testCaseResultId:** ID of Test Case result.<br>
**comment:** Comment you want to add to change the result.<br>
**result:** The result you want to override the current result.<br>

**Response fields**<br>

### **Response fields**
**errors:** Errors in request fields if there are any.<br>
**message:** Message of overridden results.<br>

Expand All @@ -47,3 +45,4 @@ This endpoint allows users to update the Test Case result using REST API.



---
106 changes: 97 additions & 9 deletions src/pages/docs/api/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ contextual_links:
- type: link
name: "Authorization"
url: "#authorization"
- type: link
name: "Get IDs of Projects, Applications and Uploads"
url: "#get-ids-of-projects-applications-and-uploads"
- type: link
name: "Available REST API Endpoints"
url: "#available-rest-api-endpoints"
Expand All @@ -23,29 +26,114 @@ contextual_links:

Testsigma has a set of REST API Endpoints to manage the entities available in Testsigma. The most common usage of these endpoints is within your CI/CD Pipeline.

A fair understanding of REST APIs is expected. If not, please refer to some relevant resources regarding REST API or consult with your Dev team before proceeding further.
A fair understanding of REST APIs is expected. If not, please refer to some relevant resources regarding REST API or consult with your dev team before proceeding further.

---
##**Authorization**

## **Authorization**

All Testsigma API Endpoints require authentication. The user authenticates the request using Bearer Token which is the user’s API Key.

**“Authentication” : “Bearer <API_key>”**
**“Authentication” : “Bearer <API_Key>”**

To know more about generating and obtaining API Keys, see [how to generate API keys](https://testsigma.com/docs/configuration/api-keys/)

To know more about generating and obtaining API Keys, see [How to generate API Keys](https://testsigma.com/docs/configuration/api-keys/)

---
##**Available REST API Endpoints**

## **Get IDs of Projects, Applications and Uploads**


Testsigma has a set of endpoints to retrieve IDs of projects, applications, and uploads using APIs. This article discusses getting these IDs by using APIs.


### **Get IDs using Postman API**

1. From **My Workspace**, go to **APIs** and click on ‘**+**’ to open a new request.
![APIs](https://s3.amazonaws.com/static-docs.testsigma.com/new_images/projects/applications/pmapis.png)


2. From the new request page, select **GET** from the method dropdown.
![GET Method](https://s3.amazonaws.com/static-docs.testsigma.com/new_images/projects/applications/pmgetmethod.png)


3. On the **URL Textbox**,
![URL Textbox](https://s3.amazonaws.com/static-docs.testsigma.com/new_images/projects/applications/pmurltb.png)
- Enter https://app.testsigma.com/api/v1/projects to get project IDs.
- Enter https://app.testsigma.com/api/v1/applications to get application IDs.
- Enter https://app.testsigma.com/api/v1/uploads to get upload IDs.


Let’s use the first URL & retrieve the IDs of projects.


4. Click on **Authorization**, select **Authorization type** and enter the **Token**.
![Authorization](https://s3.amazonaws.com/static-docs.testsigma.com/new_images/projects/applications/pmauthapi.png)

5. Click on **Send** to retrieve details of all projects.
![Send](https://s3.amazonaws.com/static-docs.testsigma.com/new_images/projects/applications/pmrbsend.png)

6. You’ll find IDs of all projects in the response body.
![IDs](https://s3.amazonaws.com/static-docs.testsigma.com/new_images/projects/applications/pmidfrb.png)

Follow the same steps from 4-6 with the other URLs mentioned in step 3 to get details of applications and uploads.

Here’s a quick GIF demonstrating how to retrieve IDs of projects, applications, and uploads using APIs in Postman.
![Workflow to retrive URL](https://s3.amazonaws.com/static-docs.testsigma.com/new_images/projects/applications/getidspostman.gif)


### **Get IDs using Testsigma API**

1. Create a **Test Case** by navigating to **Create Tests > Test Cases**.
![Test Case](https://s3.amazonaws.com/static-docs.testsigma.com/new_images/projects/applications/tsapitc.png)


2. Add a **REST API Step**.
![REST API Test Step](https://s3.amazonaws.com/static-docs.testsigma.com/new_images/projects/applications/tsrestspiteststep.png)


3. On the **REST API** page, select **GET** from the method dropdown.
![GET Method](https://s3.amazonaws.com/static-docs.testsigma.com/new_images/projects/applications/tsgetmthod.png)

4. On the **URL Textbox**,
![URL Textbox](https://s3.amazonaws.com/static-docs.testsigma.com/new_images/projects/applications/tsurltb.png)
- Enter https://app.testsigma.com/api/v1/projects to get project IDs.
- Enter https://app.testsigma.com/api/v1/applications to get application IDs.
- Enter https://app.testsigma.com/api/v1/uploads to get upload IDs.

Let’s use the second URL & retrieve the IDs of applications.


5. Click on **Authorization**, select **Authorization type** and enter the **Token**.
![Authorization](https://s3.amazonaws.com/static-docs.testsigma.com/new_images/projects/applications/tsapiauth.png)


6. Click on **Send** to retrieve details of all applications.
![Send](https://s3.amazonaws.com/static-docs.testsigma.com/new_images/projects/applications/tssendapi.png)

7. You’ll find IDs of all applications in the response body.


Here’s a quick GIF demonstrating how to retrieve IDs of projects, applications, and uploads using APIs in Testsigma.
![Workflow](https://s3.amazonaws.com/static-docs.testsigma.com/new_images/projects/applications/getidtestsigma.gif)

---

## **Available REST API Endpoints**

1. [Environments](https://testsigma.com/docs/api/environments/)
2. [Elements](https://testsigma.com/docs/api/elements/)
3. [Test Plans](https://testsigma.com/docs/api/test-plans/)
4. [Uploads](https://testsigma.com/docs/api/upload-files/)

---
##**Advanced Use Cases**
Here are some advanced use cases for Testsigma APIs

[Trigger Multiple Application Type Test Plans](https://testsigma.com/docs/api/examples/trigger-multiple-test-plans/)
## **Advanced Use Cases**

Here are some advanced use cases for Testsigma APIs:

- [Trigger Multiple Application Type Test Plans](https://testsigma.com/docs/api/examples/trigger-multiple-test-plans/)

[Trigger Test Plan remotely and wait until Completion](https://testsigma.com/docs/api/examples/trigger-test-plan-wait-completion/)
- [Trigger Test Plan remotely and wait until Completion](https://testsigma.com/docs/api/examples/trigger-test-plan-wait-completion/)

---

0 comments on commit 75088db

Please sign in to comment.