# Name Service Api

#### 1. Name List

> Returns all names held by the address

* 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

> Return the resolve record

* 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

> Return the reverse resolve record

* 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 %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://relationlabs.gitbook.io/protocol/name-service/integration-api.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
