Get favorite list interface

Retrieve the current user's favorite list, supporting pagination queries, and returning all product or document information favorited by the user.

Precautions

  • This interface uses the GET method, parameters are passed through the URL query string
  • Supports pagination queries, can specify the current page number and the number of items per page
  • Only returns the current user's favorite records
  • Return complete document information, including title, description, images, and other detailed content
  • Support to get the price and stock information of favorite items

Request address

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

Description:{域名地址}Need to replace it with your domain address, such ashttps://en.anqicms.com/api/favorite/list

Request syntax

GET {域名地址}/api/favorite/list

Request header

This interface only involves public request headers. For more information, please refer toCommon 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 displayed per page, default is 20

Response Headers

This interface only involves public response headers. 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 object[] List of favorite documents
total integer Total number of favorites

Data array element parameter

Field Name Type Description
id integer Document ID
Title string Document Title
SEO Title string Document SEO Title
url_token string Document URL Alias
Keywords string Document keywords
Description string Document Summary
module_id integer Document Model ID
category_id integer Document Category ID
views integer Document views
comment_count integer Document comments
images string array Document Group Image
Logo string Document Logo
Thumbnail string Document Thumbnail
flag string Document recommendation attributes, headline [h] recommendation [c] feature [f] special recommendation [a] scroll [s] bold [h] image [p] jump [j]
Canonical URL string Canonical URL
fixed_link string Document Fixed Link
created_time integer Document Publish Timestamp
updated_time integer Document Update Timestamp
status integer Document Display Status
user_id integer User ID
Price integer Price, in cents
Stock integer Stock Quantity
extra object Document extended fields
link string Document link

Example Usage

Request Example

GET /api/favorite/list?current=1&pageSize=10 HTTP/1.1
Host: www.anqicms.com

Response Example

{
  "code": 0,
  "msg": "",
  "data": [
    {
      "id": 1,
      "created_time": 1607308159,
      "updated_time": 1662717106,
      "title": "关于AnqiCMS",
      "seo_title": "",
      "url_token": "design",
      "keywords": "",
      "description": "安企内容管理系统(AnqiCMS),是一款使用 GoLang 开发的企业站内容管理系统,它部署简单,软件安全,界面优雅,小巧,执行速度飞快,使用 AnqiCMS 搭建的网站可以防止众多安全问题发生。",
      "module_id": 1,
      "category_id": 1,
      "views": 1338,
      "comment_count": 0,
      "images": null,
      "template": "",
      "status": 1,
      "canonical_url": "",
      "fixed_link": "",
      "flag": "",
      "user_id": 0,
      "price": 0,
      "stock": 9999999,
      "has_pseudo": 0,
      "keyword_id": 0,
      "origin_url": "",
      "origin_title": "",
      "category": null,
      "module_name": "",
      "data": null,
      "logo": "https://en.anqicms.com/uploads/202012/7/bd36c37ef742c7be.webp",
      "thumb": "https://en.anqicms.com/uploads/202012/7/thumb_bd36c37ef742c7be.webp",
      "extra": {
        "author": {
          "name": "作者",
          "value": "AnqiCMS",
          "default": null
        },
        "certificate": {
          "name": "学历",
          "value": null,
          "default": null
        },
        "city": {
          "name": "城市",
          "value": null,
          "default": null
        }
      },
      "link": "https://en.anqicms.com/design"
    },
    {
      "id": 2,
      "created_time": 1607308247,
      "updated_time": 1611373941,
      "title": "AnqiCMS使用帮助",
      "seo_title": "",
      "url_token": "help",
      "keywords": "",
      "description": "anqicms常见问题汇总",
      "module_id": 1,
      "category_id": 1,
      "views": 1655,
      "comment_count": 0,
      "images": null,
      "template": "",
      "status": 1,
      "canonical_url": "",
      "fixed_link": "",
      "flag": "",
      "user_id": 0,
      "price": 0,
      "stock": 9999999,
      "has_pseudo": 0,
      "keyword_id": 0,
      "origin_url": "",
      "origin_title": "",
      "category": null,
      "module_name": "",
      "data": null,
      "logo": "https://en.anqicms.com/uploads/202012/7/bd36c37ef742c7be.webp",
      "thumb": "https://en.anqicms.com/uploads/202012/7/thumb_bd36c37ef742c7be.webp",
      "extra": null,
      "link": "https://en.anqicms.com/help"
    }
  ],
  "total": 2
}

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