# GetAssetLibraryAssets

## 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

```
POST /api/ss/library/assets HTTP/1.1
Host: demo.attackforge.com
X-SSAPI-KEY: APIKey
Content-Type: application/json
Connection: close
```

### Body

**name (string) (optional)**

Name of the asset.

Example:

```
{
   "name": "..."
}
```

**type (string) (optional)**

Type of asset. Must be one of the following: *Web App, API, Mobile, Cloud, Infrastructure, Network, Wifi, Hardware, Other*

Example:

```
{
   "type": "Web App"
}
```

**external\_id (string) (optional)**

External id for the asset. For example id associated with the assest in Configuration Management Database.

Example:

```
{
   "external_id": "..."
}
```

**skip (integer) (optional)**

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

Example:

```
{
   "skip": 10
}
```

**limit (integer) (optional)**

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

Example:

```
{
   "limit": 100
}
```

**archived&#x20;*****(boolean) (optional)***

Return archived assets. Must have access to view archived assets.

Example:

```
{
   "archived": true
}
```

**query (*****string*****) (*****optional*****)**

Provides options to query a custom selection of assets.

Example:

```
{
   "query": "{ name: { $in: [\"attackforge.com\", \"api.attackforge.com\"] } }"
}
```

Please visit the following link for more details on how to use this filter: <https://support.attackforge.com/attackforge-enterprise/modules/self-service-restful-api/advanced-query-filter>

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

List of custom field keys to include in response.

Example:

```
{
   "cf_key_allowlist": [ "key_1", "key_2" ]
}
```

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

List of custom field keys to exclude from response.

Example:

```
{
   "cf_key_blocklist": [ "key_1", "key_2" ]
}
```

## Example

The following example is a cURL request to get all assets from the library of type 'Web App'.

### Request

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

```
curl -X POST 'https://demo.attackforge.com/api/ss/library/assets' -H 'Host: localhost:3000' -H 'X-SSAPI-KEY: ***************************************' -H 'Content-Type: application/json' -H 'Connection: close' -d '{
  "type": "Web App"
}'
```

### Response

Response contains an asset library count and array of asset library objects.

```
{
   "count": 999,
   "assets": [
      {
        "id": "...",
        "created": "...",
        "created_by": "...",
        "modified": "...",
        "name": "...",
        "type": "...",
        "external_id": "...",
        "details": "...",
        "groups": [
          {
            "name": "...", 
            "id": "..."
          }
        ],
        "projects": [
          {
            "name": "...", 
            "id": "..."
          }
        ],
        "asset_library_ids": [
          {
            "id": "...",
            "name": "..."
          }
        ],
        "custom_fields" : [
          {
            "key" : "...",
            "value" : "..."
          }
        ]
      }
   ]
}
```
