Skip to content

Latest commit

 

History

History
1179 lines (925 loc) · 32.1 KB

README.md

File metadata and controls

1179 lines (925 loc) · 32.1 KB

V2Board Complete API Documentation (1.6.1 and Later)

Thanks to v2board for providing the open-source project! For the complete API, please refer to the open-source project: v2board

Note: This documentation is applicable to version 1.6.1 and later.

Visit v2board API Documentation

All GET requests require the request header Authorization with the value auth_data

Table of Contents

Passport

URL Method Description
/passport/comm/config GET Get Configuration
/passport/auth/check GET Login Validation
/passport/auth/login POST Login Account
/passport/comm/sendEmailVerify POST Send Email Verification Code
/passport/auth/register POST Register Account
/passport/auth/forget POST Reset Password

User

URL Method Description
/user/logout GET Logout
/user/info GET Account Information
/user/getSubscribe GET Subscription Information
/user/resetSecurity GET Reset Subscription Link
/user/getStat GET To-Do List
/user/changePassword POST Change Password
/user/update POST Update Notification Status
/user/transfer POST Commission Transfer

Plan

URL Method Description
/user/plan/fetch GET Subscription Store List

Order

URL Method Description
/user/order/fetch GET Order List
/user/order/getPaymentMethod GET Payment Methods
/user/order/details?trade_no= GET Order Details
/user/order/check?trade_no= GET Order Status
/user/order/save POST Create Order
/user/order/checkout POST Checkout Order
/user/order/cancel POST Cancel Order

Invite

URL Method Description
/user/invite/fetch GET Invite Code Management
/user/invite/save GET Generate Invite Code
/user/invite/details GET Invite Details

Notice

URL Method Description
/user/notice/fetch GET Announcement Information

Ticket

URL Method Description
/user/ticket/fetch GET Ticket List
/user/ticket/save POST Create Ticket
/user/ticket/reply POST Reply to Ticket
/user/ticket/close POST Close Ticket

Passport

1. Get Configuration

GET /passport/comm/config

  • Request Parameters null

  • Successful Response Example json

{
  "data": {
    "tos_url": "https://xxx.com",
    "is_email_verify": 0,
    "is_invite_force": 0,
    "email_whitelist_suffix": 0,
    "is_recaptcha": 0,
    "recaptcha_site_key": "xxx",
    "app_description": "Hallo!",
    "app_url": "https://xxx.com"
  }
}
Parameter Type Description
tos_url string Terms of Service URL
is_email_verify number Email Verification
is_invite_force number Mandatory Invite
email_whitelist_suffix number or string[] Email Whitelist Suffix
is_recaptcha number reCAPTCHA Verification
recaptcha_site_key string reCAPTCHA Site Key
app_description string Site Description
app_url string Site URL

2. Login Validation

GET /passport/auth/check

  • Request Parameters null

  • Successful Response Example json

{
  "data": {
    "is_login": false
  }
}
Parameter Type Description
is_login boolean Login Status

3. Login Account

POST /passport/auth/login

  • Request Parameters json
{
  "email": "xxxx@xx.com",
  "password": "1234567890"
}
Parameter Type Required Description
email string ✔︎ Email Address
password string ✔︎ Password
  • Successful Response Example json
{
  "data": {
    "token": "xxx",
    "auth_data": "xxx"
  }
}
Parameter Type Description
token string User Token
auth_data string base64(Email:Password)

4. Send Email Verification Code

POST /passport/comm/sendEmailVerify

  • Request Parameters json
{
  "email": "xxxx@xx.com"
}
Parameter Type Required Description
email string ✔︎ Email Address
  • Successful Response Example json
{
  "data": true
}
Parameter Type Description
data boolean Email Sent Successfully

5. Register Account

