# GetProjectTestcasesById

## Parameters

The following URL, Headers and Parameters are required for requests to this API endpoint. Where a parameter is optional, it will be indicated. Otherwise treat all parameters as mandatory.

### Headers

```
GET /api/ss/project/:id/testcases HTTP/1.1
Host: demo.attackforge.com
X-SSAPI-KEY: APIKey
Content-Type: application/json
Connection: close
```

### Query

**id (string)**

Identifier for the project.

Example:

```
GET /api/ss/project/5e64179c899bb708b55ea48c/testcases HTTP/1.1
```

**status (string) (optional)**

Test case status. Must be one of the following: Tested, Not-Tested, In-Progress, Not-Applicable

Example:

```
GET /api/ss/project/5e64179c899bb708b55ea48c/testcases?status=Tested HTTP/1.1
```

**project\_testcase\_cf\_key\_allowlist (string) (optional)**

List of Project Test Case custom field keys to include in response. Add multiple for more than one key e.g. `?project_testcase_cf_key_allowlist=key1&project_testcase_cf_key_allowlist=key2` or specify no keys to exclude all fields e.g. `?project_testcase_cf_key_allowlist=`

Example:

```
GET /api/ss/project/5e64179c899bb708b55ea48c/testcases?project_testcase_cf_key_allowlist=key1&project_testcase_cf_key_allowlist=key2 HTTP/1.1
```

**project\_testcase\_cf\_key\_blocklist (string) (optional)**

List of Project Test Case custom field keys to exclude from response. Add multiple for more than one key e.g. `?project_testcase_cf_key_blocklist=key1&project_testcase_cf_key_blocklist=key2`

Example:

```
GET /api/ss/project/5e64179c899bb708b55ea48c/testcases?project_testcase_cf_key_blocklist=key1&project_testcase_cf_key_blocklist=key2 HTTP/1.1
```

**testcase\_cf\_key\_allowlist (string) (optional)**

List of Test Case custom field keys to include in response. Add multiple for more than one key e.g. `?testcase_cf_key_allowlist=key1&testcase_cf_key_allowlist=key2` or specify no keys to exclude all fields e.g. `?testcase_cf_key_allowlist=`

Example:

```
GET /api/ss/project/5e64179c899bb708b55ea48c/testcases?testcase_cf_key_allowlist=key1&testcase_cf_key_allowlist=key2 HTTP/1.1
```

**testcase\_cf\_key\_blocklist (string) (optional)**

List of Test Case custom field keys to exclude from response. Add multiple for more than one key e.g. `?testcase_cf_key_blocklist=key1&testcase_cf_key_blocklist=key2`

Example:

```
GET /api/ss/project/5e64179c899bb708b55ea48c/testcases?testcase_cf_key_blocklist=key1&testcase_cf_key_blocklist=key2 HTTP/1.1
```

## Example

The following example is a cURL request to get all Tested test cases on a project.

### Request

Include API Token instead of stars in 'X-SSAPI-KEY: \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*' parameter.

```
curl -X GET 'https://demo.attackforge.com/api/ss/project/5e64179c899bb708b55ea48c/testcases?status=Tested' -H 'Host: demo.attackforge.com' -H 'X-SSAPI-KEY: ***************************************' -H 'Content-Type: application/json' -H 'Connection: close'
```

### Response

Response contains an array of test case objects.

```
{
  "count": 999,
  "testcases": [
    {
      "testcase": "...",
      "details": "...",
      "details_html": "...",
      "status": "...",
      "tags": [
        "..."
      ],
      "custom_fields": [
        {
          "key": "...",
          "value": "..."
        }
      ],
      "id": "...",
      "created": "...",
      "locked": "...",
      "last_updated": "...",
      "last_updated_by": "...",
      "notes": [
        {
          "id": "...",
          "note": "...",
          "note_html": "...",
          "created": "...",
          "last_updated": "...",
          "last_updated_by": "...",
          "uploaded_files": [
            {
              "name": "...",
              "full_name": "...",
              "alternative_name": "...",
              "file_type": "...",
              "size": 999,
              "size_kb": 99999,
              "uploaded_on": "..."
            }
          ]
        }
      ],
      "workspace_notes": [
        {
          "id": "...",
          "title": "...",
          "note": "...",
          "note_html": "...",
          "created": "...",
          "last_updated": "...",
          "last_updated_by": "...",
          "uploaded_files": [
            {
              "name": "...",
              "full_name": "...",
              "alternative_name": "...",
              "file_type": "...",
              "size": 999,
              "size_kb": 99999,
              "uploaded_on": "..."
            }
          ]
        }
      ],
      "uploaded_files": [
        {
          "name": "...",
          "full_name": "...",
          "alternative_name": "...",
          "file_type": "...",
          "size": 999,
          "size_kb": 99999,
          "uploaded_on": "..."
        }
      ],
      "testsuite": {
        "id": "...",
        "name": "...",
        "code": "...",
        "testcase": {
          "execution_flow": [
            {
              "title": "...",
              "details": "...",
              "details_html": "..."
            }
          ],
          "custom_fields": [
            {
              "key": "...",
              "value": "..."
            }
          ]
        }
      },
      "linked_vulnerabilities": [
        {
          "id": "..."
        }
      ],
      "assigned_to_user": {
        "id": "...",
        "first_name": "...",
        "last_name": "..."
      },
      "assigned_to_assets": [
        {
          "id": "...",
          "name": "..."
        }
      ],
      "is_failed": false,
      "is_remediated": true
    }
  ]
}
```
