wiki:pcauto_4.4.0/interface

Version 3 (modified by hejingdong, 12 years ago) (diff)

--

1.基本约定

接口通用参数
req_enc=utf-8(必须放url后面)
resp_enc=utf-8(必须放url后面)
common_session_id=xxxx(以cookies中的优先)

接口URL: 接口URL
必填参数:参数名=xxx(多种情况用括号解析)
非必填参数:参数名=xxx(多种情况用括号解析)
说明文档参数:添加某特定参数可以直接看接口文档
是否需要登录:是,否
返回格式:json,ssi,xml
缓存方式:接口缓存,对象缓存
缓存时间:缓存时间
返回结果:结果可能情况

2.接口列表

2.1 小编精选推荐

 备注:此接口返回若干个小编精选推荐车系,客户端自动筛选4个用以显示
 请求url:
 HTTP请求方式:get
 是否需要登录:是
 返回格式:json
 缓存方式:无
 缓存时间:无
 请求参数:

1.正常返回:
{
  "code": 0,
  "total": 40,
  "list":[
	{
	  "id": 2,
	  "image": "http://img.pconline.com.cn/images/upload/upc/tx/auto5/1308/13/c9/24440713_1376387144385_270x202.jpg",
	  "serialId": 354,
	  "serialName": "马自达6",
	  "price": "12.98-15.98万"
	}
  ]
}

2.1.1 最新内容

 请求url:
 HTTP请求方式:get
 是否需要登录:是
 返回格式:json
 缓存方式:无
 缓存时间:无
 请求参数:
    serialIds=1,2,3 车系id,以逗号间隔
返回结果:说明,除了第1中情况程序出错返回的响应状态为500,其他情况经返回200
1.正常返回:
{
  "code": 0,
  "total": 5,
  "list": [
    {
      ////资讯格式
      "channelId": 2,
      "channelName": "新车",
      "count": 3,
      "downs": 13,
      "id": "4721075",
      "image": "http://img0.pcauto.com.cn/pcauto/1407/02/g_4688183_1404269779131_240x160.jpg",
      "title": "2014款帅客正式上市 售6.48-9.18万元",
      "type": 1,
      "ups": 13,
      "url": "http://www.pcauto.com.cn/nation/472/4721075.html",
      "type": 3(1为属于资讯,2为论坛,3为购车优惠),
      "date": "2014-5-13  星期二"
    },
    {
      ////论坛格式
      "count": 14,
      "downs": 39,
      "forumName": "",
      "id": "5037151",
      "image": "http://img0.pcauto.com.cn/pcauto/1407/07/4715883_1.jpg",
      "preView": "[今日话题]一撞就起火 特斯拉值那个价吗?",
      "seq": 4,
      "title": "[今日话题]一撞就起火 特斯拉值那个价吗?",
      "to-uri": "pcautobrowser://bbs-topic/5037151",
      "type": 2,
      "updateAt": 1404662400000,
      "ups": 13,
      "type": 2(1为属于资讯,2为论坛,3为购车优惠),
      "date": "2014-5-13  星期二"
      
    },
    {
      //购车优惠格式
      "id": 2,
      "userId": 24286812,
      "image": "http://img.pconline.com.cn/images/upload/upc/tx/auto5/1308/13/c9/24440713_1376387144385_270x202.jpg",
      "serialId": 354,
      "serialName": "马自达6",
      "price": "12.98-15.98万",
      "lowerPrice": "",
      "city": "",
      "shopType": "4S店",
      "company": "出厂名",
      "type": 3(1为属于资讯,2为论坛,3为购车优惠),
      "date": "2014-5-13  星期二",
    }
  ]
}