POST /passport/auth/register

  • Request Parameters json
{
  "email": "xxxx@xx.com",
  "password": "123456789",
  "email_code": 333333,
  "invite_code": "",
  "recaptcha_data": ""
}
Parameter Type Required Description
email string ✔︎ Email Address
password string ✔︎ Password
email_code number ✖︎ Email Verification Code
invite_code string ✖︎ Invite Code
recaptcha_data string ✖︎ reCAPTCHA Data
  • Successful Response Example json
{
  "data": {
    "token": "xxx",
    "auth_data": "xxx"
  }
}
Parameter Type Description
token string User Token
auth_data string base64(Email:Password)

6. Reset Password

POST /passport/auth/forget

  • Request Parameters json
{
  "email": "xxxx@xx.com",
  "password": "123456789",
  "email_code": 333333
}
Parameter Type Required Description
email string ✔︎ Email Address
email_code number ✔︎ Email Verification Code
password string ✔︎ User Password
  • Successful Response Example json
{
  "data": true
}
Parameter Type Description
data boolean Password Reset Successfully

User

1. Logout

GET /user/logout

  • Request Parameters null

  • Successful Response Example json

{
  "data": true
}
Parameter Type Description
data boolean Logout Successful

2. Account Information

GET /user/info

  • Request Parameters null

  • Successful Response Example json

{
  "data": {
    "email": "xxxx@xx.com",
    "transfer_enable": 0,
    "last_login_at": null,
    "created_at": 1234567890,
    "banned": 0,
    "remind_expire": 0,
    "remind_traffic": 0,
    "expired_at": 0,
    "balance": 0,
    "commission_balance": 0,
    "plan_id": null,
    "discount": null,
    "commission_rate": null,
    "telegram_id": null,
    "uuid": "xxxxxx-xxxx-xxxx-xxxx-xxxxxx",
    "avatar_url": "https://xxxx.com/xxx.xxx"
  }
}
Parameter Type Description
email string Email Address
transfer_enable number Total Available Traffic
last_login_at timestamp Last Login Time
created_at timestamp Account Creation Time
banned number Is Banned
remind_expire number Expiry Email Reminder
remind_traffic number Traffic Email Reminder
expired_at timestamp Expiry Time
balance number User Balance
commission_balance number Commission Balance
plan_id number - object(&plan) Current Subscription ID
discount number Discount Rate
commission_rate number Commission Rate
telegram_id number Telegram ID
uuid string Unique UUID
avatar_url string Avatar URL

3. Subscription Information

GET /user/getSubscribe

  • Request Parameters null

  • Successful Response Example json

{
  "data": {
    "plan_id": null,
    "token": "xxx",
    "expired_at": 0,
    "u": 0,
    "d": 0,
    "transfer_enable": 0,
    "email": "xxx@xxx.com",
    "subscribe_url": "https://xxx.com/api/v1/client/subscribe?token=xxx",
    "reset_day": null
  }
}
Parameter Type Description
plan_id number - object(&plan) Subscription ID
token string User Token
expired_at timestamp Expiry Time
u number Used Upload Traffic
d number Used Download Traffic
transfer_enable number Total Available Traffic
email string Email Address
subscribe_url string Subscription URL
reset_day number Reset Day

4. Reset Subscription Link

GET /user/resetSecurity

  • Request Parameters null

  • Successful Response Example json

{
  "data": "https://xxx.com/api/v1/client/subscribe?token=xxx"
}
Parameter Type Description
data string Subscription Link

5. To-Do List

GET /user/getStat

  • Request Parameters null

  • Successful Response Example json

{
  "data": [
    0,
    0,
    0
  ]
}
Parameter Type Description
data[0] number Pending Orders
data[1] number Pending Tickets
data[2] number Pending Invitations

6. Change Password

POST /user/changePassword

  • Request Parameters json
{
  "old_password": "123456789",
  "new_password": "1234567890"
}
Parameter Type Required Description
old_password string ✔︎ Old Password
new_password string ✔︎ New Password
  • Successful Response Example json
{
  "data": true
}
Parameter Type Description
data boolean Password Change Successful

