# player

## issuer

<mark style="color:green;">`POST`</mark> `http://dev.whitehat.co.kr/agent/v1/player/issuer`

API that searches the whole list of the issuer or with given search condition

#### Headers

| Name              | Type   | Description                                                  |
| ----------------- | ------ | ------------------------------------------------------------ |
| X-AGENT-API-TOKEN | string | required token for searching the Agent API (issuing console) |

#### Request Body

| Name          | Type   | Description                                    |
| ------------- | ------ | ---------------------------------------------- |
| issuerAccount | string | issuer account to search                       |
| issuerDid     | string | issuer DID to search                           |
| issuerName    | string | Issuer name to search                          |
| status        | string | service status value (0: applied, 1: approved) |
| limit         | string | number of items to get at a time (default: 10) |
| page          | string | current page number (default:1)                |

{% tabs %}
{% tab title="200 code: response success/fail
message: response message in accordance with success/fail
data.totalCount: total number of searched list of issuer
data.list: list of searched issuer" %}

```
{
  "code": 200,
  "message": "Success",
  "data": {
    "totalCount": 1,
    "list": [
      {
        "_id": "2",
        "issuerAccount": "dev.iss2",
        "issuerDid": "did:omn:dev.iss2",
        "issuerName": "raon university",
        "issuerDesc": "raon university",
        "issuerLogo": "raon university",
        "issuerUrl": "raon university",
        "isActive": "true",
        "status": "1"
      }
    ]
  }
}
```

{% endtab %}
{% endtabs %}

#### Request Parameter example (JSON)

```javascript
{
  "query": {
     "issuerAccount": "dev.iss2"
  },
  "limit": 10,
  "page": 1
}
```

## sp

<mark style="color:green;">`POST`</mark> `http://dev.whitehat.co.kr/agent/v1/player/sp`

API that can search the whole list of SP or with a given search condition.

#### Headers

| Name              | Type   | Description                                                  |
| ----------------- | ------ | ------------------------------------------------------------ |
| X-AGENT-API-TOKEN | string | required token for searching the Agent API (issuing console) |

#### Request Body

| Name      | Type   | Description                                    |
| --------- | ------ | ---------------------------------------------- |
| spAccount | string | sp account to search                           |
| spDid     | string | sp DID to search                               |
| spName    | string | sp name to search                              |
| status    | string | service status value(0: applied, 1: approved)  |
| limit     | string | number of items to get at a time (default: 10) |
| page      | string | current page number (default: 1)               |

{% tabs %}
{% tab title="200 code: response success/fail
message: response message in accordance with success/fail
data.totalCount: total number of searched list of SP
data.list: list of searched SP" %}

```
{
  "code": 200,
  "message": "Success",
  "data": {
    "totalCount": 1,
    "list": [
      {
        "_id": "3",
        "spAccount": "dev.sp2",
        "spDid": "did:omn:dev.sp2",
        "spName": "dev.sp2",
        "spDesc": "dev.sp2 info",
        "spLogo": "dev.sp2 logo",
        "spUrl": "dev.sp2 url",
        "isActive": "true",
        "status": "1"
      }
    ]
  }
}
```

{% endtab %}
{% endtabs %}

#### Request Parameter example (JSON)

```javascript
{
  "query": {
    "spDid": "did:omn:dev.sp2"
  },
  "limit": 10,
  "page": 1
}
```

## service

<mark style="color:green;">`POST`</mark> `http://dev.whitehat.co.kr/agent/v1/player/service`

API that can search the whole list of services from SP or with a given conditions&#x20;

#### Headers

| Name              | Type   | Description                                                  |
| ----------------- | ------ | ------------------------------------------------------------ |
| X-AGENT-API-TOKEN | string | required token for searching the Agent API (issuing console) |

#### Request Body

| Name        | Type   | Description                                    |
| ----------- | ------ | ---------------------------------------------- |
| serviceCode | string | service code to search                         |
| serviceName | string | service name to search                         |
| spAccount   | string | sp account to search                           |
| spDid       | string | sp DID to search                               |
| spName      | string | sp name to search                              |
| status      | string | service status value(0:applied, 1: approved)   |
| limit       | string | number of items to get at a time (default: 10) |
| page        | string | current page number (default: 1)               |

{% tabs %}
{% tab title="200 code: response success/fail
message: response message in accordance with success/fail
data.totalCount: total number of searched list of service
data.list: searched list of service" %}

```
{
  "code": 200,
  "message": "Success",
  "data": {
    "totalCount": 1,
    "list": [
      {
        "_id": "0",
        "allowVcdefCodes": [
          "studentdef",
          "vcd.xniifrcm"
        ],
        "serviceCode": "studentsvc",
        "serviceName": "studentsvc",
        "serviceDesc": "",
        "spAccount": "dev.sp2",
        "spDid": "did:omn:dev.sp2",
        "spName": "dev.sp2",
        "status": "1",
        "spInfos": [
          {
            "_id": 3,
            "spAccount": "dev.sp2",
            "spDid": "did:omn:dev.sp2",
            "spName": "dev.sp2",
            "spDesc": "dev.sp2 info",
            "spLogo": "dev.sp2 logo",
            "spUrl": "dev.sp2 url",
            "isActive": "true",
            "status": "1"
          }
        ]
      }
    ]
  }
}
```

{% endtab %}
{% endtabs %}

#### Request Parameter example (JSON)

```javascript
{
  "query": {
     "serviceCode": "studentsvc"
  },
  "limit": 10,
  "page": 1
}
```