2.2 文章终端

 备注:获取文章
 请求URL:http://mrobot.pcauto.com.cn/v3/cms/articles/4147040?articleTemplate=3.6.0&size=18&app=pcautobrowser&picRule=2&template=(null)&channelId=4&serialId=0
 HTTP请求方式:get
 是否需要登录:否
 返回格式:html页面
 缓存方式:无
 缓存时间:1小时
 请求参数:
        文章ID
        articleTemplate=3.6.0
        size:字体大小
        app=pcautobrowser
        picRule:请求网络方式:0 非wifi; 2  wifi访问
        pageNo:页码
        template:模板
        channelId:栏目ID
        serialId:车系ID
        date:文章直播时间(说明:当参数template=live时,传递date,否则不传)
        阅读模式:无参数 白天;night 晚间
 请求后端URL:
        helper_uri_articles_3?id=4147040
 请求后端参数:
        id:4147040(从id_0取出)

4.4版本增加协议:
添加订阅:
pcaction://addSubscribe/id?serialName=xxx&price=xxx&image=xxx
pcautobrowser://serial/id

2.3 获取评论接口

备注:获取文章评论
 请求URL:http://mrobot.pcauto.com.cn/v3/cmt/new_topics/13118127?articleId=4147040&reverse=0&pageNo=1&pageSize=20
 HTTP请求方式:get
 是否需要登录:否
 返回格式:json
 缓存方式:无
 缓存时间:无
 请求参数:
        topicId:主题ID
        articleId:文章ID
        reverse:排序方式:0  倒序; 1 正序
        pageNo:页码
        pageSize:每页行数
        pic:是否图片评论:0或者不填否,1是
 请求后端URL:
        http://cmt.pcauto.com.cn/action/comment/list_new_json.jsp?tId=13118127&arch=0&reverse=0&pageSize=20
        http://cmt.pcauto.com.cn/intf/tophot.jsp?tid=13118127
 请求后端参数:
        tid:主题ID(从id_0取出)
        reverse:排序方式:0  倒序; 1 正序
        pageSize:每页行数
返回参数:
{
  "comments": [
    {
      "1": {
        "client": "1",
        "content": "\u6211\u7684\u798F\u7F8E\u6765323\u5F00\u4E86\u5341\u5E74\u4E86\uFF0C\u8FD8\u5728\u7528\uFF0C\u8D28\u91CF\u6760\u6760\u7684",
        "floor": "113",
        "id": "27265992",
        "name": "\u5C71\u4E1C\u7701\u9752\u5C9B\u5E02\u7F51\u53CB",
        "time": "2014-07-08 09:50:03",
        "userId": "0"
      },
      "current": "1",
      "expand": false,
      "support": "0"
    },
    {
      "1": {
        "client": "1",
        "content": "\u6211\u7684\u798F\u7F8E\u6765323\u5F00\u4E86\u5341\u5E74\u4E86\uFF0C\u8FD8\u5728\u7528\uFF0C\u8D28\u91CF\u6760\u6760\u7684",
        "floor": "112",
        "id": "27265870",
        "name": "\u5C71\u4E1C\u7701\u9752\u5C9B\u5E02\u7F51\u53CB",
        "time": "2014-07-08 09:37:55",
        "userId": "0"
      },
      "current": "1",
      "expand": false,
      "support": "0"
    }
  ],
  "pageCount": 6,
  "pageNo": 1
}

2.3.1 回复文章评论

备注:回复文章评论
 请求URL:http://cmt.pcauto.com.cn/action/comment/create_utf8.jsp
 HTTP请求方式:post
 是否需要登录:否
 返回格式:json
 缓存方式:无
 缓存时间:无
 请求参数:
        topicId:主题ID
        topicUrl:主题url
        articleTitle:文章标题
        content:回复内容
        name:用户名
        是否匿名:0 否
        replyFloor:回复楼层
        articleId:文章ID

2.4 热门对比

备注:热门对比
 请求URL:
 HTTP请求方式:get
 是否需要登录:否
 返回格式:HTML页面
 缓存方式:无
 缓存时间:无
 请求参数:
        sid:车系id
        night:有此参数为夜间模式,否则为日间模式
点击对比按钮,跳转协议
pcaction://hot-pk/?id1=xx&id2=xx&name1=xxx&name2=xxx

2.5 精准选车条件

