# List Subject Profile

This method lists the available subject profiles . 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/listSubjectProfile`

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-21T04:55:14.759Z",
            "DIDId": "did:key:z6MkjcRg1BFymuFVcZdHp2f7m6ZchZsqhGVQXnQckucCAACQ",
            "DIDMethodType": "key",
            "Id": "650bccb2024ceedb7fefb1c5",
            "InstanceId": "INS_DI_22_2023921",
            "LastUsed": "2023-09-21T04:55:14.759Z",
            "Status": "ACTIVE",
            "SubjectDescription": "demo",
            "SubjectId": "demo",
            "SubjectName": "demo",
            "SubscriptionId": "6224416276"
        }],
        "totalCount": 1
    },
    "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/listSubjectProfile' \
--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/listSubjectProfile',
  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/listSubjectProfile"

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/listSubjectProfile"
  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 %}
