# List Verifiable Credential

This method lists the available Verifiable Credential. The weightage for this API is `1`

## API Specification

## Lists subject profile

<mark style="color:green;">`POST`</mark> `https://api.krypcore.com/api/v0/did/listVC`

Lists the available subject profiles under the given instance.&#x20;

#### Headers

| Name                                            | Type   | Description                      |
| ----------------------------------------------- | ------ | -------------------------------- |
| Authorization<mark style="color:red;">\*</mark> | String | User Auth Key obtained from Dash |
| DappId<mark style="color:red;">\*</mark>        | String | DappId                           |

#### Request Body

| Name                                     | Type    | Description                       |
| ---------------------------------------- | ------- | --------------------------------- |
| search<mark style="color:red;">\*</mark> | String  | Subject Profile Name              |
| limit<mark style="color:red;">\*</mark>  | Numeric | Total No of pages to be displayed |
| page                                     | Numeric | No of pages                       |

{% tabs %}
{% tab title="200: OK Success" %}

```javascript
{
    "Data": {
        "data": [{
            "CreatedAt": "2023-09-21T07:08:51.946Z",
            "CredentialId": "urn:uuid:fcf5b354-43e0-4f2c-908d-977196dd8206",
            "Id": "650bec0352b2f37a2138dab6",
            "InstanceId": "INS_DI_22_2023921",
            "IssuedAt": "2023-09-21T07:08:51.946Z",
            "Issuer": "did:key:z6MkhNjTaHAmf1fx9JuWXHUqGU7k4tX6RKCHkvHnXdrxZqGa",
            "LastUsed": "2023-09-21T07:08:51.946Z",
            "Status": "ACTIVE",
            "Subject": "did:key:z6MkjcRg1BFymuFVcZdHp2f7m6ZchZsqhGVQXnQckucCAACQ",
            "SubscriptionId": "6224416276",
            "Type": "PermanentResidentCard",
            "VCJson": {
                "@context": ["https://www.w3.org/2018/credentials/v1", "https://w3id.org/security/suites/jws-2020/v1"],
                "config": {
                    "issuerDid": "did:key:z6MkhNjTaHAmf1fx9JuWXHUqGU7k4tX6RKCHkvHnXdrxZqGa",
                    "proofType": "LD_PROOF",
                    "statusType": "StatusList2021Entry",
                    "subjectDid": "did:key:z6MkjcRg1BFymuFVcZdHp2f7m6ZchZsqhGVQXnQckucCAACQ"
                },
                "credentialData": {},
                "credentialStatus": {
                    "id": "http://127.0.0.1:7001/v1/credentials/status/revocation#0",
                    "statusListCredential": "http://127.0.0.1:7001/v1/credentials/status/revocation",
                    "statusListIndex": "0",
                    "statusPurpose": "revocation",
                    "type": "StatusList2021Entry"
                },
                "credentialSubject": {
                    "id": "did:key:z6MkjcRg1BFymuFVcZdHp2f7m6ZchZsqhGVQXnQckucCAACQ"
                },
                "id": "urn:uuid:fcf5b354-43e0-4f2c-908d-977196dd8206",
                "issuanceDate": "2023-09-21T07:08:48Z",
                "issued": "2023-09-21T07:08:48Z",
                "issuer": "did:key:z6MkhNjTaHAmf1fx9JuWXHUqGU7k4tX6RKCHkvHnXdrxZqGa",
                "proof": {
                    "created": "2023-09-21T07:08:51Z",
                    "creator": "did:key:z6MkhNjTaHAmf1fx9JuWXHUqGU7k4tX6RKCHkvHnXdrxZqGa",
                    "jws": "eyJiNjQiOmZhbHNlLCJjcml0IjpbImI2NCJdLCJhbGciOiJFZERTQSJ9..C5ta-cXAiJuGpuDhr9Se4gZF6TsduWnMuM-ZYJJOjfn1xYTYfqfeabG80dPF9yI9iyfSFgvn2gIfyRz1Bqm0Dg",
                    "type": "JsonWebSignature2020",
                    "verificationMethod": "did:key:z6MkhNjTaHAmf1fx9JuWXHUqGU7k4tX6RKCHkvHnXdrxZqGa#z6MkhNjTaHAmf1fx9JuWXHUqGU7k4tX6RKCHkvHnXdrxZqGa"
                },
                "templateId": "PermanentResidentCard",
                "type": ["VerifiableCredential"],
                "validFrom": "2023-09-21T07:08:48Z"
            },
            "VCJsonReq": {
                "config": {
                    "issuerDid": "",
                    "proofType": "",
                    "statusType": "",
                    "subjectDid": ""
                },
                "credentialData": {},
                "templateId": ""
            }
        }, {
            "CreatedAt": "2023-09-21T07:11:48.231Z",
            "CredentialId": "urn:uuid:3d58a9a7-cd75-4e1b-90c9-97da654daf9d",
            "Id": "650becb452b2f37a2138dab7",
            "InstanceId": "INS_DI_22_2023921",
            "IssuedAt": "2023-09-21T07:11:48.231Z",
            "Issuer": "did:key:z6MkhNjTaHAmf1fx9JuWXHUqGU7k4tX6RKCHkvHnXdrxZqGa",
            "LastUsed": "2023-09-21T07:11:48.231Z",
            "Status": "ACTIVE",
            "Subject": "did:key:z6MkjcRg1BFymuFVcZdHp2f7m6ZchZsqhGVQXnQckucCAACQ",
            "SubscriptionId": "6224416276",
            "Type": "PermanentResidentCard",
            "VCJson": {
                "@context": ["https://www.w3.org/2018/credentials/v1", "https://w3id.org/security/suites/jws-2020/v1"],
                "config": {
                    "issuerDid": "did:key:z6MkhNjTaHAmf1fx9JuWXHUqGU7k4tX6RKCHkvHnXdrxZqGa",
                    "proofType": "LD_PROOF",
                    "statusType": "StatusList2021Entry",
                    "subjectDid": "did:key:z6MkjcRg1BFymuFVcZdHp2f7m6ZchZsqhGVQXnQckucCAACQ"
                },
                "credentialData": {},
                "credentialStatus": {
                    "id": "http://127.0.0.1:7001/v1/credentials/status/revocation#1",
                    "statusListCredential": "http://127.0.0.1:7001/v1/credentials/status/revocation",
                    "statusListIndex": "1",
                    "statusPurpose": "revocation",
                    "type": "StatusList2021Entry"
                },
                "credentialSubject": {
                    "additionalProp1": {},
                    "id": "did:key:z6MkjcRg1BFymuFVcZdHp2f7m6ZchZsqhGVQXnQckucCAACQ"
                },
                "id": "urn:uuid:3d58a9a7-cd75-4e1b-90c9-97da654daf9d",
                "issuanceDate": "2023-09-21T07:11:47Z",
                "issued": "2023-09-21T07:11:47Z",
                "issuer": "did:key:z6MkhNjTaHAmf1fx9JuWXHUqGU7k4tX6RKCHkvHnXdrxZqGa",
                "proof": {
                    "created": "2023-09-21T07:11:47Z",
                    "creator": "did:key:z6MkhNjTaHAmf1fx9JuWXHUqGU7k4tX6RKCHkvHnXdrxZqGa",
                    "jws": "eyJiNjQiOmZhbHNlLCJjcml0IjpbImI2NCJdLCJhbGciOiJFZERTQSJ9..SZbcEn7l_UyX9PPai3RcedNuwu4xOTWnJxvuK0obSr-jeWp-8PumgeMlxhajgjPJol3XN8In3qH8aOmn2nQwBg",
                    "type": "JsonWebSignature2020",
                    "verificationMethod": "did:key:z6MkhNjTaHAmf1fx9JuWXHUqGU7k4tX6RKCHkvHnXdrxZqGa#z6MkhNjTaHAmf1fx9JuWXHUqGU7k4tX6RKCHkvHnXdrxZqGa"
                },
                "templateId": "PermanentResidentCard",
                "type": ["VerifiableCredential"],
                "validFrom": "2023-09-21T07:11:47Z"
            },
            "VCJsonReq": {
                "config": {
                    "issuerDid": "",
                    "proofType": "",
                    "statusType": "",
                    "subjectDid": ""
                },
                "credentialData": {},
                "templateId": ""
            }
        }],
        "totalCount": 2
    },
    "Message": "",
    "Status": "SUCCESS"
}
```

