Remove favorite interface

Remove collection records for specified products or documents, supporting the deletion of specific items from the user's collection list.

Points to note

  • The API uses the POST method and requires data to be submitted in application/ format
  • Provide the document ID to specify the favorite item to be removed
  • Only logged-in users can remove their own favorite records
  • If the specified document is not favorited, a successful status is returned
  • Successfully removed and will no longer appear in the user's favorite list

Request address

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

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

Request Syntax

POST {域名地址}/api/favorite/delete
Content-Type: application/json

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
archive_id int Is Document ID

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

Usage Example

Request example

POST /api/favorite/delete HTTP/1.1
Host: www.anqicms.com
Content-Type: application/json

{
  "archive_id": 1
}

Successful response example

{
  "code": 0,
  "msg": "删除成功"
}

Failed response example

{
  "code": -1,
  "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