# Badge favourite

## Badge collection

<mark style="color:green;">`POST`</mark> `/api/v1/oauth2/user/favorite_badge`

For user used wallet mint transaction

#### Headers

| Name                                           | Type   | Description  |
| ---------------------------------------------- | ------ | ------------ |
| Access-Token<mark style="color:red;">\*</mark> | String | access token |

#### Request Body

| Name                                                | Type    | Description                                                          |
| --------------------------------------------------- | ------- | -------------------------------------------------------------------- |
| contract\_address<mark style="color:red;">\*</mark> | String  | badge contract address                                               |
| favorite                                            | Boolean | <p>default =true<br>false when you want to cancel the collection</p> |

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

```javascript
{
    "code": 200,
    "data": "favorite success",
    "msg": ""
}
```

{% endtab %}
{% endtabs %}

## Get user badge collection list

<mark style="color:blue;">`GET`</mark> `/api/v1/oauth2/user/favorite_badge`

For ex: "<http://me.nuvosphere.io/#/claim-badge?code=0x88f8ff6c7259031303c146cb7caa3a24055cdbb7,0ca2e6b4f2be922270dda4e95dcc3c03>" \
The code before "," is the badge address. While after"," is the code address

#### Query Parameters

| Name                                         | Type   | Description |
| -------------------------------------------- | ------ | ----------- |
| page\_size<mark style="color:red;">\*</mark> | String |             |
| page\_no<mark style="color:red;">\*</mark>   | String |             |

#### Headers

| Name                                           | Type   | Description  |
| ---------------------------------------------- | ------ | ------------ |
| Access-Token<mark style="color:red;">\*</mark> | String | access token |

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

```javascript
{
    "code": 200,
    "data": {
        "data": [
            {
                "badges_logo": "https://metis.memosync.org:6083/matrix-test/c80f9830fdb24dee9df772027aa74f24.png",
                "contract_address": "0xce79bdf26e0640e29b3e465a37da3082bdc2a27f",
                "dapp_id": "64358e2c6d81a80a8f79a2a1",
                "levels": [
                    {
                        "badge_glass_uri": "",
                        "badge_glass_url": "",
                        "badge_no_glass_uri": "",
                        "badge_no_glass_url": "",
                        "badge_uri": "c80f9830fdb24dee9df772027aa74f24.png",
                        "badge_url": "https://metis.memosync.org:6083/matrix-test/c80f9830fdb24dee9df772027aa74f24.png",
                        "desc": "",
                        "glass_open": 0,
                        "internal_note": "",
                        "level": 1,
                        "min_rp": 1,
                        "name": "Test11",
                        "rp": 10
                    }
                ],
                "nft_name": "Test11",
                "quest_list": [
                    {
                        "issueMethod": "QR code/url",
                        "quest": "111",
                        "rp": "111"
                    },
                    {
                        "issueMethod": "QR code/url",
                        "quest": "22",
                        "rp": "22"
                    },
                    {
                        "issueMethod": "QR code/url",
                        "quest": "33",
                        "rp": "33"
                    }
                ],
                "version": "V2"
            }
        ],
        "page_no": 1,
        "page_size": 10,
        "total": 1
    },
    "msg": ""
}
```

{% endtab %}
{% endtabs %}

## check badge collection status

<mark style="color:green;">`POST`</mark> `/api/v1/oauth2/user/badge/check_favorite`

#### Headers

| Name                                           | Type   | Description  |
| ---------------------------------------------- | ------ | ------------ |
| Access-Token<mark style="color:red;">\*</mark> | String | access token |

#### Request Body

| Name                                                | Type         | Description   |
| --------------------------------------------------- | ------------ | ------------- |
| contract\_address<mark style="color:red;">\*</mark> | String/Array | badge conract |

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

```javascript
{
    "code": 200,
    "data": {
        "0x88f8ff6c7259031303c146cb7caa3a24055cdbb7": true,
        "0xbc3443409e992b8c379b7971e48e925ab2eb3ebc": true,
        "0xce79bdf26e0640e29b3e465a37da3082bdc2a27f": true
    },
    "msg": ""
}
```

{% endtab %}
{% endtabs %}
