Get favorite list interface

Get the current user's collection list, supporting pagination query, and returning all the products or documents collected by the user.

Points to note

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

Request address

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

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

Request Syntax

GET {域名地址}/api/favorite/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 The current page number, default is 1
pageSize int No Number of items displayed per page, default is 20

Response header

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 int Error code
msg string Error description
data object[] List of favorited documents
Total int Total number of favorited items

Parameters of data array elements

Field name Type Description
id int Document ID
Title string Document title
seo title string Document SEO Title
URL Token string Document URL Alias
keywords string Document keyword
description string Document Introduction
module_id int Document Model ID
category_id int Document Category ID
Views int Document Views
Comment Count int Document Comment Volume
Images string array document group chart
Logo string Document Logo
thumbnail string document thumbnail
flag string Document recommendation attribute, headline [h] recommendation [c] slide [f] featured [a] scroll [s] bold [h] image [p] jump [j]
canonical_url string Canonical URL
fixed link string document fixed link
created_time int document publish timestamp
updated_time int document update timestamp
status int document display status
user_id int User ID
price int price, in cents
stock int inventory quantity
extra object Document extension field
link string Document link

Usage Example

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 Not authorized
200 API request OK