# Relation One 用户 Profile

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

* 说明： 查询 Relation One 用户的 Profile 信息
* Header

| Field  | Type   | Required | Remarks                                                                          |
| ------ | ------ | -------- | -------------------------------------------------------------------------------- |
| ApiKey | String | true     | 从管理员获取的[ApiKey](https://relationlabs.gitbook.io/relation-graph/g-zh/api/profile) |

* Request Parameters

| Field           | Type   | Required | Remarks                                                                                                                                                                    |
| --------------- | ------ | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| address         | String | fasle    | EOA Address                                                                                                                                                                |
| twitterUsername | String | fasle    | twitter username                                                                                                                                                           |
| steamId         | String | fasle    | steamId                                                                                                                                                                    |
| sig             | String | true     | 用户授权信息签名（签名可参考[SIWE](https://docs.login.xyz/),带有授权信息时，开发者可[使用 Lit Protocol 对返回结果解密](https://relationlabs.gitbook.io/relation-graph/g-zh/guide/use-litprotocol-to-decrypt)） |
| message         | String | true     | 用户授权信息签名原文（签名原文拼接可参考[SIWE](https://docs.login.xyz/),其中statement字段需要为**Access to User Profile.**)）                                                                          |

* Request Example

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

* Response Parameters

| Field | Type          | Remarks            |
| ----- | ------------- | ------------------ |
| code  | String        | 返回码                |
| desc  | String        | 返回信息               |
| data  | EncryptedData | 数据（Lit Protocol密文） |

EncryptedData解密后字段如下:

| Field          | Type   | Remarks       |
| -------------- | ------ | ------------- |
| relationId     | String | 用户的relationId |
| name           | String | 用户姓名          |
| avatar         | String | 用户头像          |
| followingCount | String | 关注数           |
| followerCount  | String | 粉丝数           |

EncryptedData解密后的数据结构

```json
 {
  "relationId": "d4swz-zaaaa-aaaaj-at5fa-cai",
  "name": "test_user",
  "avatar": "https://3fypb-gqaaa-aaaag-aaedq-cai.ic1.io/nft/eth/relation-test-club/16.png",
  "followingCount": 87,
  "followerCount": 999
}
```

* Response Body

```json
{
  "code": "0",
  "desc": "success",
  "data": {
    "encryptedString": "xxx",
    "encryptedSymmetricKey": "xxx"
  }
}
```

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