7. Update Notification Status

POST /user/update

  • Request Parameters json
{
  "remind_expire": 0
}
Parameter Type Required Description
remind_expire number ✖︎ Expiry Email Reminder
remind_traffic number ✖︎ Traffic Email Reminder
  • Successful Response Example json
{
  "data": true
}
Parameter Type Description
data boolean Update Successful

8. Commission Transfer

POST /user/transfer

  • Request Parameters json
{
  "transfer_amount": 1000
}
Parameter Type Required Description
transfer_amount number ✔︎ Transfer Amount
  • Successful Response Example json
{
  "data": true
}
Parameter Type Description
data boolean Transfer Successful

Plan

1. Subscription Store List

GET /user/plan/fetch

  • Request Parameters null

  • Successful Response Example json

{
  "data": [
    {
      "id": 1,
      "group_id": 1,
      "transfer_enable": 100,
      "name": "Plan name",
      "show": 1,
      "sort": null,
      "renew": 1,
      "content": "xxx",
      "month_price": 10,
      "quarter_price": null,
      "half_year_price": null,
      "year_price": 20000,
      "two_year_price": null,
      "three_year_price": null,
      "onetime_price": null,
      "reset_price": 1000,
      "reset_traffic_method": null,
      "created_at": 1234567890,
      "updated_at": 1234567890
    }
  ]
}
Parameter Type Description
id number Subscription ID
group_id number Permission Group ID
transfer_enable number Available Traffic
name string Plan Name
show number Is Visible
sort string Category
renew number Enable Renewal
content string Plan Description
month_price number Monthly Price
quarter_price number Quarterly Price
half_year_price number Half-Year Price
year_price number Yearly Price
two_year_price number Two-Year Price
three_year_price number Three-Year Price
onetime_price number One-Time Price
reset_price number Reset Price
reset_traffic_method number Reset Traffic Method
created_at timestamp Plan Creation Time
updated_at timestamp Plan Update Time

Order

1. Order List

GET /user/order/fetch

  • Request Parameters null

  • Successful Response Example json

{
  "data": [
    {
      "invite_user_id": null,
      "plan_id": 1,
      "coupon_id": null,
      "payment_id": 10,
      "type": 1,
      "cycle": "month_price",
      "trade_no": "xxx",
      "callback_no": null,
      "total_amount": 10,
      "discount_amount": null,
      "surplus_amount": null,
      "refund_amount": null,
      "balance_amount": null,
      "surplus_order_ids": null,
      "status": 2,
      "commission_status": 0,
      "commission_balance": 0,
      "paid_at": null,
      "created_at": 1234567890,
      "updated_at": 1234567890,
      "plan": {
        "表关联"
      }
    }
  ]
}
Parameter Type Description
invite_user_id number Inviter ID
plan_id number Subscription ID
coupon_id number Coupon ID
payment_id number Payment Method ID
type number Order Type: 1 New Purchase, 2 Renewal, 3 Upgrade
cycle string Subscription Cycle
trade_no string Order Number
callback_no string Refund Number
total_amount number Total Amount
discount_amount number Discount Amount
surplus_amount number Surplus Amount
refund_amount number Refund Amount
balance_amount number Balance Amount
surplus_order_ids number Surplus Orders
status number Order Status: 0 Pending, 1 In Progress, 2 Cancelled, 3 Completed, 4 Offset
commission_status number Commission Status: 0 Pending, 1 In Progress, 2 Valid, 3 Invalid
commission_balance number Commission Balance
paid_at timestamp Payment Time
created_at timestamp Creation Time
updated_at timestamp Update Time
plan Plan Subscription Details

2. Payment Methods

GET /user/order/getPaymentMethod

  • Request Parameters null

  • Successful Response Example json

{
  "data": [
    {
      "id": 10,
      "name": "pay",
      "payment": "XXXPay"
    }
  ]
}
Parameter Type Description
id number Payment ID
name string Payment Name
payment string Payment Module

