Home - 微信小程序接口 登录  
最后修改者: root  2016-12-16 13:21:38 

登录

编号  :  001

GET - https://1217.com/weixin/small/1.0/?m=SmallApp&c=weixin&a=login
获取微信openID
请求参数
参数名 参数类型 必传 缺省值 描述
code string Y 登录凭证(code)
返回值
//正常返回的JSON数据包
{
    "status": 1,
    "msg": "成功",
    "data": "1qkjsdnkskclntcanzk",
}
//错误时返回JSON数据包(示例为Code无效)
{
    "status": 0,
    "msg": "失败"
}
备注
openid 派发到小程序客户端之后,可将其存储在 storage ,用于后续通信使用。
最后修改者: root  2016-12-19 10:35:29 

首页

编号  :  002

GET - https://1217.com/weixin/small/1.0/?m=SmallApp&c=weixin&a=homepage
获取首页数据
请求参数
参数名 参数类型 必传 缺省值 描述
openid string Y 微信openID
返回值
//正常返回的JSON数据包
{
    "status": 1,
    "msg": "成功",
    "data": {
        "imgUrls": [
            "http://img02.tooopen.com/images/20150928/tooopen_sy_143912755726.jpg",
            "http://img02.tooopen.com/images/20150928/tooopen_sy_143912755726.jpg"
        ],
        "examInlets": [
            {
                "titleTota": 1229,
                "subject": "kemu1",
                "subjectHeader": "科目一题库",
                "collection": 1,
                "answerError": 0,
                "highest": 98
            },
            {
                "titleTota": 1096,
                "subject": "kemu3",
                "subjectHeader": "科目四题库",
                "collection": 1,
                "answerError": 0,
                "highest": 56
            }
        ]
    }
}
//错误时返回JSON数据包(示例为Code无效)
{
    "status": 0,
    "msg": "openid不能为空"
}
最后修改者: root  2016-12-16 16:19:19 

题目题号

编号  :  003

GET - https://1217.com/weixin/small/1.0/?m=SmallApp&c=weixin&a=questionID
获取题目题号
请求参数
参数名 参数类型 必传 缺省值 描述
subject string Y kemu1 科目类别
type string Y mnks 题目分类
chapterID int N 1 章节ID
openid string N youke 微信openID
返回值
{
    "status": 1,  //请求状态
    "msg": "成功",  //请求状态信息
    "count": 1229,  //本次返回题目总数
    "data": [
        {
            "question_id": "800000",  //题目ID
            "answer": 0,  //0-未做 1-答对 2-答错
            "choose": 0,  //最后一次做题选择的答案
            "collection": 0  //是否收藏 0-未收藏  1-收藏
        }
    ]
}
备注
subject:科目一请传kemu1,科目四请传kemu3
type:模拟考试(mnks)、顺序练习(sxlx)、随机练习(sjlx)、章节练习(zjlx)、专项练习(zxlx)、易错练习(yclx)、文字题(wzlx)、图片题(tplx)、判断题(pdlx)、单选题(dxlx)、多选题(dclx)、动画题(dhlx)、我的收藏(wdsc)、我的错题(wdct)、未做题(wzt)
chapterID:在章节练习和专项练习模式下,此选项必须传入值。此值由相应接口返回。
最后修改者: root  2016-12-16 15:12:46 

题目详情

编号  :  004

GET - https://1217.com/weixin/small/1.0/?m=SmallApp&c=weixin&a=getQuestion
根据ID获取题目详情
请求参数
参数名 参数类型 必传 缺省值 描述
questionID object Y 题目ID
subject string Y 科目类别
openid string Y 微信openID
返回值
{
    "status": 1,
    "msg": "成功",
    "data": [
        {
            "id_": "17649",
            "question_id": "800000",
            "media_type": "0",
            "chapter_id": "1",
            "label_": "1.1.1.1",
            "question_": "驾驶机动车在道路上违反道路交通安全法的行为,属于什么行为?",
            "media_content": "",
            "media_width": "0",
            "media_height": "0",
            "answer_": "32",
            "option_a": "违章行为",
            "option_b": "违法行为",
            "option_c": "过失行为",
            "option_d": "违规行为",
            "option_e": "",
            "option_f": "",
            "option_g": "",
            "option_h": "",
            "explain_": "<p>“违反道路交通安全法”,违反法律法规即为违法行为。官方已无违章/违规的说法。</p>",
            "difficulty_": "1",
            "false_count": "7464155",
            "true_count": "31525748",
            "wrong_rate": "0.19143815",
            "option_type": "1",
            "collection": null,  //是否收藏
            "choose": null,  //最后一次选择的答案
            "answer": null  //最后一次答题对错 0-未做 1-答对 2-答错
        }
    ]
}
备注
questionID用get方式传输,多个ID用json进行序列化,序列化后格式为[800000,800001,800002]
最后修改者: root  2016-12-16 15:39:40 

答案提交

编号  :  005

