# Ingestion API

## **`POST /interfa/v2/auth/token`**

Returns a JSON object containing the AccessToken and RefreshToken.

### Query parameters

<table><thead><tr><th width="155">Param</th><th width="84">Type</th><th width="198">Required?</th><th>Description</th></tr></thead><tbody><tr><td>Authorization</td><td>String</td><td>Required(Header)</td><td><a href="basic-authentication">Basic Auth</a></td></tr><tr><td>dappid</td><td>String</td><td>Required</td><td>dappid</td></tr><tr><td>code</td><td>String</td><td>Required when grantType is <strong>authorization_code</strong></td><td>This allows an application to hit APIs on behalf of users. Known as the auth_code. The auth_code has a time limit of 30 seconds once the App owner receives an approved auth_code from the user. You will have to exchange it with an access token within 30 seconds, or the auth_code will expire.</td></tr><tr><td>state</td><td>String</td><td>Optional</td><td>state</td></tr><tr><td>refreshToken</td><td>String</td><td>Required when grantType is <strong>refresh_token</strong></td><td>Allows an dapp to obtain a new access token without prompting the user via the refresh token flow.</td></tr><tr><td>grantType</td><td>String</td><td>Required</td><td>The OAuth framework specifies several grant types for different use cases and a framework for creating new grant types. Examples include <strong>authorization_code</strong> and <strong>refresh_token</strong></td></tr><tr><td>redirectUrl</td><td>String</td><td>Required when grantType is <strong>authorization_code</strong></td><td>Redirect url given to authorization request</td></tr></tbody></table>

### Response fields

<table><thead><tr><th width="155">Param</th><th width="84">Type</th><th>Description</th></tr></thead><tbody><tr><td>accessToken</td><td>String</td><td>Access tokens are the token that applications use to make API requests on behalf of a user.</td></tr><tr><td>refreshToken</td><td>String</td><td>Allows an application to obtain a new access token without prompting the user via the refresh token flow.</td></tr><tr><td>expiresIn</td><td>Int64</td><td>accessToken validity period, unit: seconds</td></tr><tr><td>uuid</td><td>String</td><td>The unique id of the user</td></tr></tbody></table>

Example：

{% code overflow="wrap" %}

```bash
curl -X POST 'https://exdapps.uxlink.io/interfa/v2/auth/token' \
-H 'Authorization: <Basic Auth>' \
-H 'Content-Type: application/json' \
-d '{
  "dappid": "DAPPID",
  "code": "CODE",
  "state": "STATE",
  "grantType": "authorization_code",
  "redirectUrl": "https://dapp.uxlink.io/airdrop2049"
}'
```

{% endcode %}

```json
// Response Example:
{
  "success": true,
  "msg": "ok",
  "code": 200,
  "data": {
    "accessToken": "eyJhbGciOiJIUzI1...8btpWyFAI_SI",
    "refreshToken": "eyJhbGciOiJIUzI1NiI...8btpWyFAI_SI",
    "expiresIn": 162341315435,
    "uuid": "177123456789"
  }
}
```

## **`POST /interfa/v2/user/info`**

Returns a JSON object providing the user's information, AccountInfo.

### Query parameters

<table><thead><tr><th width="155">Param</th><th width="84">Type</th><th>Required?</th><th>Description</th></tr></thead><tbody><tr><td>Authorization</td><td>String</td><td>Required(Header)</td><td>Get AccessToken from <a href="#post-interfa-v2-auth-token">/interfa/v2/auth/token</a></td></tr><tr><td>uuid</td><td>String</td><td>Required</td><td>The unique id of the user</td></tr></tbody></table>

### Response fields

<table><thead><tr><th width="155">Param</th><th width="84">Type</th><th>Description</th></tr></thead><tbody><tr><td>uuid</td><td>String</td><td>The unique id of the user</td></tr><tr><td>name</td><td>String</td><td>The name of the user</td></tr><tr><td>avatar</td><td>String</td><td>The avatar of the user</td></tr><tr><td>socialAddress</td><td>String</td><td>Represents the abstract address ID related to social accounts, focusing on social identity binding.</td></tr><tr><td>chainAddress</td><td>String</td><td>Represents the abstract address ID of the on-chain account, focusing on blockchain-related interactions.</td></tr></tbody></table>

Example：

{% code overflow="wrap" %}

```bash
curl -X POST 'https://exdapps.uxlink.io/interfa/v2/user/info' \
-H 'Authorization: <AccessToken>' \
-H 'Content-Type: application/json' \
-d '{
  "uuid": "177123456789"
}'
```