{% endtab %}
{% endtabs %}

Take a look at how you might call this method using our official libraries, or via `curl`:

{% tabs %}
{% tab title="curl" %}

```bash
curl --location --request POST 'https://api.krypcore.com/api/v0/did/listVC' \
--header 'Authorization: xxxxxxxxxxxx' \
--header 'DappId: xxxxxxxxxxxx' \
--header 'Content-Type: application/json' \
--data-raw '{
  "limit": 5,
  "page": 1,
  "search": ""
}'
```

{% endtab %}

{% tab title="Node.js (Fetch)" %}

```javascript
var axios = require('axios');
var data = JSON.stringify({
  "limit": 5,
  "page": 1,
  "search": ""
});

var config = {
  method: 'post',
  url: 'https://api.krypcore.com/api/v0/did/listVC',
  headers: { 
    'Authorization': 'xxxxxxxxxxxx', 
    'DappId': 'xxxxxxxxxxxx', 
    'Content-Type': 'application/json'
  },
  data : data
};

axios(config)
.then(function (response) {
  console.log(JSON.stringify(response.data));
})
.catch(function (error) {
  console.log(error);
});

```

{% endtab %}

{% tab title="Python " %}

```python
import requests
import json

url = "https://api.krypcore.com/api/v0/did/listVC"

payload = json.dumps({
  "limit": 5,
  "page": 1,
  "search": ""
})
headers = {
  'Authorization': 'xxxxxxxxxxxx',
  'DappId': 'xxxxxxxxxxxx',
  'Content-Type': 'application/json'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)

```

{% endtab %}

{% tab title="Golang" %}

```go
package main

import (
  "fmt"
  "strings"
  "net/http"
  "io/ioutil"
)

func main() {

  url := "https://api.krypcore.com/api/v0/did/listVC"
  method := "POST"

  payload := strings.NewReader(`{
  "limit": 5,
  "page": 1,
  "search": ""
}`)

  client := &http.Client {
  }
  req, err := http.NewRequest(method, url, payload)

  if err != nil {
    fmt.Println(err)
    return
  }
  req.Header.Add("Authorization", "xxxxxxxxxxxx")
  req.Header.Add("DappId", "xxxxxxxxxxxx")
  req.Header.Add("Content-Type", "application/json")

  res, err := client.Do(req)
  if err != nil {
    fmt.Println(err)
    return
  }
  defer res.Body.Close()

  body, err := ioutil.ReadAll(res.Body)
  if err != nil {
    fmt.Println(err)
    return
  }
  fmt.Println(string(body))
}
```

{% endtab %}
{% endtabs %}
