点赚app接口

Host:http://xxx.xxx.xxx:8000

test case: https://www.getpostman.com/collections/dbb94a25d79e5c1edc03

1、检查系统更新:/check/update

request method post:

{

"user_id":"user_id", 

"os":"android",

"version":"1.1.1",

"phone":"手机机型",

"system":"手机操作系统信息",

"androidId":"androidId"
"mac":"mac地址",
"idfa":"androidIDFA"

}

response:若需要更新,data返回跟新信息;否则,data为""

{
"code": "ok",
"msg": "",
"data": {
"ver": "1.1",  //版本号
"url": "https://play.google.com/store/apps/details?id=com.privateP.makemoney", //下载地址
"intro": [ //更新说明
"1.fix some bugs",
"2.better or easier-to-use capability"
]
}
}

2、设置邀请码/set/askcode

request method post:

{"user_id":"x0006",
"ask_code":55518403}

response:

{
"code": "ok",
"msg": "",
"data": 1
}

 

{
"code": "error",
"msg": "error info",
"data": ""
}

 

3、获得用户信息:/get/user?user_id={user_id}&device_id={device}&raw_device={raw_device}

参数:可以单独使用device_id或者user_id请求user信息,首次登陆必须使用device_id,系统会根据device_id创建帐户信息,raw_device为可选参数,传递andriod手机的device_id,用于记录推广

request method get:

response:

{
"code": "ok",
"msg": "",

"data": {
"_id": "541e7c9afc955dfa04000005",
"user_id": "81004109",
"device_id": "20F65CD9-03A6-4074-9C99-9C89422A4F25",
"create_time": 1411284122,
"ask_code": "23162462", //邀请码
"coin": 7, //当前金币数
"total_coin": 337, //累积赚取得金币数
"pupil_feed": 0, //从徒弟分成所得
"pupil_num": 2 //徒弟数目

"earn_mothed": "survey" //可有3个选项,survery:显示答题页面,offer:显示积分墙,both:两者都显示

}

}

 

{
"code": "error",
"msg": "no user found 1",
"data": ""
}

 4、刮刮卡:/game/scratch?user_id={user_id}

request method get:

response:

{
"code": "ok",
"msg": "",
"data": {
"coins": 0, //抽得金币数
"happy": false //是否开心
}
}

 

{
"code": "error",
"msg": "no enough coin",
"data": ""
}

5、大转盘/game/slyder?user_id={user_id}

request method get:

response:

{
"code": "ok",
"msg": "",
"data": {
"position": 0 //指针停留位置
}
}

{
"status": "error",
"msg": "no enough coin"
}

 

6、抽奖信息 /get/lottery

request method get:

response:

{
"status": "ok",
"msg": {
"no": "20140912",
"open_date": "2014-09-20",
"base": 30,
"winner_num": 6,   
"count": 0  //已经有多少人参加抽奖
}
}

 

{
"code": "error",
"msg": "no enough coin",
"data": ""
}

 

 

8、获取兑换配置信息 /get/exchange/config

request method get:

response:            

{
"code": "ok",
"msg": "",
"data": [
{
"type": "QQ",               //兑换类型
"title": "QQ Gigt Cards",   //显示标题

"account": [                //帐户信息
{
"type": "text",
"hint": "Your name"
},
{
"type": "email",
"hint": "Your Email"
}
],


"rule": [                   //兑换规则

{
"num": 1, //兑换数量
"coin": 100, //所需金币
"rebate": "50%", //返还比例
"unit": "$", //货币单位
"show_pic": false, //是否显示图片
"picture": "static/exchange/qq-1-1.png" //图片地址
},

{
"num": 2,
"coin": 200,
"unit": "$",
"show_pic": false,
"picture": "static/exchange/qq-2-1.png"
},
{
"num": 3,
"coin": 300,
"unit": "$",
"show_pic": false,
"picture": "static/exchange/qq-3-1.png"
}
]
},
{
"type": "Phone",
"title": "Phone Gigt Cards",
"rule": [
{
"num": 1,
"coin": 100,
"unit": "$",
"show_pic": false,
"picture": "static/exchange/phone-1-1.png"
},
{
"num": 2,
"coin": 200,
"unit": "$",
"show_pic": false,
"picture": "static/exchange/phone-2-1.png"
},
{
"num": 3,
"coin": 300,
"unit": "$",
"show_pic": false,
"picture": "static/exchange/phone-3-1.png"
}
]
},
{
"type": "Alipay",
"title": "Alipay Gigt Cards",
"rule": [
{
"num": 1,
"coin": 100,
"unit": "$",
"show_pic": false,
"picture": "static/exchange/alipay-1-1.png"
},
{
"num": 2,
"coin": 200,
"unit": "$",
"show_pic": false,
"picture": "static/exchange/alipay-2-1.png"
},
{
"num": 3,
"coin": 300,
"unit": "$",
"show_pic": false,
"picture": "static/exchange/alipay-3-1.png"
}
]
}
]
}

 