备注:精准选车条件
 请求URL:
         v4.3之前使用此接口:http://mrobot.pcauto.com.cn/v3/price/models/criterionv36?v=4.0.0
         v4.3之后使用此接口:http://mrobot.pcauto.com.cn/v3/price/models/criterionv36?v=4.3.0
 HTTP请求方式:get
 是否需要登录:否
 返回格式:json
 缓存方式:无
 缓存时间:7天
 请求参数:
        v:版本号,v有两个可选值,分别为4.0.0、4.3.0
 请求后端URL:
        http://ks.pcauto.com.cn/search.jsp?q=state:1&returnType=json&appName=auto_price&perPage=0
        &clustered=cluster_price,cluster_brand,cluster_std_displacement,cluster_kind,cluster_gearbox

4.4版本修改:
返回结果增加,显示更多的条件

2.6 视频分类

备注:视频分类
 请求URL:

 HTTP请求方式:get
 是否需要登录:否
 返回格式:json
 缓存方式:无
 缓存时间:
 请求参数:
返回参数:
{
  types:[
     {
        id:1,
        name:原创视频
     },
     {
        id:2,
        name:新车视频
     },
     {
        id:3,
        name:娱乐百态
     }
  ]
}

2.6.1 价格范围

备注:价格范围
 请求URL:

 HTTP请求方式:get
 是否需要登录:否
 返回格式:json
 缓存方式:无
 缓存时间:
 请求参数:
返回参数:
{
  prices:[
     {
        id:1,
        name:10万<=
     },
     {
        id:2,
        name:10-15万
     },
     {
        id:3,
        name:15-20万
     }
  ]
}

2.6.2 用车宝典

备注:用车宝典
 请求URL:

 HTTP请求方式:get
 是否需要登录:否
 返回格式:json
 缓存方式:无
 缓存时间:
 请求参数:
