# Get a Collection of Data Loss or Data Breach Events across your Portfolio
source: https://developer.mastercard.com/riskrecon-api/documentation/testing/dataloss-samples/retrve-data-loss-evnts-smpl/index.md

Allows you to fetch a collection of data loss or data breach events across your portfolio.

## Pre-requisites {#pre-requisites}

Refer to the [Retrieve a Collection of Data Loss or Data Breach Events across your Portfolio](https://developer.mastercard.com/riskrecon-api/documentation/use-cases/risk-assessment/datalossevent/retrve-data-loss-evnts/index.md) use case.

## Request URL for Sandbox environment {#request-url-for-sandbox-environment}

    GET https://api.sandbox.riskrecon.com/v1/portfolio_data_loss_events

## Request URL for Production environment {#request-url-for-production-environment}

    GET https://api.riskrecon.com/v1/portfolio_data_loss_events

## Test Cases {#test-cases}

### Test Cases: Success - Retrieve a Collection of Data Loss or Data Breach Events across your Portfolio {#test-cases-success---retrieve-a-collection-of-data-loss-or-data-breach-events-across-your-portfolio}

**Request**

Here is an example of a request made using a `curl` command.

```bash
curl -X 'GET' \
  'https://api.sandbox.riskrecon.com/v1/portfolio_data_loss_events?page=1&per_page=20' \
  -H 'accept: application/json'
  -H 'Authorization: valid_JWT_token'
```

**Response**

get:

```json
{
  "data": [
    {
      "attributes": {
        "analysis_id": "354",
        "breach_event_date": "1992-12-01",
        "compromised_info": [
          "protected_health",
          "financial_accounts"
        ],
        "created_at": "2020-06-23T20:00:24",
        "description": "Qui ea harum est quia reprehenderit dolorum quidem iusto.",
        "id": "418",
        "internal_id": [],
        "internal_name": [],
        "public_event_date": "1992-12-01",
        "records_exposed": 5649,
        "source_urls": [
          "https://boyle.biz"
        ],
        "threat_action": [
          "error"
        ],
        "threat_actor": "unknown",
        "threat_vector": "miscellaneous_errors",
        "toe_id": "440c5d53-268b-4964-9e5b-0a51f5f9d6e3",
        "toe_short_name": "Abernathy-Moore",
        "total_result_count": 5459,
        "updated_at": "2020-06-23T20:00:24",
        "uuid": null
      },
      "id": "418",
      "type": "portfolio_data_loss_events"
    },
    {
      "attributes": {
        "analysis_id": "450",
        "breach_event_date": "1992-12-01",
        "compromised_info": [
          "protected_health",
          "financial_accounts"
        ],
        "created_at": "2020-06-23T20:00:24",
        "description": "Voluptate vel ad voluptate pariatur laborum.",
        "id": "482",
        "internal_id": [],
        "internal_name": [],
        "public_event_date": "1992-12-01",
        "records_exposed": 5649,
        "source_urls": [
          "http://kovacek.org"
        ],
        "threat_action": [
          "error"
        ],
        "threat_actor": "unknown",
        "threat_vector": "miscellaneous_errors",
        "toe_id": "faa2c859-1166-468c-ba57-fd0fb3aaeb18",
        "toe_short_name": "Becker, Bailey and Kertzmann",
        "total_result_count": 5459,
        "updated_at": "2020-06-23T20:00:24",
        "uuid": null
      },
      "id": "482",
      "type": "portfolio_data_loss_events"
    },
    {
      "attributes": {
        "analysis_id": "514",
        "breach_event_date": "1992-12-01",
        "compromised_info": [
          "protected_health",
          "financial_accounts"
        ],
        "created_at": "2020-06-23T20:00:24",
        "description": "Rem non esse sequi ut quo dolorum ut!",
        "id": "546",
        "internal_id": [],
        "internal_name": [],
        "public_event_date": "1992-12-01",
        "records_exposed": 5649,
        "source_urls": [
          "http://abbott.org"
        ],
        "threat_action": [
          "error"
        ],
        "threat_actor": "unknown",
        "threat_vector": "miscellaneous_errors",
        "toe_id": "0c852bf1-0561-4d9a-a8ba-8608fa4d85a5",
        "toe_short_name": "Wisoky Inc",
        "total_result_count": 5459,
        "updated_at": "2020-06-23T20:00:24",
        "uuid": null
      },
      "id": "546",
      "type": "portfolio_data_loss_events"
    },
    {
      "attributes": {
        "analysis_id": "578",
        "breach_event_date": "1992-12-01",
        "compromised_info": [
          "protected_health",
          "financial_accounts"
        ],
        "created_at": "2020-06-23T20:00:24",
        "description": "Doloribus id commodi alias inventore modi eos assumenda.",
        "id": "610",
        "internal_id": [],
        "internal_name": [],
        "public_event_date": "1992-12-01",
        "records_exposed": 5649,
        "source_urls": [
          "http://toy.name"
        ],
        "threat_action": [
          "error"
        ],
        "threat_actor": "unknown",
        "threat_vector": "miscellaneous_errors",
        "toe_id": "3c002791-eb7e-470e-a7cb-dbd668fd6285",
        "toe_short_name": "Hoeger and Sons",
        "total_result_count": 5459,
        "updated_at": "2020-06-23T20:00:24",
        "uuid": null
      },
      "id": "610",
      "type": "portfolio_data_loss_events"
    },
    {
      "attributes": {
        "analysis_id": "642",
        "breach_event_date": "1992-12-01",
        "compromised_info": [
          "protected_health",
          "financial_accounts"
        ],
        "created_at": "2020-06-23T20:00:24",
        "description": "Est assumenda et quasi non hic qui nam enim necessitatibus?",
        "id": "674",
        "internal_id": [],
        "internal_name": [],
        "public_event_date": "1992-12-01",
        "records_exposed": 5649,
        "source_urls": [
          "https://ruecker.org"
        ],
        "threat_action": [
          "error"
        ],
        "threat_actor": "unknown",
        "threat_vector": "miscellaneous_errors",
        "toe_id": "30adf56e-81cc-4f59-b1a3-db20f43c7d1d",
        "toe_short_name": "Wuckert-Metz",
        "total_result_count": 5459,
        "updated_at": "2020-06-23T20:00:24",
        "uuid": null
      },
      "id": "674",
      "type": "portfolio_data_loss_events"
    }
  ],
  "meta": {
    "current_page": 1,
    "next_page": null,
    "prev_page": null,
    "total_count": 5,
    "total_pages": 1
  }
}
```

### Test Case: Fail - Invalid Sort Attribute {#test-case-fail---invalid-sort-attribute}

**Request**

Here is an example of a request made with an incorrect sort attribute using a `curl` command.

```bash
curl -X 'GET' \
  'https://api.sandbox.riskrecon.com/v1/portfolio_data_loss_events?sort_attribute=DESC
  -H 'accept: application/json'
  -H 'Authorization: valid_JWT_token' 
```

**Response**

HTTP Error response 400

```json
{
    "Errors": {
        "Error": [
            {
                "Description": "Bad Request",
                "Details": "sort_attribute: is invalid",
                "ReasonCode": "BAD_REQUEST",
                "Recoverable": false,
                "Source": "RISKRECON_API"
            }
        ]
    }
}
```

### Test Case: Fail - Invalid risk relationship slug {#test-case-fail---invalid-risk-relationship-slug}

**Request**

Here is an example of a request made with an incorrect risk relationship slug name using a `curl` command.

```bash
curl -X 'GET' \
  'https://api.sandbox.riskrecon.com/v1/portfolio_data_loss_events?risk_relationship_slugs[]=ownenterpise
  -H 'accept: application/json'
  -H 'Authorization: valid_JWT_token' 
```

**Response**

HTTP Error response 400

```json
{
    "Errors": {
        "Error": [
            {
                "Description": "Bad Request",
                "Details": "Slug ownenterpise does not match any customer buckets",
                "ReasonCode": "BAD_REQUEST",
                "Recoverable": false,
                "Source": "RISKRECON_API"
            }
        ]
    }
}
```

