# GetProjectRequests

## 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/requests HTTP/1.1
Host: demo.attackforge.com
X-SSAPI-KEY: APIKey
Content-Type: application/json
Connection: close
```

### Query

**name (string) (optional)**

Name of the project requested.

Example:

```
GET /api/ss/requests?name=Test Project HTTP/1.1
```

**code (string) (optional)**

Project code.

Example:

```
GET /api/ss/requests?code=Project123 HTTP/1.1
```

**status (string) (optional)**

Status of the request. Must be one of the following: Approved, Rejected, Pending

Example:

```
GET /api/ss/requests?status=Testing HTTP/1.1
```

**startDate (string) (optional)**

Start date to query requests from. Must be UTC string e.g. 2021-06-03T23:15:33.008Z.

Example:

```
GET /api/ss/requests?startDate=2021-06-03T00:00:00.000Z HTTP/1.1
```

**endDate (string) (optional)**

End date to query requests to. Must be UTC string e.g. 2021-06-03T23:15:33.008Z.

Example:

```
GET /api/ss/requests?endDate=2021-06-03T00:00:00.000Z HTTP/1.1
```

**skip (integer) (optional)**

Number of records to skip. Default is 0 (do not skip any records).

Example:

```
GET /api/ss/requests?skip=10 HTTP/1.1
```

**limit (integer) (optional)**

Number of records to limit to. Default limit is 500. Max limit is 500.

Example:

```
GET /api/ss/requests?limit=100 HTTP/1.1
```

**cf\_key\_allowlist (string) (optional)**

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

Example:

```
GET /api/ss/requests?cf_key_allowlist=key1&cf_key_allowlist=key2 HTTP/1.1
```

**cf\_key\_blocklist (string) (optional)**

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

Example:

```
GET /api/ss/requests?cf_key_blocklist=key1&cf_key_blocklist=key2 HTTP/1.1
```

## Example

The following example is a cURL request to get all project requests with status 'Pending' which have a desired test window between 1st January 2020 to 31st December 2020.

### Request

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

```
curl -X GET 'https://demo.attackforge.com/api/ss/requests?startDate=2021-06-03T00:00:00.000Z&endDate=2021-06-04T00:00:00.000Z&status=Pending' -H 'Host: demo.attackforge.com' -H 'X-SSAPI-KEY: ***************************************' -H 'Content-Type: application/json' -H 'Connection: close'
```

### Response

Response contains an array of project request objects.

```
{
  "count": 999,
  "requests": [
    "request_id": "...",
    "project_id": "...",
    "request_created": "...",
    "request_last_updated": "...",
    "request_actioned": "...",
    "request_name": "...",
    "request_code": "...",
    "request_status": "...",
    "request_groups": [
      "..."
    ],
    "request_scope": [
      "..."
    ],
    "request_test_types_to_be_performed": [
      "..."
    ],
    "request_project_start_date": "...",
    "request_project_end_date": "...",
    "request_project_testing_hours": "...",
    "request_onsite_testing_required": "...",
    "request_created_by": "...",
    "request_reason_for_testing": "...",
    "request_supporting_documents": [
      "..."
    ],
    "request_custom_fields": [
      {
        "key": "...", 
        "value": "...", 
      }
    ]
  ]
}
```
