Get the wish list list of the currently logged-in user, supporting pagination queries, and returning the user's favorite product information.
Points to note
- This interface uses the GET method, no request body is required
- The user must be logged in, verified through session or Token
- Supports pagination query, can control the number of items per page and the current page number through parameters
- Return the detailed information of items in the wish list, including price, notes, etc.
- Includes the current price of the item and the price comparison when added
Request address
{域名地址}/api/wishlist/list
Description:{域名地址}Replace it with your domain name, such ashttps://en.anqicms.com/api/wishlist/list
Request Syntax
GET {域名地址}/api/wishlist/list
Request Headers
This interface also involves common request headers. For more information, please refer toCommon Request Headers (Common Request Headers).
Request parameters
| Field name | Type | Required | Description |
|---|---|---|---|
| current | int | No | The current page number, default is 1 |
| pageSize | int | No | Number of items displayed per page, default is 10 |
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 | array | Wish list data list |
| Total | int | Total number of items in the wish list |
Parameters of data array elements
| Field name | Type | Description |
|---|---|---|
| id | int | Wish list record ID |
| user_id | int | User ID |
| user_name | string | Username |
| archive_id | int | Product ID |
| sku_id | int | SKU ID |
| Title | string | Product name |
| sku_title | string | Product SKU Name |
| description | string | Product Description |
| remark | string | User Remarks |
| thumbnail | string | Product Thumbnail URL |
| link | string | Product Link |
| price | int | Product Current Price |
| origin_price | int | Original Product Price at Addition |
| target price | int | User-Set Wish Price |
| status | int | Record Status (e.g., whether available) |
| priority | int | Priority |
| created_time | int | Timestamp of Addition |
Usage Example
Request example
GET /api/wishlist/list?current=1&pageSize=10 HTTP/1.1
Host: www.anqicms.com
Response Example
{
"code": 0,
"msg": "",
"data": [
{
"id": 1,
"user_id": 1001,
"user_name": "张三",
"archive_id": 123,
"sku_id": 456,
"title": "iPhone 13",
"sku_title": "iPhone 13 128G 蓝色",
"description": "苹果最新款智能手机",
"remark": "生日礼物",
"thumb": "https://en.anqicms.com/uploads/images/iphone13.jpg",
"link": "https://en.anqicms.com/product/123",
"price": 599900,
"origin_price": 699900,
"target_price": 550000,
"status": 1,
"priority": 1,
"created_time": 1640995200
},
{
"id": 2,
"user_id": 1001,
"user_name": "张三",
"archive_id": 124,
"sku_id": 457,
"title": "MacBook Pro",
"sku_title": "MacBook Pro 14寸 银色",
"description": "苹果专业笔记本电脑",
"remark": "工作用",
"thumb": "https://en.anqicms.com/uploads/images/macbook.jpg",
"link": "https://en.anqicms.com/product/124",
"price": 1499900,
"origin_price": 1599900,
"target_price": 1399900,
"status": 1,
"priority": 2,
"created_time": 1640995300
}
],
"total": 2
}
Error request example
GET /api/wishlist/list HTTP/1.1
Host: www.anqicms.com
Authorization: Bearer invalid_token
Example of error response
{
"code": 1001,
"msg": "未登录"
}
error code
| Error code | Description |
|---|---|
| 0 | OK |
| -1 | Error, the reason is indicated in msg |
| 1001 | Not logged in |
| 1002 | Not authorized |
| 200 | API request OK |