9、获取奖金配置信息 /get/prize/config?sub={subconfig}

参数:指定sub可以单独返回相应的配置,缺失时返回所有prize配置信息

request method get:

response:

{
"status": "ok",
"msg": {
"register": 100, //注册奖励
"sign": [7,30,30,7,30,30,30], //签到奖励数组,分别记录第1~7天奖励金币数
"share": 20, //每日分享奖励金币
"boss": [[10,0.15],[50,0.2],[150,0.3],[300,0.4],[100000,0.5]]}//徒弟做任务,boss的分成比例
}

 

10、抽奖/game/lottery?user_id={user_id}

request method get:

response:

{
"code": "ok",
"msg": "",
"data": 56783692 //兑奖码
}

{
"code": "error",
"msg": "no enough coin",
"data": ""
}

 

11、抽奖码查询/get/lotterycodes?user_id={user_id}&page={page}

request method get:

response:

{
"code": "ok",
"msg": "",
"data": [
{
"title": "iphone 6抽奖",   //抽奖标题
"codes": [    //兑奖码
{
"code": 47200397,
"time": "2014-09_30"
},
{
"code": 19948547,
"time": "2014-09_30"
},
{
"code": 87694215,
"time": "2014-09_30"
},
{
"code": 41674838,
"time": "2014-09_30"
}
]
},
{
"title": "iphone 6抽奖",
"winner": [       //中奖码
{
"code": 55215681
},
{
"code": 22928828
},
{
"code": 59114563
},
{
"code": 42840997
},
{
"code": 42840997
},
{
"code": 59114563
}
],
"codes": [
{
"code": 70761050,
"time": "2014-09_19"
},
{
"code": 59114563,
"time": "2014-09_19"
},
{
"code": 33912270,
"time": "2014-09_19"
},
{
"code": 42840997,
"time": "2014-09_19"
},
{
"code": 55215681,
"time": "2014-09_19"
},
{
"code": 70118976,
"time": "2014-09_19"
},
{
"code": 11337564,
"time": "2014-09_19"
},
{
"code": 68085797,
"time": "2014-09_19"
},
{
"code": 54859655,
"time": "2014-09_19"
},
{
"code": 76170134,
"time": "2014-09_19"
},
{
"code": 93686543,
"time": "2014-09_19"
},
{
"code": 22928828,
"time": "2014-09_19"
}
]
}
]
}

{
"code": "error",
"msg": "error info",
"data": ""
}

 

12、获取签到信息get/signinfo?user_id={user_id}

request method get:

response:

{
"code": "ok",
"msg": "",
"data": {
"signed_num": 4,//连续签到次数
"signed_today": true, //今日是否已签到
"prize": [7,30,30,7,30,30,30] //签到奖励
}
}

{
"code": "error",
"msg": "error info",
"data": ""
}

 

13、签到/signin?user_id={user_id}

request method get:

response:

{
"code": "ok",
"msg": "",
"data": 1
}

 

{
"code": "ok",
"msg": "",
"data": "get prize 20" //
}

{
"code": "error",
"msg": "signed today",
"data": ""
}

 

14、分享/share

request method post:

{
"user_id":"x0002", "channel":"qq" //分享渠道
}

 

response:

{
"code": "ok",
"msg": "",
"data": "today shared 1"
}

{
"code": "error",
"msg": "error info",
"data": ""
}

 

 

15、我的记录/get/record

说明:获取自己最新的活动记录,可以通过page参数控制数据返回,达到翻页的效果

request method post:

{"user_id":"x0002",
"type":"earn", //type值分为earn,exchange和share三种
"subtype":null, //子type
"page":0, //第几页,每页20个
"lang":"cn" //中英文
}

 

response:

{
"status": "ok",
"msg": [
{
"_id": "5410f1dfd7be310a2c000001",
"user_id": "x0002",
"type": "earn",   //记录类型
"sub_type": "sign", //记录子类型
"coin": 30,  //获得金币
"note": null, //详细信息
"time": 1410396639, //发生时间戳
"date": "2014-09-11" //发生日期,是冗余信息,可以由时间戳算出
},
{
"_id": "54102028abb8cd3140000004",
"user_id": "x0002",
"type": "earn",
"sub_type": "create_user",
"coin": 100,
"note": null,
"time": 1410342952,
"date": "2014-09-10"
}
]
}