返回参数:
{
  sections:[
     {
        id:1,
        name:驾驶技巧
        sections:[
           {
              id:4
              name:恶劣天气驾驶技巧
              sections:[
                 {
                   id:4
                   name:下雪怎么开车
                }
           }
        ]
     }
  ]
}

2.6.3 新车上市

备注:新车上市
 请求URL:

 HTTP请求方式:get
 是否需要登录:否
 返回格式:json
 缓存方式:无
 缓存时间:
 请求参数:
返回参数:
{
  "coming":
  {
    id
    name
  }
  "recently":
  {
  	id
    name
  }
}

2.7 资讯栏目

备注:资讯栏目
 请求URL:http://mrobot.pcauto.com.cn/v2/cms/channels/1
 HTTP请求方式:get
 是否需要登录:否
 返回格式:json
 缓存方式:无
 缓存时间:5分钟
 请求参数:
        栏目ID
        省份pro和城市city // 当栏目id为55555时该参数有效

4.4版本修改:
新增“游记”栏目(ID 000048723) 和 “赛事”栏目(000058522),位置放在“用车”后面

2.7.1 视频栏目列表

备注:视频栏目列表
 请求URL:
 HTTP请求方式:get
 是否需要登录:否
 返回格式:json
 缓存方式:无
 缓存时间:
 请求参数:
返回结果:
{
  "articleList": [
    {
      "id": "4254001",
      "pubDate": "2014-04-18",
      "title": "What is My Car? 最适合的才最好",
      "url": "http://www.pcauto.com.cn/news/425/4254001.html"
    },
    {
      "id": "3683314",
      "pubDate": "2013-12-31",
      "title": "戴姆勒Car2Share驾临鹏城 腾讯乐享创新出行",
      "url": "http://www.pcauto.com.cn/news/368/3683314.html"
    }
  ],
  "curPage": 1,
  "perPage": 100,
  "start": 1,
  "statistic": {
    "cluster_channel": [
      "新闻动态_41"
    ]
  },
  "time": 0,
  "total": 41
}

2.7.2 导购栏目列表

备注:导购栏目列表
 请求URL:
 HTTP请求方式:get
 是否需要登录:否
 返回格式:json
 缓存方式:无
 缓存时间:
 请求参数:
返回结果:
{
  "articleList": [
    {
      "id": "4254001",
      "pubDate": "2014-04-18",
      "title": "What is My Car? 最适合的才最好",
      "url": "http://www.pcauto.com.cn/news/425/4254001.html"
    },
    {
      "id": "3683314",
      "pubDate": "2013-12-31",
      "title": "戴姆勒Car2Share驾临鹏城 腾讯乐享创新出行",
      "url": "http://www.pcauto.com.cn/news/368/3683314.html"
    }
  ],
  "curPage": 1,
  "perPage": 100,
  "start": 1,
  "statistic": {
    "cluster_channel": [
      "新闻动态_41"
    ]
  },
  "time": 0,
  "total": 41
}

2.7.3 用车栏目列表

备注:用车栏目列表
 请求URL:
 HTTP请求方式:get
 是否需要登录:否
 返回格式:json
 缓存方式:无
 缓存时间:
 请求参数:
返回结果:
{
  "articleList": [
    {
      "id": "4254001",
      "pubDate": "2014-04-18",
      "title": "What is My Car? 最适合的才最好",
      "url": "http://www.pcauto.com.cn/news/425/4254001.html"
    },
    {
      "id": "3683314",
      "pubDate": "2013-12-31",
      "title": "戴姆勒Car2Share驾临鹏城 腾讯乐享创新出行",
      "url": "http://www.pcauto.com.cn/news/368/3683314.html"
    }
  ],
  "curPage": 1,
  "perPage": 100,
  "start": 1,
  "statistic": {
    "cluster_channel": [
      "新闻动态_41"
    ]
  },
  "time": 0,
  "total": 41
}

2.7.1 新车栏目列表

备注:新车栏目列表
 请求URL:
 HTTP请求方式:get
 是否需要登录:否
 返回格式:json
 缓存方式:无
 缓存时间:
 请求参数:
返回结果:
{
  "modelId": 424,//该车系第一个车型
  "modelName": “宝马3系”,//该车系第一个车型
  "serialId": 354,
  "serialName": "马自达6",
  "price": "28.3-66.2万",
  "image": "http://img.pconline.com.cn/images/upload/upc/tx/auto5/1311/05/c0/28324073_1383616337906_270x202.jpg",
  "type":1新车,2改款
}

2.8 判断文章是否已经收藏

 备注:判断文章是否已经收藏
 请求URL:
 HTTP请求方式:post
 是否需要登录:是
 返回格式:json
 缓存方式:无
 缓存时间:无
 请求参数:
        common_session_id:用户登陆后获得的认证id
        aid:文章id
 返回参数:如果已经登陆并且已经收藏,返回收藏id,否则返回-1

2.8.1 判断车系是否已经收藏

 备注:判断车系是否已经收藏
 请求URL:
 HTTP请求方式:post
 是否需要登录:是
 返回格式:json
 缓存方式:无
 缓存时间:无
 请求参数:
        common_session_id:用户登陆后获得的认证id
        sid:车系id
 返回参数:如果已经登陆并且已经收藏,返回收藏id,否则返回-1

2.8.1 判断车系是否已经收藏

 备注:判断车系是否已经收藏
 请求URL:
 HTTP请求方式:post
 是否需要登录:是
 返回格式:json
 缓存方式:无
 缓存时间:无
 请求参数:
        common_session_id:用户登陆后获得的认证id
        sid:车系id
 返回参数:如果已经登陆并且已经收藏,返回收藏id,否则返回-1

2.8.2 判断车型是否已经收藏

 备注:判断车型是否已经收藏
 请求URL:
 HTTP请求方式:post
 是否需要登录:是
 返回格式:json
 缓存方式:无
 缓存时间:无
 请求参数:
        common_session_id:用户登陆后获得的认证id
        mid:车型id
 返回参数:如果已经登陆并且已经收藏,返回收藏id,否则返回-1