---
# System prepended metadata

title: bifrost 8/26 demo 會員相關 API

---

# bifrost 8/26 demo 會員相關 API


### 規格
- key 都是用 snake_case
- 介面用 json


### 會員清單 {GET} /api/demo/user/v1/list
一開始會是空的，不提供 total api ，由第一次請求取得相關 metadata

```yaml=
# Request
page: number # 從 1 開始
sort_by: string # 預設 created_date，可接受 (email, wallet_address, created_date)
```
```yaml=
# Response
ok: true,
data: # 不確定是 null 還是空陣列
  - id: number,
    email: string,
    name: string,
    serial_no: string
    wallet_address: string
    created_date: string # 規格是 ISO8691
    is_vip: bool # 正在確認這是什麼
metadata: 
    page: number
    total_page: number
```
```yaml=
# Error Response
ok: boolean
code: number
msg: string
```



### 新增會員 {POST} /api/demo/user/v1/create
不需要註冊後登入

```yaml=
# Request
email: string # unique max(50) required
password: string # /[0-9a-Z]{6, 20}/ required
name: string # max(25) optional
```
```yaml=
# Response
ok: boolean
data:
    id: number
    serial_no: string
    wallet_address: string # 一開始是空的
    created_date: string # 規格是 ISO8691
```
```yaml=
# Error Response
ok: boolean
code: number
msg: string
```



### 會員登入 {POST} /api/demo/user/v1/login

```yaml=
# Request
email: string # unique max(50)
password: string # /[0-9a-Z]{6, 20}/
```
```yaml=
# Response
ok: bool
data: 
  user_id: number
  created_date: string # ISO8601
  name: string
  serial_no: string,
  wallet_address: string
  is_vip: bool
```
```yaml=
# Error Response
ok: boolean
code: number
msg: string
```