wiki:2ndchild/interface

一.基本约定

1.当接口处理正常时,HTTP STATUS CODE 返回给200。包括有正常的业务数据和数据为空的情况。

2.当接口处理异常时,HTTP STATUS CODE 返回给500,并且给出具体的错误信息。
    {
	"uri" : "/intf/albums-by-type.jsp",
	"error-desc":"Need you follow uid.",
        "user-notice":"给用户的提示放在这里"
    }`
    
3.接口默认的字符编码是UTF-8,接口需要实现对req-enc和resp-enc参数的支持。在JSP的最顶部,实现类似下面的代码:

        String queryString = request.getQueryString();
        String requestEncoding = getParam(queryString,"req_enc");
        String responseEncoding = getParam(queryString,"resp_enc");
        if(isNotBlank(requestEncoding)){
            request.setCharacterEncoding(requestEncoding);
        }
        if(isNotBlank(responseEncoding)){
            response.setCharacterEncoding(responseEncoding);
        }

4.所有有写操作的数据接口,必须用POST方式提交,在接口里需要判断提交方式,拒绝GET的调用请求。

5.接口中的JSON字符串,key都用双引号("")包裹,value是字符串类型时,也用双引号("")包裹;是数字类型时,不用引号。

二.业务相关接口列表

1.频道接口 (mrobot)

URL:http://mrobot.pcauto.com.cn/configs/pcbaby_2tai_left_menu
作用:获取左侧主菜单
提交方式:GET
参数:无
返回结果:JSON

[
    {
        "id": 1,
        "img": "http://img0.pcauto.com.cn/pcauto/1310/16/3233041_Img388290093_thumb.jpg",
        "title": "首页资讯",
        "view": "baby-information/",
        "url": ""
    },
    {
        "id": 2,
        "img": "http://img0.pcauto.com.cn/pcauto/1310/16/3233041_Img388290093_thumb.jpg",
        "title": "二胎政策",
        "view": "baby-policy/",
        "url": ""
    },
    {
        "id": 3,
        "img": "http://img0.pcauto.com.cn/pcauto/1310/16/3233041_Img388290093_thumb.jpg",
        "title": "二胎百科",
        "view": "baby-encyclopedia/",
        "url": ""
    },
    {
        "id": 4,
        "img": "http://img0.pcauto.com.cn/pcauto/1310/16/3233041_Img388290093_thumb.jpg",
        "title": "活动专区",
        "view": "baby-activity/",
        "url": ""
    },
    {
        "id": 5,
        "img": "http://img0.pcauto.com.cn/pcauto/1310/16/3233041_Img388290093_thumb.jpg",
        "title": "收藏",
        "view": "baby-collection/",
        "url": ""
    },
    {
        "id": 6,
        "img": "http://img0.pcauto.com.cn/pcauto/1310/16/3233041_Img388290093_thumb.jpg",
        "title": "设置",
        "view": "baby-setting/",
        "url": ""
    }
]

2.资讯栏目接口 (mrobot)

URL:http://mrobot.pcbaby.com.cn/configs/pcbaby_2tai_cms_iphone_channel_tree
作用:资讯栏目
提交方式:GET
参数:无
返回结果:JSON
{
    "channels": [
        {
            "id": 1,
            "title": "头条"
        },
        {
            "id": 2,
            "title": "备孕"
        },
        {
            "id": 3,
            "title": "孕育"
        },
        {
            "id": 4,
            "title": "高龄产妇"
        }
    ]
}

3.资讯文章列表接口 (mrobot)

URL:http://mrobot.pcbaby.com.cn/v2/cms/channels/1?pageSize=20&pageNo=1
作用:获取资讯栏目
提交方式:GET
参数:
     /channels/1:栏目id ;
     type:(qzbd1tai:亲子宝典一胎,qzbd2tai:亲子宝典二胎);
     pageSize:每页显示的条数;
     pageNo:当前所在页数。

返回结果:JSON
{
  "articleList": [
    {
      "id": "3473048",
      "image": "http://img0.pcauto.com.cn/pcauto/1311/25/g_3473048_1385345794838_240x160.jpg",
      "pubDate": "2013-11-25",
      "title": "标题",
      "type": 1,
      "url": "http://www.pcauto.com.cn/nation/347/3473048.html"
    },
    {
      "id": "3473181",
      "image": "http://img0.pcauto.com.cn/pcauto/1311/25/g_3473181_1385343847663_240x160.jpg",
      "pubDate": "2013-11-25",
      "title": "标题",
      "type": 1,
      "url": "http://www.pcauto.com.cn/nation/347/3473181.html"
    }
  ],
  "focus": [
    {
      "id": "3469260",
      "image": "http://img0.pcauto.com.cn/pcauto/guangzhou/2013/jsjx/1311/11243.jpg",
      "pubDate": "2013-11-25",
      "title": "标题",
      "topicUrl": "http://www.pcauto.com.cn/guangzhou/346/3469260.html",
      "url": "http://www.pcauto.com.cn/guangzhou/346/3469260.html"
    }
  ],
  "pageNo": 1,
  "pageSize": 20,
  "topArticle": [
    {
      "id": "4245514",
      "image": "http://img0.pcauto.com.cn/pcauto/1311/25/3463325_chezhan.jpg",
      "pubDate": "2013-11-25",
      "seq": 4,
      "title": "标题",
      "to-uri": "pcautobrowser://bbs-topic/4245514",
      "type": 2
    }
  ],
  "topFocus": [
    {
      "cc-uri": "",
      "image": "http://imgad0.pcauto.com.cn/ivy/image/201311/7/13837866234700.jpg",
      "seq": 3,
      "title": "广告",
      "to-uri": "http://ivy.pcauto.com.cn/adpuba/click?adid=291573&id=auto.khd.zx.syjdt.",
      "vc-uri": "http://ivy.pcauto.com.cn/adpuba/show?adid=291573&id=auto.khd.zx.syjdt.&media=js"
    }
  ],
  "pageNo": 1,
  "pageSize": 20,
  "total": 150
}

4.资讯文章终端接口 (mrobot)

URL:http://mrobot.pcbaby.com.cn/v3/cms/articles/1275094?size=18&picRule=2&pageNo=1
作用:获取文章内容
提交方式:GET
参数:
  articleId-文章id;
  pageNo:当前所在页数;
  picRule:图片默认显示规则,0为显示小图,1为显示文字链接;2为显示大图。
  size:默认文章字体大小;
  is_1tai:值为1时,表示请求1胎文章终端且图片点击增加协议(协议与pcauto一样)。
  夜间模式:在url后面加&nigth或者#night。
  
返回结果:HTML页面
同时在html源代码中加入以下内容,此为附加信息
<!-- 
/*@_HTML_META_START_    
{"url":"http://best.pconline.com.cn/discovery_art.jsp?topicId=3064","title":"东芝 3TB DT01ACA300 7200转 64M SATA3 台式机硬盘","firstPic":"http://img.pconline.com.cn/images/upload/upc/tx/pc_best/1309/02/c0/25177373_1378101718895_350x350.jpg"}
_HTML_META_END_@*/
 -->
url:用于获取评论的url
title:文章的标题
firstPic:用于分享,文章终端的第一张图

5.资讯文章评论接口 (mrobot)

URL:http://mrobot.pcbaby.com.cn/v3/cmt/new_topics/12958224?articleId=1147610&reverse=0&pageNo=1&pageSize=20#
作用:获取文章评论数据
提交方式:GET
参数:
   /new_topics/12958224:文章评论id;
   articleId:文章id;
   pageSize:没有显示的条数;
   pageNo:当前所在页数;
   reverse:评论显示方式,0为倒序,即从最新的评论开始显示;1为正序,即从最旧的评论开始显示。
返回结果:JSON
{
  "comments": [
    {  //没有引用其他评论的评论
      "1": { //表达其引用关系的key
        "id":"24991904",//帖子id
        "name": "不是网易的江苏省盐城市网友&nbsp;帅气飞扬: ",  //用户名称
        "floor": "1737",  //楼层
        "time": "2013-01-05 09:05:40",  //时间
        "content": "内容过于暴力,已和谐" //内容
      },
      "current":"1",               //当前最外层引用标识
      "support":"10086"       //"顶"数量
      "expand":false  //判断是否展开,默认为false
    },
    {
      "3": {
        "id":"24991804",//帖子id
        "name": "不是网易的江苏省盐城市网友&nbsp;帅气飞扬: ",
        "floor": "1737",
        "time": "2013-01-05 09:05:40",
        "content": "内容过于暴力,已和谐"
      },
      "2": {
        "id":"24941904",//帖子id
        "name": "不是网易的江苏省盐城市网友&nbsp;帅气飞扬: ",
        "floor": "1737",
        "time": "2013-01-05 09:05:40",
        "content": "内容过于暴力,已和谐"
      },
      "1": {
        "id":"24491904",//帖子id
        "name": "不是网易的江苏省盐城市网友&nbsp;帅气飞扬: ",
        "floor": "1737",
        "time": "2013-01-05 09:05:40",
        "content": "内容过于暴力,已和谐"
      },
      "4": {
        "id":"24993904",//帖子id
        "name": "不是网易的江苏省盐城市网友&nbsp;帅气飞扬: ",
        "floor": "1737",
        "time": "2013-01-05 09:05:40",
        "content": "内容过于暴力,已和谐"
      },
      "current":"4",
      "support":"10086" //顶数
      "expand":false  //判断是否展开,默认为false
    }
  ],
  "hot-comments": [
    {  //没有引用其他评论的评论
      "1": { //表达其引用关系的key
        "id":"24691904",//帖子id
        "name": "不是网易的江苏省盐城市网友&nbsp;帅气飞扬: ",  //用户名称
        "floor": "1737",  //楼层
        "time": "2013-01-05 09:05:40",  //时间
        "content": "内容过于暴力,已和谐" //内容
      },
      "current":"1"
      "support":"10086" //顶数
      "expand":false  //判断是否展开,默认为false
    }
  ]
}

5.1 获取最新楼层数和文章评论id (mrobot)

URL:http://mrobot.pcbaby.com.cn/v3/cmt/get_newest_floor?url=http://huaiyun.pcbaby.com.cn/yunqian/shengyu/1210/1147610.html
作用:获取文章评论数据
提交方式:GET
参数:
   url:文章url
返回结果:JSON
{
    "total": 3512,
    "id": 12958224,//文章评论id
    "floor": 4069,//当前最新楼层数
    "turl": "http://huaiyun.pcbaby.com.cn/yunqian/shengyu/1210/1147610.html",
    "url43g": "http://cmt.pcbaby.com.cn/topic/3g/a0/r0/t12958224.html",
    "url": "http://cmt.pcbaby.com.cn/topic/a0/r0/p1/ps30/t12958224.html"
}

6.二胎政策接口

URL:http://banshi.pcbaby.com.cn:8004/intf/app/policy.jsp
作用:
提交方式:GET
参数:
areaId:地区id
返回结果:JSON
{
    "result":0,(0未实施,1已实施)
    "detail-text":"广东省广州市天河区五山街道华工社区于2014年01月14日开始实施单独二胎政策",
    "text":"广东省广州市于2014年01月14日开始实施单独二胎政策",
    "articleList":
    [{
      "id": "3473181",
      "title": "官方公告",
      "type": 1,
      "uri": "http://www.pcauto.com.cn/nation/347/3473181.html"
    }, {
      "id": "3473181",
      "title": "精彩推荐",
      "type": 2,
      "uri": "pcbabybrowser://information-channel/${channelid}?channelName=精彩推荐"
    }, {
      "id": "3473181",
      "title": "热门话题",
      "type": 3,
      "uri": "pcbabybrowser://topics-list/${channelid}?channelName=热门话题"
    }]
}

title和type固定,
精彩推荐,热门话题的uri根据文章栏目和帖子栏目改相应的id

6.1官方公告

URL:http://banshi.pcbaby.com.cn:8004/intf/app/policydetail.jsp?id=26700
作用:
提交方式:GET
参数:
id:地区id
返回结果:HTML页面

7.地址查询接口

URL:http://banshi.pcbaby.com.cn/intf/app/area.jsp
作用:
提交方式:GET
lastid:最新的id
参数:
返回结果:JSON
如果有更新,update为1,否则为0
{
   "lastid":123125,
   "update":1,
   "nodes":[
        "id":1,
        "name":"广东",
        "nodes":[
            "id":1,
            "name":"广州",
            "nodes":[
                "id":1,
                "name":"天河"
            ]
        ]
    ]
}

{
"last":123125,
"update":0
}
ps:先精确到区,如果有镇和街道的数据,则以此类推。

8.热门话题列表 (mrobot)

URL:http://mrobot.pcbaby.com.cn/v2/bbs/forums/2190?filter=top&pageNo=1
作用:获取亲子网帖子列表
提交方式:GET
参数:
    /forums/2190?:论坛版块id;
    pageNo:页数,不需要pageSize,具体每页显示的条数由论坛后面配置,目前是每页显示50条;
    filter:  pick,精选贴;top,置顶帖;hot,热门帖。其中置顶帖、热门帖没有分页;
    orderby: postat,发帖时间排序;replyat,回帖时间排序(默认回帖排序)。
返回结果:json数据

8.1热门话题终端页帖子接口 (mrobot)

URL:http://mrobot.pcbaby.com.cn/v2/bbs/topics/1647307?pageNo=1&pageSize=20&picRule=0&app=pcbabybrowse 
作用:获取帖子页
提交方式:GET
参数:
     /topics/1647307:帖子id;
     pageSize:每页显示的条数;
     pageNo:当前所在页数;
     picRule:图片默认显示规则,0为显示小图,1为显示文字链接;2为显示大图。
     app:论坛版块跳转协议参数。

返回结果:HTML页面

9办证单位查询接口

URL:http://banshi.pcbaby.com.cn:8004/intf/app/office.jsp
作用:
提交方式:GET
参数:
areaId:地区id
返回结果:JSON
{
   “city”:[
    {
      "id":1,
      "name":"广州计生办",
      "address":"",
      "tel":"19986",
"phone":"",
      "type":1,
"show":1
    }, {
      "id":1,
      "name":"广州居委会",
      "address":"",
      "tel":"19986",
"phone":"",
      "type":1,
"show":1
    }
  ],
   “district”:[
    {
      "id":1,
      "name":"广州天河区计生办",
      "address":"",
      "tel":"19986",
      "type":1,
"show":0
    }, {
      "id":1,
      "name":"广州天河区居委会",
      "address":"",
      "tel":"19986",
      "type":1,
"show":0
    }
  ],
   “street”:[
    {
      "id":1,
      "name":"广州天河区新塘计生办",
      "address":"",
      "tel":"19986",
      "type":1,
"show":0
    }, {
      "id":1,
      "name":"广州天河区新塘居委会",
      "address":"",
      "tel":"19986",
      "type":1,
"show":0
    }
  ]
}
show:需要被下级单位显示

9.1办事单位地点添加接口

URL:http://banshi.pcbaby.com.cn:8004/intf/app/feedbackoffice.jsp
作用:
提交方式:POST
参数:
accountId:用户id(如果已登录)
type:类型:1=新增,2=修改
units:一个json格式的字符串,内容如下:
[
    {
      "id": 1231,//新增则无id
      "areaId": 123,
      "address": "asdfasd",
      "name": "asdfasd",
      "tel": "020-12345678"
    }
  ]

         
返回结果:JSON
{
   “uri”:路径
   “result”:1,(0失败,1成功)
    "msg":"提交成功"
}

10.单独二胎政策实施时间添加接口

URL:http://banshi.pcbaby.com.cn:8004/intf/app/feedbackpolicy.jsp
作用:
提交方式:POST
参数:
accountId:用户id
areaId:地区id
date:实施时间,“2014-02-09”,格式 yyyy-MM-dd
返回结果:JSON
        accountId:用户id
        areaId:地区id
        type:类型: 1=时间错误, 2=已经开始实施
        date:实施时间,“2014-02-09”,格式 yyyy-MM-dd
        content:反馈内容
        link:参考链接
{
“result”:1,(0失败,1成功)
"msg":"提交成功"
}

11.办事指南接口

URL:http://banshi.pcbaby.com.cn:8004/intf/app/process.jsp?areaId=3
作用:
提交方式:GET
参数:
areaId:省份id
返回结果:HTML页面
点击步骤跳转协议:pcbabybrowser://procedure-detail/${id}?count=4&num=1&areaId=${areaId}
点击文章跳转协议:pcbabybrowser://information-article/1276412
点击帖子跳转协议:pcbabybrowser://bbs-topic/4337761

12.办事指南详细解释接口

URL:http://banshi.pcbaby.com.cn:8004/intf/app/processitem.jsp?processId=241&count=2&num=2&areaId=3
作用:
提交方式:GET
参数:
返回结果:HTML页面
点击纠错跳转协议:pcbabybrowser://correction/${id}
点击办证材料:pcbabybrowser://baby-webview/?url=http://xxxx
点击查看配偶办事单位:pcbabybrowser://baby-search-unit/
点击电话:pcaction://baby-tel/?tel=${tel}
点击地址:pcaction://baby-map/?address=${address}
用于纠错功能的显示,需要在里面加入json
/*@_HTML_META_START_{"units": [{"areaId":"3","id":"31","name":"北京相关部门","address":"北京市天高皇帝远","tel":"010 110","pro":"北京市","city":"北京市","region":"朝阳区"}]}_HTML_META_END_@*/

12.1办证材料详细解释接口

URL:http://banshi.pcbaby.com.cn:8004/intf/app/material/${materialId}.html
作用:
提交方式:GET
参数:
返回结果:HTML页面
页面中,使用html注释以下格式json,用于纠错功能
/*@_HTML_META_START_
{
  "units": [
    {
      "id": 1231,
      "areaId": 123,
      "address": "asdfasd",
      "tel": "020-12345678",
      "pro": "xx省",
      "city": "xx市",
      "region": "xx区"
    },
    {
      "id": 1231,
      "areaId": 123,
      "address": "asdfasd",
      "tel": "020-12345678",
      "pro": "xx省",
      "city": "xx市",
      "region": "xx区"
    }
  ]
}
_HTML_META_END_@*/

13.办事指南纠错接口

URL:http://banshi.pcbaby.com.cn:8004/intf/app/feedbackoffice.jsp
作用:
提交方式:POST
参数:
accountId:用户id
type:类型:1=新增,2=修改
other:其他补充,字符串
units:一个json格式的字符串,内容如下:
[
    {
      "id": 1231,//新增则无id
      "areaId": 123,
      "address": "asdfasd",
      "name": "asdfasd",
      "tel": "020-12345678"
    },
    {
      "id": 1231,
      "areaId": 123,
      "address": "asdfasd",
      "name": "asdfasd",
      "tel": "020-12345678"
    }
  ]

         
返回结果:JSON
{
   “uri”:路径
   “result”:1,(0失败,1成功)
    "msg":"提交成功"
}

14.精彩活动接口

URL:http://www.pcbaby.com.cn/huodong/list/2tai/
作用:
提交方式:GET
参数:
返回结果:HTML页面
点击具体活动页跳转协议pcbabybrowser://baby-webview/?url=http://xxxx&title=每日签到
ps:此url后要跟userId

14.1活动详细页

URL:14.精彩活动接口提供url,如http://www1.pcbaby.com.cn/app/20131122/hd/s-join.html?userId=12314
作用:
提交方式:GET
参数:
{
“userId”:[string 用户的id]
}
返回结果:HTML页面
点击活动登录页跳转协议pcbabybrowser://user-login/

15.百科列表接口

URL:http://baike.pcbaby.com.cn/intf/app/content_wiki_312.jsp?REQUEST_CODE=312
   
作用:
提交方式:GET
参数:
  “REQUEST_CODE” : 312[请求代码]
返回结果:JSON
{
 "RESPONSE_CODE": [
 int返回代码,
 与请求代码一致
  ],
 "RESPONSE_STATUS”: [
 int返回状态,
 参考第三章.返回状态参数对照表
  ],
 ”RESPONSE_INFO”{
 "updateTime”: [
 时间戳此接口更新时间
  ]"wikiSortCount”: [
 int一级分类数量
  ]"wikiSortList”[
 {
  "wikiSortName”: [
  string一级分类名
   ]"isHaveSecondSort”: [
  bool是否有二级分类
   ]"wikiSortUrl”: [
  string一级分类页对应url,
  如果isHaveSecondSort为false必须提供
   ]"wikiSecondSortCount”: [
  int二级分类数量,
  如果isHaveSecondSort为true必须提供
   ]"wikiSecondSortList”  [
  {
    如果isHaveSecondSort为true必须提供"wikiSecondSortName”: [
   string二级分类名
    ]"isHaveThirdSort”: [
   bool是否有三级分类
    ]"wikiSecondSortUrl”: [
   string二级分类页对应url,
   如果isHaveSecondSort为false必须提供
    ]"wikiThirdSortCount”: [
   int三级分类数量如果isHaveSecondSort为true必须提供
    ]"wikiThirdSortList”: [
   {
     如果isHaveSecondSort为true必须提供"wikiThirdSortName”: [
    string三级分类名
     ]"wikiThirdSortUrl”: [
    string三级分类页对应url
     ]
   }
    ]
  }
   ]
 }
  ]
}
}

15.1百科是否有更新

URL:http://baike.pcbaby.com.cn/intf/app/content_wiki_update_309.jsp
作用:百科是否有更新
提交方式:GET
{
“REQUEST_CODE” : 309 [请求代码]
}
参数:
返回结果:JSON
“RESPONSE_CODE”  :  [int 返回代码,与请求代码一致]
“RESPONSE_STATUS”:  [int返回状态,参考第三章.返回状态参数对照表]]
”RESPONSE_INFO” 
{
	“updateTime”:[时间戳 此接口更新时间]
}
  

15.2百科搜索

URL:http://baike.pcbaby.com.cn/intf/app/content_wiki_search_310.jsp
作用:百科搜索
ps:因为此接口搜索内容为接口15的第四级内容,iOS和android端均使用本地搜索代替,此接口暂时无用
提交方式:GET
{
“REQUEST_CODE” : 310 [请求代码]
“keywords”:[string 搜索的关键字]
}
参数:
返回结果:JSON
“RESPONSE_CODE”  :  [int 返回代码,与请求代码一致]
“RESPONSE_STATUS”:  [int返回状态,参考第三章.返回状态参数对照表]]
”RESPONSE_INFO” 
{
“wikiThirdSortList”:
[{
		“wikiThirdSortName”:[string 三级分类名]
“wikiThirdSortUrl”:[string 三级分类页对应url]
}]
}

15.3状态返回

返回状态参数对照表

描述RESPONSE_INFO缩写值RESPONESE_STATUS
成功RESPONSE_STATUS_OK100
失败RESPONSE_STATUS_FAIL500
请求Json格式错误RESPONSE_STATUS_JSON_ERROR501
没有操作权限RESPONSE_STATUS_NOPERMISSION401
不可识别命令RESPONSE_STATUS_UNRECOGNIZED402
参数错误RESPONSE_STATUS_PARAMERROR403

16.百科终端接口

URL:
作用:
提交方式:GET
参数:
返回结果:HTML页面

17.获取最新关注列表(mrobot)

URL:http://mrobot.pcbaby.com.cn/v3/cms/get2taiGuideArticleList?pageNo=1&pageSize=20&q=%E5%B9%BF%E5%B7%9E%E5%B8%82&from=20131223&to=20140107
作用:获取二胎指南文章列表
提交方式:GET
参数:
    pageNo:页数;
    pageSize:每页显示的条数;
    q:搜索关键字,如:广州市;
    from:搜索文章时的时间范围起点,此时间为文章的发布时间,格式为: yyyyMMdd,如:20131223;
    to:搜索文章时的时间范围终点,此时间为文章的发布时间,格式为: yyyyMMdd,如:20140107。from参数为空时在所有时间范围内搜索文章;to参数为空时,搜索的时间范围为从from到当天。
返回结果:HTML页面

18.完善个人信息页

URL:http://banshi.pcbaby.com.cn:8004/intf/app/info.jsp  
作用:完善个人信息提交
提交方式:GET
参数:
       accountId:用户id
       feedbackids:类型(表)_id,多个表用分号分隔,多个id用下划线分隔。如:
返回结果:HTML页面
提交后跳转:pcaction://commit-message?result=0   1成功,0失败

19.应用推荐页

URL:    ios: http://www.pcbaby.com.cn/app/recommend/2tai_iphone/  
    android : http://www.pcbaby.com.cn/app/recommend/2tai_android/   
作用:应用推荐
提交方式:GET
参数:
返回结果:HTML页面

20.关于我们

URL:
作用:关于我们
提交方式:GET
参数:
返回结果:HTML页面

二.业务无关接口列表

1.更新token接口

URL:http://banshi.pcbaby.com.cn:8004/intf/app/token.jsp
作用:
提交方式:POST
参数:
accountId:用户id
areaId:地区id
token:"a8b8a9d9c9ef1231"辨认设备的标记
返回结果:JSON

2.登录接口

URL:
作用:
提交方式:POST
  username:用户名
  password:密码
参数:
返回结果:JSON
{
    "status": 0,
    "message": "ok",
    "session": "123456",
    "userId": 25520497,
    "common_session_id": "123456"
}

3.ip定位接口

URL:http://whois.pconline.com.cn/ipJson.jsp?level=3
作用:
提交方式:POST
参数:
level:可指定输出结果的精度,=1/=2/=3分别代表只输出省名称/输出省市名称/输出省市区名称 
ps:暂时测试可知,市名可确定,但区名不一定可以
返回结果:JSON
{
  "ip": "14.23.114.34",
  "pro": "广东省",
  "city": "广州市",
  "region": "",
  "addr": "广东省广州市",
  "regionNames": ""
}