Get the list of Banners for the specified group in the system, supporting multiple Banner groups, which can be used for home page carousel, advertising positions, and other display scenarios.
Points to note
- The interface supports retrieving Banners from different groups by using the type parameter
- By default, retrieve the Banner list from the "default" group
- A Banner includes images, links, and descriptions, making it convenient for front-end display
- The Banner returned by the interface is sorted according to the backend settings
Request address
{域名地址}/api/banner/list
Description:{域名地址}Replace it with your domain name, such ashttps://en.anqicms.com/api/banner/list
Request Syntax
GET {域名地址}/api/banner/list?{参数}
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 |
|---|---|---|---|
| type | string | No | Default value "default", you can create multiple banner groups in the background and then go throughtype,to call banners from different groups. |
Response header
This interface only involves common 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 |
| data | object[] | result content |
data result item parameter
| Field name | Type | Description |
|---|---|---|
| id | int | ID |
| Logo | string | Logo image address |
| link | string | Link Address |
| alt | string | Image Alt |
| description | string | Introduction |
| type | string | Group type |
Usage Example
Request example
Get the default group Banner:
GET /api/banner/list HTTP/1.1
Host: your-domain.com
Content-Type: application/json
Get the specified group Banner:
GET /api/banner/list?type=home HTTP/1.1
Host: your-domain.com
Content-Type: application/json
Response Example
{
"code": 0,
"data": [
{
"logo": "https://en.anqicms.com/uploads/202311/13/7371e7ca18e2668d.png",
"id": 1,
"link": "https://en.anqicms.com",
"alt": "下载安企CMS",
"description": "欢迎下载安企CMS",
"type": "default"
},
{
"logo": "https://en.anqicms.com/uploads/202311/13/93c0421dca1847c6.webp",
"id": 2,
"link": "https://en.anqicms.com/help",
"alt": "AnQiCMS使用帮助",
"description": "你可以在这里找到AnQiCMS的日常使用帮助",
"type": "default"
}
],
"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 |