---
# System prepended metadata

title: 波波錢包－空投 NFT API 技術串接文件

---

# 波波錢包－空投 NFT API 技術串接文件

[TOC]

## 驗證方式

- [波波錢包－API 驗證方法](https://hackmd.io/@PoWallet/HJjAULtGi)
- 驗證用之 `.crt`&`.key`、IP 位置白名單、`ut_host` 等 config：後續提供

## APIs

### 1. 取得NFT詳細資料 Get NFT Collection Information
**API Endpoint**
- UT url: `{{ut_host}}/blockchain/nft/information/{{project_id}}/{{collection_id}}`
- UAT url: `{{uat_host}}/blockchain/nft/information/{{project_id}}/{{collection_id}}`
- Production url:`{{prod_host}}/blockchain/nft/information/{{project_id}}/{{collection_id}}`

**HTTP REQUEST METHOD**

- GET

**REQUEST HEADERS**
| Header | Description |
| - | - |
| Content-Type | `application/json` |
| Accept | `application/json` |

**GET PARAMETERS**
| Parameter | DataType | Description |
| - | - | - |
| project_id | `String` | |
| collection_id | `String` | |

**RESPONSE HTTP STATUS CODE**
| Status Code | Description |
| - | - |
| 200 | 成功取得 NFT 類別 Metadata  |
| 400 | 請求錯誤 |
| 401 | 請求未授權 |
| 404 | 找不到資源 |

**RESPONSE BODY**
```json=
{
  "project_id": "string",
  "project_name": "專案名",
  "project_description": "專案介紹",
  "collection_id": "string",
  "name": "Collection名",
  "description": "Collection介紹",
  "image_url": "string",
  "banner_image_url": "string",
  "token_standard": "string",
  "is_use_blind_box": false,
  "is_use_utility": false,
  "in_stock_count": 0, // 剩餘數量
  "categories": [
    {
      "category_id": "string",
      "name": "NFT名",
      "description": "string",
      "rarity": 1,
      "rank": "common",
      "empowerment": "string",
      "notice": "string",
      "usage": "string",
      "media_type": "image",
      "image_url": "string",
      "animation_url": "string",
      "type": "data",
      "current_seq": 0
    },{...}
  ]
}
```



### 2. 以手機號碼取得錢包地址 Get Wallet Address By Phone Number

**API Endpoint**
- UT url: `{{ut_host}}/blockchain/wallet/{{phone}}`
- UAT url: `{{uat_host}}/blockchain/wallet/{{phone}}`
- Production url:`{{prod_host}}/blockchain/wallet/{{phone}}`

**HTTP REQUEST METHOD**
- GET

**REQUEST HEADERS**

| Header | Description |
| - | - |
| Content-Type | `application/json` |
| Accept | `application/json` |

**GET PARAMETERS**
| Parameter | Description |
| - | - |
| phone | 手機號碼，須已經過驗證確認有效，正則表達格式為`/^09[0-9]{8}$/` |

**RESPONSE HTTP STATUS CODE**
| Status Code | Description |
| - | - |
| 200 | 成功取得錢包地址 |
| 201 | 成功建立錢包地址 |
| 400 | 請求錯誤 |
| 401 | 請求未授權 |

**RESPONSE BODY**
| Parameter | Description |
| - | - |
| wallet_address | 以 `0x` 開頭的 Ethereum 格式錢包地址 |
```json=
{
    "wallet_address": "0x0xa7e742f0eca4fb47a004a2d2e55b7897b3f77546" // 錢包地址
}
```


### 3. 空投特定 NFT 給使用者 Airdrop Specific Category of NFT 

**API Endpoint**
- UT url: `{{ut_host}}/blockchain/nft/airdrop/category`
- UAT url: `{{uat_host}}/blockchain/nft/airdrop/category`
- Production url:`{{prod_host}}/blockchain/nft/airdrop/category`

**HTTP REQUEST METHOD**
- POST

**REQUEST HEADERS**

| Header | Description |
| - | - |
| Content-Type | `application/json` |
| Accept | `application/json` |

**REQUEST BODY**
| Parameter | DataType | Description |
| - | - | - |
| phone | `String` | 手機號碼，須已經過驗證確認有效，正則表達格式為`/^09[0-9]{8}$/` |
| project_id | `String` |  |
| collection_id | `String` |  |
| category_id | `String` |  |
| event_type | `String` | `purchase_brand` |

**BODY EXAMPLE**
```json=
{
    "phone": "0900000002",
    "project_id": "1701",
    "collection_id": "powalletexample01",
    "category_id": "1",
    "event_type":"purchase_brand"
}
```

**RESPONSE HTTP STATUS CODE**
| Status Code | Description |
| - | - |
| 200 | 已執行空投成功 |
| 400 | 請求錯誤 |
| 401 | 請求未授權 |
| 403 | 區塊鏈交易忙碌 |
| 404 | 找不到欲空投的 NFT 資料 |
| 409 | 數量／狀態控制衝突，已售罄 |
| 500 | 請求失敗 |



### 4. 空投系列內隨機 NFT 給使用者 Airdrop Random Category in Collection of NFT

**API Endpoint**
- UT url: `{{ut_host}}/blockchain/nft/airdrop/random_category`
- UAT url: `{{uat_host}}/blockchain/nft/airdrop/random_category`
- Production url:`{{prod_host}}/blockchain/nft/airdrop/random_category`

**HTTP REQUEST METHOD**
- POST

**REQUEST HEADERS**

| Header | Description |
| - | - |
| Content-Type | `application/json` |
| Accept | `application/json` |

**REQUEST BODY**
| Parameter | DataType | Description |
| - | - | - |
| phone | `String` | 手機號碼，須已經過驗證確認有效，正則表達格式為`/^09[0-9]{8}$/` |
| project_id | `String` |  |
| collection_id | `String` |  |
| event_type | `String` | `purchase_brand` |

**BODY EXAMPLE**
```json=
{
    "phone": "0900000002",
    "project_id": "1701",
    "collection_id": "powalletexample01",
    "event_type":"purchase_brand"
}
```

**RESPONSE HTTP STATUS CODE**
| Status Code | Description |
| - | - |
| 200 | 已執行空投成功 |
| 400 | 請求錯誤 |
| 401 | 請求未授權 |
| 403 | 區塊鏈交易忙碌 |
| 404 | 找不到欲空投的 NFT 資料 |
| 409 | 數量／狀態控制衝突，已售罄 |
| 500 | 請求失敗 |