Add a new友情链接 friendship link to the system, supporting the setting of nofollow attributes, backlink information, contact details, and other detailed information.
Points to note
- This interface uses the POST method to submit data in form-data format
- An effective background import interface Token is required for authentication
- At least two required parameters, title and link
- Supports 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:{域名地址}Replace with your domain address,{token}Replace with the Token in the background content import interface function, such ashttps://en.anqicms.com/api/friendlink/create?token=xxx
Request Syntax
POST {域名地址}/api/friendlink/create?token={token}
Content-Type: multipart/form-data
Request parameters
GET parameters
| Field name |
Type |
Required |
Description |
| token |
string |
Is |
Token in the background content import interface function |
POST parameters
| Field name |
Type |
Required |
Description |
| Title |
string |
Is |
Opponent keywords |
| link |
string |
Is |
Opponent link |
| nofollow |
int |
No |
Whether to add nofollow, optional values: 0 Do not add, 1 Add |
| back_link |
string |
No |
The other link page |
| my_title |
string |
No |
My keywords |
| my_link |
string |
No |
my link |
| contact |
string |
No |
contact information |
| remark |
string |
No |
Note information |
Return parameters
| Field name |
Type |
Description |
| code |
int |
Error code |
| msg |
string |
Error description |
Usage Example
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": "链接已保存"
}
Example of error response
{
"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 |