GET - https://1217.com/weixin/small/1.0/?m=SmallApp&c=weixin&a=submitAnswer
答案记录
请求参数
参数名 参数类型 必传 缺省值 描述
openid string Y 微信openID
questionID int Y 问题ID
answer int Y 答案对错 0-未答 1-答对 2-答错
choose int Y 用户选择的答案
subject string Y 科目类别
返回值
//正常返回的JSON数据包
{
    "status": 1,
    "msg": "成功"
}
//错误时返回JSON数据包
{
    "status": 0,
    "msg": "失败"
}
最后修改者: root  2016-12-16 15:43:12 

题目收藏

编号  :  006

GET - https://1217.com/weixin/small/1.0/?m=SmallApp&c=weixin&a=collection
题目收藏接口
请求参数
参数名 参数类型 必传 缺省值 描述
openid string Y 微信openID
questionID int Y 题目ID
collection int Y 是否收藏 1-收藏 0-不收藏
subject string Y 科目类别
返回值
//正常返回的JSON数据包
{
    "status": 1,
    "msg": "成功"
}
//错误时返回JSON数据包
{
    "status": 0,
    "msg": "失败"
}
最后修改者: root  2016-12-16 16:26:47 

章节练习

编号  :  007

GET - https://1217.com/weixin/small/1.0/?m=SmallApp&c=weixin&a=chapter
获取章节信息接口
请求参数
参数名 参数类型 必传 缺省值 描述
subject string Y 科目类别
返回值
{
    "status": 1,
    "msg": "成功",
    "data": [
        {
            "id": "1",
            "title": "道路交通安全法律、法规和规章",
            "count": "520"
        },
        {
            "id": "2",
            "title": "交通信号",
            "count": "314"
        },
        {
            "id": "3",
            "title": "安全行车、文明驾驶基础知识",
            "count": "284"
        },
        {
            "id": "4",
            "title": "机动车驾驶操作相关基础知识",
            "count": "111"
        }
    ]
}
备注
此处id_用于章节模式下chapterID
最后修改者: root  2016-12-16 17:00:26 

专项练习

编号  :  008

GET - https://1217.com/weixin/small/1.0/?m=SmallApp&c=weixin&a=special
专项练习
请求参数
参数名 参数类型 必传 缺省值 描述
subject string Y 科目类别
返回值
{
    "status": 1,
    "msg": "成功",
    "data": [
        [
            {
                "text": "易错题",
                "type": "yclx"
            }
        ],
        [
            {
                "exerTip": "文",
                "text": "文字题",
                "type": "wzlx"
            },
            {
                "exerTip": "图",
                "text": "图片题",
                "type": "tplx"
            },
            {
                "exerTip": "判",
                "text": "判断题",
                "type": "pdlx"
            },
            {
                "exerTip": "单",
                "text": "单选题",
                "type": "dxlx"
            }
        ],
        [
            {
                "text": "时间",
                "examNum": "43",
                "type": "zxlx",
                "chapterID": "28"
            },
            {
                "text": "信号灯",
                "examNum": "54",
                "type": "zxlx",
                "chapterID": "35"
            },
            {
                "text": "距离",
                "examNum": "14",
                "type": "zxlx",
                "chapterID": "30"
            },
            {
                "text": "记分",
                "examNum": "37",
                "type": "zxlx",
                "chapterID": "36"
            },
            {
                "text": "罚款",
                "examNum": "4",
                "type": "zxlx",
                "chapterID": "31"
            },
            {
                "text": "酒驾",
                "examNum": "9",
                "type": "zxlx",
                "chapterID": "37"
            },
            {
                "text": "速度",
                "examNum": "46",
                "type": "zxlx",
                "chapterID": "32"
            },
            {
                "text": "灯光",
                "examNum": "48",
                "type": "zxlx",
                "chapterID": "39"
            },
            {
                "text": "标线",
                "examNum": "72",
                "type": "zxlx",
                "chapterID": "38"
            },
            {
                "text": "仪表",
                "examNum": "65",
                "type": "zxlx",
                "chapterID": "44"
            },
            {
                "text": "标志",
                "examNum": "218",
                "type": "zxlx",
                "chapterID": "33"
            },
            {
                "text": "装置",
                "examNum": "41",
                "type": "zxlx",
                "chapterID": "40"
            },
            {
                "text": "手势",
                "examNum": "12",
                "type": "zxlx",
                "chapterID": "34"
            },
            {
                "text": "路况",
                "examNum": "130",
                "type": "zxlx",
                "chapterID": "41"
            }
        ]
    ]
}
最后修改者: root  2016-12-19 11:13:56 

模拟考试交卷

编号  :  009

GET - https://1217.com/weixin/small/1.0/?m=SmallApp&c=weixin&a=mnksHandPaper
请求参数
参数名 参数类型 必传 缺省值 描述
openid string Y 微信openID
record string Y 模拟考试记录
useTime string Y 考试所用时间
subject string Y 科目类别
city string Y 城市名
返回值
//正常返回的JSON数据包
{
    "status": 1,
    "msg": "成功",
    "data": {
        "score": "77",
        "mid": "Mp20161217230400386047",//考试记录唯一ID
    }
}
//错误时返回JSON数据包
{
    "status": 0,
    "msg": "失败"
}