Get the wish list list of the currently logged-in user, supporting pagination queries, and returning the user's favorite product information.
Precautions
- This interface uses the GET method and does not require a request body
- The user must be logged in, verified through session or Token.
- Supports pagination queries, which can be controlled by parameters to set the number of items per page and the current page number
- Return detailed information of items in the wish list, including price, notes, etc.
- Compare the current price of the item with the price at the time of addition
Request address
{域名地址}/api/wishlist/list
Description:{域名地址}Need to replace it with your domain address, such ashttps://en.anqicms.com/api/wishlist/list
Request syntax
GET {域名地址}/api/wishlist/list
Request header
This interface also involves common request headers. For more information, please seeCommon Request Headers (Common Request Headers).
Request Parameters
| Field Name | Type | Required | Description |
|---|---|---|---|
| Current | integer | No | Current page number, default is 1 |
| pageSize | integer | No | Number of items per page, default is 10 |
Response Headers
This interface only involves public response headers. For more information, please refer toCommon Request Headers (Common Request Headers).
Return parameters
| Field Name | Type | Description |
|---|---|---|
| code | integer | Error code |
| message | string | Error Description |
| data | array | List of wish list data |
| total | integer | Total number of items in the wish list |
Data array element parameter
| Field Name | Type | Description |
|---|---|---|
| id | integer | Wish List Record ID |
| user_id | integer | User ID |
| user_name | string | Username |
| archive_id | integer | Product ID |
| sku_id | integer | 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 | integer | Product Current Price |
| Original Price | integer | Product price at addition time |
| target_price | integer | Desired price set by the user |
| status | integer | Record status (e.g., whether available) |
| priority | integer | Priority |
| created_time | integer | Timestamp of addition |
Example Usage
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
}
Example of error request
GET /api/wishlist/list HTTP/1.1
Host: www.anqicms.com
Authorization: Bearer invalid_token
Error response example
{
"code": 1001,
"msg": "未登录"
}
Error Code
| Error code | Description |
|---|---|
| 0 | OK |
| -1 | Error, the reason is indicated in msg |
| 1001 | Not logged in |
| 1002 | Unauthorized |
| 200 | API request OK |