{% endcode %}

```json
// Response Example:
{
    "success": true,
    "msg": "ok",
    "code": 200,
    "data": {
        "uuid": "177123456789",
        "name": "uxlink",
        "avatar": "https://avatar.jpg", 
        "socialAddress": "0xADDRESS", 
        "chainAddress": "0xADDRESS"
    }
}
```

## `POST /interfa/v2/user/relation/list`

Returns a JSON objects, the user's social relevance.

### Query parameters

<table><thead><tr><th width="155">Param</th><th width="84">Type</th><th width="218">Required?</th><th>Description</th></tr></thead><tbody><tr><td>Authorization</td><td>String</td><td>Required(Header)</td><td>Get AccessToken from <a href="#post-interfa-v2-auth-token">/interfa/v2/auth/token</a></td></tr><tr><td>pageSize</td><td>Int</td><td>Required</td><td>The number of results to be returned per page. This can be a number between 1 and the 500. By default, each page will return 20 results.</td></tr><tr><td>nextToken</td><td>String</td><td>Required</td><td>Used to request the next page of results if all results weren't returned with the latest request. It can be null if it is the first page.</td></tr><tr><td>uuid</td><td>String</td><td>Required</td><td>The unique id of the user</td></tr></tbody></table>

### Response fields

<table><thead><tr><th width="155">Param</th><th width="84">Type</th><th>Description</th></tr></thead><tbody><tr><td>uuid</td><td>String</td><td>The unique id of the user</td></tr><tr><td>name</td><td>String</td><td>The name of the user</td></tr><tr><td>avatar</td><td>String</td><td>The avatar of the user</td></tr><tr><td>socialAddress</td><td>String</td><td>Represents the abstract address ID related to social accounts, focusing on social identity binding.</td></tr><tr><td>chainAddress</td><td>String</td><td>Represents the abstract address ID of the on-chain account, focusing on blockchain-related interactions.</td></tr></tbody></table>

Example：

```bash
curl -X POST 'https://exdapps.uxlink.io/interfa/v2/user/relation/list' \
-H 'Authorization: <AccessToken>' \
-H 'Content-Type: application/json' \
-d '{
  "pageSize": 20,
  "nextToken": "1730982011",
  "uuid": "177123456789"
}' 
```

```json
// Response Example:
{
  "success": true,
  "msg": "ok",
  "code": 200,
  "data": {
    "pageSize": 20,
    "nextPage": true,
    "nextToken": "1730982011",
    "list": [
      {
        "uuid": "12313100000000",
        "name": "ali",
        "avatar": "https://avatar.jpg", 
        "socialAddress": "0xADDRESS", 
        "chainAddress": "0xADDRESS"
      }
    ]
  }
}
```

## **`POST /interfa/v2/user/wallet/list`**

Returns a JSON object providing wallet list of user's, include wallet verification.

### Query parameters

<table><thead><tr><th width="151">Param</th><th width="87">Type</th><th width="206">Required?</th><th>Description</th></tr></thead><tbody><tr><td>Authorization</td><td>String</td><td>Required(Header)</td><td>Get AccessToken from <a href="#post-interfa-v2-auth-token">/interfa/v2/auth/token</a></td></tr><tr><td>uuid</td><td>String</td><td>Required</td><td>The unique id of the user</td></tr></tbody></table>

### Response fields

<table><thead><tr><th width="155">Param</th><th width="84">Type</th><th>Description</th></tr></thead><tbody><tr><td>uuid</td><td>String</td><td>The unique id of the user</td></tr><tr><td>address</td><td>String</td><td>Wallet address</td></tr><tr><td>walletType</td><td>String</td><td>Wallet address type: 0 socialAddress 1 metamask, 2 okx 3 coinbase 4 others 5 binance 6 ton wallet</td></tr><tr><td>verified</td><td>bool</td><td>Return true if the wallet address has been signed and verified.</td></tr></tbody></table>

Example：

{% code overflow="wrap" %}

```bash
curl -X POST 'https://exdapps.uxlink.io/interfa/v2/user/wallet/list' \
-H 'Authorization: <AccessToken>' \
-H 'Content-Type: application/json' \
-d '{
	"uuid": "177123456789"
}'
```

{% endcode %}

```json
// Success Response Example:
{
  "success": true,
  "msg": "ok",
  "code": 200,
  "data": {
    "walletList": [
      {
        "uuid": "177123456789",
        "address": "0xADDRESS",
        "walletType": 1,
        "verified": true
      }
    ]
  }
}
```
