# ParseCSVData

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

### Body

**base64&#x20;*****(string)***

Base64 encoded CSV data.

Example:

```json
{
   "base64": "QXNzZXQsVnVsbgphdHRhY2tmb3JnZS5jb20sSFNUUyBIZWFkZXIgTWlzc2luZw=="
}
```

**options&#x20;*****(object) (optional)***

* **columns -** whether to include columns as keys in the response. The first row of CSV data will act as the columns/keys.
* **delimiter** - default delimiter is comma. Set a custom delimiter if required.

Example:

```json
{
   "columns": true,
   "delimiter": ";"
}
```

## Example

The following example is a cURL request to convert a CSV data to JSON.

### Request

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

```
curl -X POST 'https://demo.attackforge.com/api/ss/utils/parse-csv' -H 'Host: demo.attackforge.com' -H 'X-SSAPI-KEY: ***************************************' -H 'Content-Type: application/json' -H 'Connection: close' -d '{
  "base64": "QXNzZXQsVnVsbgphdHRhY2tmb3JnZS5jb20sSFNUUyBIZWFkZXIgTWlzc2luZw==",
  "options": {
    "columns": true
  }
}'
```

### Response

Returns a JSON object with CSV data as records.

```json
{
   "records": [
      {
         "some_key": "some_value"
      }
    ]
}
```