3. Order Details

GET /user/order/details?trade_no={trade_no}

  • Request Parameters query
Parameter Type Description
trade_no string Order Number
  • Successful Response Example json
{
  "data": {
    "id": 1275,
    "invite_user_id": null,
    "user_id": 2057,
    "plan_id": 1,
    "coupon_id": null,
    "payment_id": null,
    "type": 1,
    "cycle": "month_price",
    "trade_no": "xxx",
    "callback_no": null,
    "total_amount": 10,
    "discount_amount": null,
    "surplus_amount": null,
    "refund_amount": null,
    "balance_amount": null,
    "surplus_order_ids": null,
    "status": 0,
    "commission_status": 0,
    "commission_balance": 0,
    "paid_at": null,
    "created_at": 1234567890,
    "updated_at": 1234567890,
    "plan": {
      "表关联"
    },
    "try_out_plan_id": 0
  }
}
Parameter Type Description
id number Order ID
invite_user_id number Inviter ID
user_id number User ID
plan_id number Subscription ID
coupon_id number Coupon ID
payment_id number Payment Method ID
type number Order Type: 1 New Purchase, 2 Renewal, 3 Upgrade
cycle string Subscription Cycle
trade_no string Order Number
callback_no string Refund Number
total_amount number Total Amount
discount_amount number Discount Amount
surplus_amount number Surplus Amount
refund_amount number Refund Amount
balance_amount number Balance Amount
surplus_order_ids number Surplus Orders
status number Order Status: 0 Pending, 1 In Progress, 2 Cancelled, 3 Completed, 4 Offset
commission_status number Commission Status: 0 Pending, 1 In Progress, 2 Valid, 3 Invalid
commission_balance number Commission Balance
paid_at timestamp Payment Time
created_at timestamp Creation Time
updated_at timestamp Update Time
plan Plan Subscription Details
try_out_plan_id number Trial Plan ID

4. Order Status

GET /user/order/check?trade_no={trade_no}

  • Request Parameters query
Parameter Type Description
trade_no string Order Number
  • Successful Response Example json
{
  "data": 0
}
Parameter Type Description
data number 0 Pending, 1 In Progress, 2 Cancelled, 3 Completed, 4 Offset

5. Create Order

POST /user/order/save

  • Request Parameters json
{
  "cycle": "month_price",
  "plan_id": 1
}
Parameter Type Description
cycle string Subscription Cycle
plan_id number Subscription ID
  • Successful Response Example json
{
  "data": "xxx"
}
Parameter Type Description
data string Order Number

6. Checkout Order

POST /user/order/checkout

  • Request Parameters json
{
  "trade_no": "xxx",
  "method": 1
}
Parameter Type Description
trade_no string Order Number
method number Payment Method ID
  • Successful Response Example json
{
  "type": 0,
  "data": "xxx"
}
Parameter Type Description
type number 0: QR Code, 1: URL
data string Payment Address

7. Cancel Order

POST /user/order/cancel

  • Request Parameters json
{
  "trade_no": "xxx"
}
Parameter Type Description
trade_no string Order Number
  • Successful Response Example json
{
  "data": true
}
Parameter Type Description
data boolean Cancel Successful

Invite

1. Invite Code Management

GET /user/invite/fetch

  • Request Parameters null

  • Successful Response Example json

{
  "data": {
    "codes": [
      {
        "id": 1,
        "user_id": 1,
        "code": "xxx",
        "status": 0,
        "pv": 0,
        "created_at": 1234567890,
        "updated_at": 1234567890
      }
    ],
    "stat": [
      0,
      0,
      0,
      15,
      0
    ]
  }
}
Parameter Type Description
codes.id number Invite Code ID
codes.user_id number User ID
codes.code string Invite Code
codes.status number Invite Code Status
codes.pv number Page Views
codes.created_at timestamp Creation Time
codes.updated_at timestamp Update Time
stat[0] number Registered Users
stat[1] number Valid Commissions
stat[2] number Pending Commissions
stat[3] number Commission Rate
stat[4] number Available Commissions

