API 接口列表

标签作用:用于远程调取系统数据,使用小程序、公众号、APP 等。

使用说明

1、请先到后台进行 API 相关参数配置,强烈建议启用强制认证;

2、客户端发起请求必须包含 appid(认证用户)、timestamp(时间戳)、signature(签名)三个参数

3、签名参数 signature 通过 appid、secret、timestamp 三个值连接为一个字符串,然后进行双层 md5 加密生成;

<script>
$(document).ready(function (e) {
    var url='/api.php/cms.site';
    $.ajax({
      type: 'POST',
      url: url,
      dataType: 'json',
      data: {
        appid: '{$bd.appid}',
        timestamp: '{$bd.timestamp}',
        signature: '{$bd.signature}'
       },
      success: function (response, status) {
        if(response.code){
          //获取数据成功
          alert(response.data.title);
        }else{
          //返回错误数据
          alert(response.data);
        }
      },
      error:function(xhr,status,error){
        //返回数据异常
        alert('返回数据异常!');
      }
    });
  });
</script>

# 此处使用了三个站内标签:
{$bd.appid} 认证用户名、
{$bd.timestamp} 时间戳、
{$bd.signature} 认证签名

网站信息接口

http://IP/api.php/cms.site

http://IP/api.php/cms.site?name=xxx 单个调用

公司信息接口

http://IP/api.php/cms.company

http://IP/api.php/cms.company?name=xxx 单个调用

自定义标签接口

http://IP/api.php/cms.label

http://IP/api.php/cms.label?name=xxx 单个调用

栏目列表树接口

http://IP/api.php/cms.nav

http://IP/api.php/cms.nav?scode=xxx 获取指定分类的子类

当前栏目位置接口

http://IP/api.php/cms.position?scode=xxx

此处传递当前栏目 scode 值

指定分类信息接口

http://IP/api.php/cms.sort?scode=xxx

此处传递需要调用栏目的 scode 值

指定内容多图接口

http://IP/api.php/cms.pics?id=xxx

此处传递内容 ID 值

幻灯片接口

http://IP/api.php/cms.slide?gid=xxx&num=xxx

此处传递分组 gid 及调取的数量 num 值,默认 num 为 5

友情链接接口

http://IP/api.php/cms.link?gid=xxx&num=xxx

此处传递分组 gid 及调取的数量 num 值,默认 num 为 10

指定内容列表接口

http://IP/api.php/cms.lists?scode=xxx 此处传递需要调用的栏目 scode

http://IP/api.php/cms.lists?scode=xxx&page=2 调取第二页

同时还支持传递 num 参数控制数量,传递 order 参数控制排序方式,建议使用 POST 方式

指定内容详情接口

http://IP/api.php/cms.content?id=xxx

传递需要调用的内容 ID(单页一样适用)

指定单页详情接口

http://IP/api.php/cms.about?scode=xxx

传递需要调用的单页 scode

搜索内容接口

http://IP/api.php/cms.search

建议使用 POST 提交,keyword 传递搜索关键字单条件搜索

同时支持传递 num 参数控制数量,传递 order 参数控制排序方式,建议 POST 方式

可传递参数 field 指定字段,多个用|隔开;

可传递参数 scode 指定分类,多个用逗号隔开;

可传递参数 fuzzy 等于 0 关闭模糊匹配,另外也可使用多数据库字段名称传递值来多条件搜索

留言提交接口

http://IP/api.php/cms.addmsg

要求 POST 提交,传递的字段同后台自定义的留言字段

留言内容接口

http://IP/api.php/cms.msg?num=xxx 传递 num 分页大小

http://IP/api.php/cms.msg?num=xxx&page=2 调取第二页

表单提交接口

http://IP/api.php/cms.addform?fcode=xxx

要求 POST 提交,fcode 为表单编码,传递的字段同后台自定义的字段

表单数据读取接口

http://IP/api.php/cms.form?fcode=xxx 传递 fcode 表单编码

http://IP/api.php/cms.form?fcode=xxx&num=xxx&page=xxx

num 控制条数,page 控制页码

更新时间:2026-03-18 14:45:44

文章目录