# Name Service Api

#### 1. Name List

> 查询某个地址持有的所有域名

* host: <https://testnet.relationlabs.ai>
* path: `/name/list`
* method: `GET`
* query params: `address`
* example:

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

```shell
curl --location 'https://testnet.relationlabs.ai/name/list?address=0x247b8cdf5ff2ed74ba5da461f96f0f5b275cdeda'
```

{% endtab %}

{% tab title="Response" %}

```json
{
  "code": "0",
  "desc": "success",
  "data": [
    {
      "name": "relation.soul",
      "rdfData": ":Soul_0x247b8cdf5ff2ed74ba5da461f96f0f5b275cdeda p:resolved :Name_relation.soul.",
      "transactionHash": "0x8711dee7907daf0a4e9f6b1763c1b3a90f144627cb1b041c29f706f08993545a",
      "resolved": true
    },
    {
      "name": "relationlabs.soul",
      "rdfData": ":Soul_0x247b8cdf5ff2ed74ba5da461f96f0f5b275cdeda p:hold :Name_relationlabs.soul.",
      "transactionHash": "0xa74578e59d0e16329c0308f6597b15a217d061c36b2c8dc1750423bb1eaa879c",
      "resolved": false
    }
  ]
}
```

{% endtab %}
{% endtabs %}

#### 2. Resolve

> 查询解析记录

* host: <https://testnet.relationlabs.ai>
* path: `/name/resolve`
* method: `GET`
* query params: `name`
* example:

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

```shell
curl --location 'https://testnet.relationlabs.ai/name/resolve?name=relation.soul'
```

{% endtab %}

{% tab title="Response" %}

```json
{
  "code": "0",
  "desc": "success",
  "data": {
    "address": "0x247b8cdf5ff2ed74ba5da461f96f0f5b275cdeda"
  }
}
```

{% endtab %}
{% endtabs %}

#### 3. ReverseResolve

> 查询反向解析

* host: <https://testnet.relationlabs.ai>
* path: `/name/reverseResolve`
* method: `GET`
* query params: `address`
* example:

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

```shell
curl --location 'https://testnet.relationlabs.ai/name/reverseResolve?address=0x247b8cdf5ff2ed74ba5da461f96f0f5b275cdeda'
```

{% endtab %}

{% tab title="Response" %}

```json
{
  "code": "0",
  "desc": "success",
  "data": {
    "name": "relation.soul"
  }
}
```

{% endtab %}
{% endtabs %}