{
"code": "error",
"msg": "error info",
"data": ""
}

 

 

16、兑换/exchange

request method post:

{"user_id":"x0002",
"type":"QQ", //兑换种类:QQ,alipay,phone_card
"num":"2",
"desc":"656765490", //帐户信息
"text1":"Your name",
"text2":"Your email"
}

 

response:

{
"code": "ok",
"msg": ""
}

{
"code": "error",
"msg": "no enough coin",
"data": ""
}

 

17、设置设备tokenid /set/tokenid

request method post:

{"user_id":"x0006",
"token_id":55518403}

response:

{
"code": "ok",
"msg": "",
"data": 1
}

 

{
"code": "error",
"msg": "error info",
"data": ""
}

 

18、设置联系信息/set/contact

request method post:

{"user_id":"x0022",

"QQ":"4568555858",

"email":"haha@163.com",

"phone":"1236546698",

"postcode":"100000",
"addr":"北京市",
"name":"王五"

}

response:

{
"code": "ok",
"msg": "",
"data": 0
}

 

{
"code": "error",
"msg": "error info",
"data": ""
}

 

 

19、获取游戏描述信息:/get/game/desc

request method get:

response:

{
"code": "ok",
"msg": "",
"data": {
"lottery": {  //抽奖
"cost": 50,   //每局耗费的金币数
"small_picture": "/static/small_lottery.png",  //在游戏index页上使用的图片
"large_picture": "/static/large_lottery.png",  //进入到相应游戏页面使用的图片
"title": "iphone 6抽奖",  //标题
"rule": [                 //规则
"每局只需50金币",
"共6部",
"9月20号公布结果,先到先得"
],

"codes_title": "iphone" //兑奖码页面标题
},
"scratch": { //  刮刮卡
"cost": 30,
"small_picture": "/static/small_scratch.png",
"large_picture": "/static/large_scratch.png",
"title": "刮刮卡",
"rule": [
"每局只需30金币",
"不限制次数",
"最高10倍奖励"
]
},
"slyder": {  //  大转盘
"cost": 30,
"small_picture": "/static/small_slyder.png",
"large_picture": "/static/large_slyder.png",
"title": "大转盘",
"rule": [
"每局只需30金币",
"不限制次数",
"最高20倍奖励"
]
}

"new_game": {  //预留新游戏接口
"cost": 30,
"disable": false,  //是否显示
"out_link": "www.zepen.com",  //外部链接
"small_picture": "/img/small-scratch.png",
"large_picture": "/img/large-scratch.png",
"title": "刮刮卡",
"rule": [
"每局只需30金币",
"不限制次数",
"最高10倍奖励"
]
}


}
}

 

20、获取最新的兑换信息:/get/latest/record

说明:最多返回5条信息

request method get:

response:

{
"code": "ok",
"msg": "",
"data": [
{
"_id": "541be36a402fb6102e000003",
"user_id": "x0002",
"type": "exchange",
"sub_type": "QQ",
"coin": -200,
"note": "",
"time": 1411113834,
"date": "2014-09-19"
},
{
"_id": "5412a6b2219e69950a000005",
"user_id": "x0002",
"type": "exchange",
"sub_type": "QQ",
"coin": -200,
"note": "",
"time": 1410508466,
"date": "2014-09-12"
}
]
}

 

21、客户feedback /feedback

request method post:

{

"user_id":"81004109",

"post":"how do you do" //feed的内容

}

response:

{
"code": "ok",
"msg": "",
"data": "save a feedback successfully"
}

 

22、获取用户的feeback列表:/get/feedback?user_id={user_id}

request method get:

response:

{
"code": "ok",
"msg": "",
"data": [
{
"_id": "5423df78c8d650cb5e000001",
"user_id": "81004109",
"post": "how do you do",
"leader": "",
"created": 1411637112
},
{
"_id": "5423daa6c5fa57da5c000002",
"user_id": "81004109",
"post": "how do you do",
"leader": "",
"created": 1411635878
}
]
}

 

23、记录意愿物 /record/wish

request method post:

{

"user_id":"x0022",

"desc":"xxxxxxxxxxxx", //意愿物描述

}

response:

{
"code": "ok",
"msg": "",
"data": {
"_id": "542675e00400a0933a00000b",
"user_id": "20019599",
"desc": "xxxxxxx",
"status": "create"  //新建意愿物
}
}

 

