Email Subscription Interface

Users submit their email addresses to subscribe to emails, which are used to receive the latest information, updates, or other email content on the website.

Points to note

  • The API uses the POST method and requires data to be submitted in application/ format
  • Enter a valid email address
  • Support for adding notes and categories to subscribers
  • After successful subscription, the user will receive an email confirmation or be directly added to the subscription list
  • Email address needs to be formatted

Request address

{ๅŸŸๅๅœฐๅ€}/api/subscription

Description:{ๅŸŸๅๅœฐๅ€}Replace it with your domain name, such ashttps://en.anqicms.com/api/subscription

Request Syntax

POST {ๅŸŸๅๅœฐๅ€}/api/subscription
Content-Type: application/json

Request Headers

This interface also involves common request headers. For more information, please refer toCommon Request Headers (Common Request Headers).

Request parameters

Field name Type Required Description
email string Is Email address for receiving subscription emails
remark string No Optional user remarks
status int No Subscription status to identify subscriber status
category_id int No Subscriber category ID, used to classify subscribers

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/subscription HTTP/1.1
Host: www.anqicms.com
Content-Type: application/json

{
  "email": "[email protected]",
  "remark": "ๆฅ่‡ช็ฝ‘็ซ™้ฆ–้กต่ฎข้˜…",
  "category_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 Not authorized
200 API request OK