> For the complete documentation index, see [llms.txt](https://relationlabs.gitbook.io/relation-one-api/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://relationlabs.gitbook.io/relation-one-api/api/profile/user-info.md).

# User Info

## <mark style="color:blue;">GET</mark> /api/v1/userInfo

* Note: To return a user's information. If the Parameters are empty, then it is to query the caller's own user information.
* Header

| Field         | Type   | Required | Remarks                                                                                           |
| ------------- | ------ | -------- | ------------------------------------------------------------------------------------------------- |
| ApiKey        | String | true     | [ApiKey](/relation-one-api/guide/glossary.md#apikey) acquired from the admin                      |
| Authorization | String | false    | Bearer ${unifiedAuthToken} , in which the unifiedAuthToken is the result returned by /api/v1/auth |

* Request Parameters

| Field   | Type          | Required | Remarks                                                                                                      |
| ------- | ------------- | -------- | ------------------------------------------------------------------------------------------------------------ |
| address | String        | false    | relationId or address                                                                                        |
| fields  | List\[String] | false    | option，Fill in the user fields that need to be returned，value: CREATE\_AT、FOLLOW\_COUNT、ADDRESS\_WITH\_CHAIN |

* Request Example

```shell
curl  GET 'https://api.relationlabs.ai/api/v1/userInfo?address=0x9bd286ef4e3d9ec1af6c6ae9da2f0b3617deab13' \
--header 'ApiKey: <ApiKey>'
```

* Response Parameters

| Field | Type     | Remarks            |
| ----- | -------- | ------------------ |
| code  | String   | the Return Code    |
| desc  | String   | the Return Message |
| data  | UserInfo | the Data           |

The UserInfo field consists of the following subfields:

| Field            | Type             | Remarks                                                                              |
| ---------------- | ---------------- | ------------------------------------------------------------------------------------ |
| name             | String           | User Name                                                                            |
| avatar           | String           | User's Avatar                                                                        |
| relationId       | String           | User's relationId                                                                    |
| createdAt        | String           | User's register time                                                                 |
| followCount      | FollowCount      | Total number of followers and following                                              |
| └─followingCount | Integer          | Total number of following                                                            |
| └─followerCount  | Integer          | Total number of followers                                                            |
| addressWithChain | AddressWithChain | User's address ,and the chain which the address belongs                              |
| └─address        | String           |                                                                                      |
| └─chainName      | String           | the chain name,current support：eth、polygon、bsc、op、moonbeam、solana、flow、substrate、ic、 |

* Response Example

```json
{
    "code": "0",
    "desc": "success",
    "data": {
        "relationId": "dhkyq-sqaaa-aaaaj-sgz3q-cai",
        "name": "0x1e56",
        "avatar": "",
        "createdAt": "2022-08-18 16:54:15",
        "followCount": {
            "followingCount": 1,
            "followerCount": 0
        },
        "addressWithChain": [
            {
                "address": "0xb152e0eebd5d2b98da5d1ed7d1ce066c20a4e430",
                "chainName": "eth"
            }
        ]
    }
}
```

* Return Code

| code  | desc    | Remarks                                   |
| ----- | ------- | ----------------------------------------- |
| 0     | success | the flag for a successful request         |
| 11601 | failed  | this field not support in current version |
| 11602 | failed  | user not found                            |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://relationlabs.gitbook.io/relation-one-api/api/profile/user-info.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
