---
tags: English
---
# SideeX WebService Web API
- *http://{publicURL_in_serviceconfig}/sideex-webservice/runTestSuites*
- Description: Use the API to run test cases
- HTTP method: `POST`
- Accepted content types: `multipart/form-data`
- Arguments
- `file`: File contents via `multipart/form-data`. The `file` should be a zip file containing test case information.
- Response
- The API will return a `token` which can be further used to get the test case execution state and test report via the other APIs.
```json=
{
"token": "xxxx"
}
```
- *http://{publicURL_in_serviceconfig}/sideex-webservice/getState*
- Description: Get the current test case execution state
- HTTP method: `GET`
- Accepted content types: `form-data`
- Arguments
- `token`: The token returned from the *sideex-webservice/runTestSuites* API
- Response
- If the token is `invalid`, the response will be
```json=
{
"ok": false,
"errorMessage": "invalid_token"
}
```
- If the token is `valid` and the state is `running`, the response will be
```json=
{
"ok": true,
"webserviceState": {
"state": "running"
}
}
```
- If the token is `valid` and the state is `complete`, the response will be
```json=
{
"ok": true,
"webserviceState": {
"state": "complete"
},
"reports": {
"url": "http://{publicURL_in_serviceconfig}/sideex-webservice/downloadReports?token=xxxx",
"passed": true,
"summarry": [
{
"Suites": ["Test_Suite_1"],
"SideeXVersion": [3,3,7],
"Browser": "chrome 81.0.4044.138",
"Platform": "windows",
"Language": "(default)",
"StartTime": 1589867469846,
"EndTime": 1589867472874,
"PassedSuite": 1,
"TotalSuite": 1,
"PassedCase": 1,
"TotalPassedCase": 1
}
]
},
"logs": {
"url": "http://{publicURL_in_serviceconfig}/sideex-webservice/downloadLogs?token=xxxx"
}
}
```
- If the token is `valid` and the state is `error`, the response will be
```json=
{
"ok": true,
"webserviceState": {
"state": "error",
"errorMessage": "{error_message}"
},
"logs": {
"url": "http://{publicURL_in_serviceconfig}/sideex-webservice-logs?token=xxxx"
}
}
```
- *http://{publicURL_in_serviceconfig}/sideex-webservice/downloadReports?token=xxxx*
- Description: View the HTML test reports
- HTTP method: `GET`
- Accepted content types: `application/x-www-form-urlencoded`
- Arguments
- `token`: The token returned from the *sideex-webservice/runTestSuites* API
- `file`: This argument is optional. If set `file` to `reports.zip`, the API will return a zip file containing all HTML reports, otherwise, it will return an HTML index webpage.
- Response
- If the token is valid, a zip file or an HTML index webpage will be returned.
- If the token is invalid, the response wil be
```json=
{
"ok": false,
"errorMessage": "invalid_token"
}
```
- *http://{publicURL_in_serviceconfig}/sideex-webservice/downloadLogs?token=xxxx*
- Description: Download the logs as a zip file
- HTTP method: `GET`
- Accepted content types: `application/x-www-form-urlencoded`
- Arguments
- `token`: The token returned from the *sideex-webservice/runTestSuites* API
- Response
- If the token is valid, a zip file will be returned.
- If the token is invalid, the response wil be
```json=
{
"ok": false,
"errorMessage": "invalid_token"
}
```
- *http://{publicURL_in_serviceconfig}/sideex-webservice/deleteJob*
- Description: Delete the test case and the test reports
- HTTP method: `POST`
- Accepted content types: `multipart/form-data`, `application/x-www-form-urlencoded`
- Arguments
- `token`: The token returned from the *sideex-webservice/runTestSuites* API
- Response
- If success, the response will be
```json=
{
"ok": true, "state": "delete_complete"
}
```
- If the token is invalid, the response will be
```json=
{
"ok": false, "errorMessage": "invalid_token"
}
```
- If the test case is running, the response will be
```json=
{
"ok": false, "errorMessage": "testcase_is_running"
}
```