Add Friendship Link Interface

Add a new friendship link to the system, supporting the setting of nofollow attributes, backlink information, contact information, and other detailed information.

Precautions

  • This interface uses the POST method to submit data in form-data format
  • Need to provide a valid backend import interface Token for authentication
  • At least two required parameters, title and link, need to be provided.
  • Support setting the nofollow attribute, which is helpful for SEO optimization
  • Can record backlink information, contact information, and remarks

Request address

{域名地址}/api/friendlink/create?token={token}

Description:{域名地址}It needs to be replaced with your domain address.{token}The Token needs to be replaced with the one in the background content import interface function:https://en.anqicms.com/api/friendlink/create?token=xxx

Request syntax

POST {域名地址}/api/friendlink/create?token={token}
Content-Type: multipart/form-data

Request Parameters

GET Parameter

Field Name Type Required Description
token string Yes Token in the background content import interface function

POST parameters

Field Name Type Required Description
Title string Yes The other party's keywords
link string Yes The other link
nofollow integer No Whether to add nofollow, optional values: 0 Do not add, 1 Add
Back Link string No Opponent's backlink page
my_title string No My keywords
my_link string No my_link
contact string No Opponent's contact information
remark string No Remark information

Return parameters

Field Name Type Description
code integer Error code
message string Error Description

Example Usage

Request Example

POST /api/friendlink/create?token=4712a54b4c456bb29b7816d241db69a7 HTTP/1.1
Host: www.anqicms.com
Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW

------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="title"

AnqiCMS
------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="link"

https://en.anqicms.com/
------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="nofollow"

1
------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="contact"

[email protected]
------WebKitFormBoundary7MA4YWxkTrZu0gW--

Or use the curl command:

curl -X POST \
  'https://en.anqicms.com/api/friendlink/create?token=4712a54b4c456bb29b7816d241db69a7' \
  -H 'Content-Type: multipart/form-data' \
  -F 'title=AnqiCMS' \
  -F 'link=https://en.anqicms.com/' \
  -F 'nofollow=1' \
  -F '[email protected]'

Response Example

{
  "code": 0,
  "msg": "链接已保存"
}

Error 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 Unauthorized
200 API request OK