Get event list interface

Get the current active marketing activity list, supporting pagination query.

Request address

{域名地址}/api/activity/list

Description:{域名地址}Replace it with your domain name, such ashttps://en.anqicms.com/api/activity/list

Request Syntax

GET {域名地址}/api/activity/list?{参数}

Request Headers

This interface involves only public request headers. For more information, please refer toCommon Request Headers (Common Request Headers).

Request parameters

Field name Type Required Description
current int No Retrieve specified pagination data, current page number
pageSize int No Display quantity, number per page

Response header

This interface only involves common response headers. For more information, please refer toCommon Request Headers (Common Request Headers).

Return parameters

Field name Type Description
code int Error code
msg string Error description
data object[] Event list
Total int Total number of activities

data result item parameter

Field name Type Description
id int Event ID
name string Event Name
Title string Event Title
description string Event Description
goods_id int Associated Product ID
type int Promotion Type
price int Promotion Price, in cents
original_price int Original Price, in cents
start_time int Event Start Timestamp
End Time int Event End Timestamp
status int Event Status
min_quantity int Minimum Purchase Quantity
max_quantity int Maximum Purchase Quantity
can use coupon bool Can the coupon be used
stock int Event inventory
sold_count int sold count
created_time int Timestamp of creation
updated_time int update timestamp

Usage Example

Request example

GET /api/activity/list?current=1&pageSize=20 HTTP/1.1
Host: your-domain.com
Content-Type: application/json

Response Example

{
  "code": 0,
  "data": [
    {
      "id": 1,
      "name": "限时特惠",
      "title": "夏季大促",
      "description": "全场商品8折优惠",
      "goods_id": 123,
      "type": 0,
      "price": 2999,
      "original_price": 3999,
      "start_time": 1607308159,
      "end_time": 1607912759,
      "status": 1,
      "min_quantity": 1,
      "max_quantity": 10,
      "can_use_coupon": true,
      "stock": 100,
      "sold_count": 15,
      "created_time": 1607308159,
      "updated_time": 1662717106
    }
  ],
  "msg": "",
  "total": 1
}

error code

Error code Description
0 OK
-1 Error, the reason is indicated in msg