Add the specified product to the user's favorite list, supporting the specification of product SKU, suitable for favorite operations in e-commerce features.
Precautions
- This interface uses the POST method and requires data to be submitted in application/ format
- User login is required to perform operations.
- Must specify the product ID
- You can specify the specific product specifications by SKU ID
- If the product has been favorited, the corresponding prompt information will be returned
Request address
{ๅๅๅฐๅ}/api/favorite/add
Description:{ๅๅๅฐๅ}Need to replace it with your domain address, such ashttps://en.anqicms.com/api/favorite/add
Request syntax
POST {ๅๅๅฐๅ}/api/favorite/add
Content-Type: application/json
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 |
| archive_id | integer | Yes |
| sku_id | integer | No |
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 |
Example Usage
Request Example
POST /api/favorite/add HTTP/1.1
Host: www.anqicms.com
Content-Type: application/json
{
"archive_id": 1,
"sku_id": 1
}
Response Example
{
"code": 0,
"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 |