pilot

getCards() {#uctp-get-started-getcards}
=======================================

getCards encapsulates all your identity calls. Make the getCards with the email. For unrecognized user, you'd receive `PENDING_CONSUMER_IDV`. This would trigger an OTP generation. Make the getCards call again with the OTP.

JavaScript Example
------------------

```
// Get cards sample request
 let consumerIdentity = {
    identityProvider: "SRC",
    identityValue: "pocusr2cert1@mailinator.com",
    identityType: "EMAIL_ADDRESS"
 };
 let cards = await vsdk.getCards({ consumerIdentity });
 let { actionCode } = cards;
 switch (actionCode) {
    case 'SUCCESS':
        //handle getCards response in UI
        console.log('Handle getCards response in the UI ', cards);
        break;
    // If cards status is "PENDING_CONSUMER_IDV", call getCards    again with validationData
    case 'PENDING_CONSUMER_IDV':
        const validationDataInput = { consumerIdentity,    validationData: "654321"}; // Replace with your actual validation data
        cards = await vsdk.getCards(validationDataInput);
        break;
    case 'ERROR':
        console.log('Handle error cases:');
        break;
    default:
        console.log('No cards found &gt;&gt; ', cards.actionCode);
        break;
}
```

Syntax
------

Your getCards() request must have this syntax:

```
getCards({
    required ConsumerIdentity consumerIdentity;
    conditional String validationData;
  })
```