{
"code": "error",
"msg": "exist uncompleted wish",
"data": ""
}

 

24、获取意愿物:/get/wish?user_id={user_id}

request method get:

response:

{
"code": "ok",
"msg": "",
"data": {
"user_id": "48853588",
"desc": [   //详细描述

"money",  //礼物描述

"Original Price: $1000",  //原价
"Discount: 50%",   //折扣
"ZEENS: 5000000"   


],
"status": "confirm", //状态 create|confirm|refused

"reason":"太贵了",    //拒绝理由
"coin": 90000  //所需金币
}
}

 

25、兑换意愿物:/exchange/wish?user_id={user_id}

request method get:

response:

{
"code": "error",
"msg": "no confirmed wish",
"data": ""
}

 

 

26、删除意愿物:/del/wish?user_id={user_id}

request method get:

response:

{
"code": "ok",
"msg": "",
"data": 1
}

 

27、获取当前金币数:/get/coin?user_id={user_id}

request method get:

response:

{
"code": "ok",
"msg": "",
"data": {

coin:100,  // 当前金币数目

new_income:1 //1->有新收入, 0->没有新收入

}

}

 

 

28、分享比例说明:/get/share/ratio

request method get:

response:

{
"code": "ok",
"msg": "",
"data": {
"recruit": 100,   //徒弟安装应用奖励
"share_ratio": [  //徒弟做任务分成比例
{
"num": "10以下",
"ratio": "15%"
},
{
"num": "10-49",
"ratio": "20%"
},
{
"num": "50-149",
"ratio": "30%"
},
{
"num": "150-299",
"ratio": "40%"
},
{
"num": "300以上",
"ratio": "50%"
}
]
}
}

 

29、获取最新的跑马灯显示信息:/get/latest/message

说明:最多返回5条信息

request method get:

response:

{
"code": "ok",
"msg": "",
"data": {
"system": "welcome",  //系统发布的最新消息
"exchange": [    //最新的兑换信息,最多5条
{
"_id": "5448b7e878005ade3f000013",
"user_id": "23453823",
"type": "exchange",
"sub_type": "Phone",
"coin": -26000,
"note": "30",
"time": 1414051816,
"date": "2014-10-23"
},
{
"_id": "5448b7bf78005ade3f00000b",
"user_id": "23453823",
"type": "exchange",
"sub_type": "QQ",
"coin": -10000,
"note": "10",
"time": 1414051775,
"date": "2014-10-23"
}
]
}
}

 

30、邀请朋友/ask/friend?user_id={user_id}&channel={channel}

request method get:

response:

{
"code": "ok",
"msg": "",
"data": ""
}

 

31、获取赚取页面信息 /get/earn/info?user_id={user_id} 

request method get:

response:

 

{
"code": "ok",
"msg": "",
"data": {
"enable": "survey", //可有3个选项,survery:显示答题页面,offer:显示积分墙,both:两者都显示
"survey": //答题的具体信息

{

"completed":0, //是否已经答完题目
"introduce": "每道题只有一次回答的机会哦,回答之前一定要想好哦,题目每周更新,连续答对奖励翻倍!", //规则介绍
"problems": [ //题目列表
{
"problem": "1.手机游戏《刀塔传奇》中潮汐猎人的施法前摇是多久? ", //题目内容
"score": 100, //分值
"options": [  //选项
"0.5秒",
"1秒",
"1.2秒"
]
},
{
"problem": "2.手机游戏《Stick Hero》中目前排名最高的分数是多少?",
"score": 200,
"options": [
"1000",
"1200",
"5000"
]
},
{
"problem": "3.手机游戏《暖暖环游世界》中红蝴蝶佩饰的售价是多少金币?",
"score": 400,
"options": [
"50",
"70",
"100"
]
},
{
"problem": "4.手机游戏《杀手狙击之神》中的子弹时间还在以下那部游戏中出现过?",
"score": 800,
"options": [
"猎鹿人",
"火线指令",
"枪火兄弟"
]
}
]
}
}
}

 

32.提交答案:/submit/answer

request method post:

{

"user_id":"23453823",

"answer":[1,2,3,1], //答案列表

}

response:

{
"code": "error",
"msg": "You have completed before",
"data": ""
}

 

{
"code": "ok",
"msg": "",
"data": "You get 100 coins"
}

 

 

 

posted on 2014-09-04 10:44  学而知之者  阅读(501)  评论(0编辑  收藏  举报