2. Generate Invite Code

GET /user/invite/save

  • Request Parameters null

  • Successful Response Example json

{
  "data": true
}
Parameter Type Description
data boolean Generation Success

3. Invitation Details

GET /user/invite/details

  • Request Parameters null

  • Successful Response Example json

{
  "id": 1,
  "commission_status": 1,
  "commission_balance": 10,
  "created_at": 1234567890,
  "updated_at": 1234567890
}
Parameter Type Description
id number Invitation ID
commission_status number Commission Status: 0 Pending, 1 In Progress, 2 Valid, 3 Invalid
commission_balance number Commission Balance
created_at timestamp Creation Time
updated_at timestamp Update Time

Notice

1. Announcement Information

GET /user/notice/fetch

  • Request Parameters null

  • Successful Response Example json

{
  "data": [
    {
      "id": 1,
      "title": "xxx",
      "content": "xxx",
      "img_url": null,
      "created_at": 1234567890,
      "updated_at": 1234567890
    }
  ],
  "total": 1
}
Parameter Type Description
id number Announcement ID
title string Title
content string Content
img_url string Background Image
created_at timestamp Creation Time
updated_at timestamp Update Time
total number Total Count

Ticket

1. Ticket List

GET /user/notice/fetch

  • Request Parameters null || id

  • Successful Response Example json

{
    "data": [
        {
            "id": 1,
            "user_id": 1,
            "subject": "title",
            "level": 2,
            "status": 1,
            "reply_status": 0,
            "created_at": 1234567890,
            "updated_at": 1234567890
        }
    ]
}
Parameter Type Description
id number Ticket ID
user_id number User ID
subject string Title
level number Ticket Level: 0 Low, 1 Medium, 2 High
status number Ticket Status
reply_status number Reply Status
created_at timestamp Creation Time
updated_at timestamp Update Time
  • If id is provided, detailed information is returned
{
    "data": {
        "id": 1,
        "user_id": 1,
        "subject": "xxx",
        "level": 0,
        "status": 1,
        "reply_status": 1,
        "created_at": 1234567890,
        "updated_at": 1234567890,
        "message": [
            {
                "id": 1,
                "user_id": 1,
                "ticket_id": 1,
                "message": "xxxxx",
                "created_at": 1234567890,
                "updated_at": 1234567890,
                "is_me": false
            }
        ]
    }
}
Parameter Type Description
id number Ticket ID
user_id number User ID
subject string Title
level number Ticket Level: 0 Low, 1 Medium, 2 High
status number Ticket Status
reply_status number Reply Status
created_at timestamp Creation Time
updated_at timestamp Update Time
message array Message Content

2. Create Ticket

POST /user/ticket/save

  • Request Parameters json
{
  "subject": "xxxxxx",
  "level": "0",
  "message": "xxxxxx"
}
Parameter Type Required Description
subject string ✔︎ Title
level number ✔︎ Level: 0, 1, 2
message string ✔︎ Content
  • Successful Response Example json
{
    "data": true
}
Parameter Type Description
data boolean Success
  • Failure Response Example json
{
    "message": "xxxx"
}
Parameter Type Description
message string Reason

3. Reply to Ticket

POST /user/ticket/reply

  • Request Parameters json
{
    "id": 1,
    "message": "xxxxx"
}
Parameter Type Required Description
id number ✔︎ Ticket ID
message string ✔︎ Reply Content
  • Successful Response Example json
{
    "data": true
}
Parameter Type Description
data boolean Success

4. Close Ticket

POST /user/ticket/close

  • Request Parameters json
{
    "id": 1
}
Parameter Type Required Description
id number ✔︎ Ticket ID
  • Successful Response Example json
{
    "data": true
}
Parameter Type Description
data boolean Success