[关闭]
@anigm 2016-12-05T05:19:05.000000Z 字数 13945 阅读 1503

api文档


地址格式

http://www.110.abc/index.php?mod=mobile&name=api&do=user

通用状态 (用户session丢失,非法访问)

  1. {"error":"-3","msg":"认证失败","data":""}

登陆接口 action=login

http://www.110.abc/index.php?mod=mobile&name=api&do=user&action=login&email=160294913@qq.com&pwd=123456

传递参数 email(邮箱) pwd(密码) md5 传输

状态 错误
  1. {"error":"-1","msg":"请输入邮箱","data":""}


  1. {"error":"-1","msg":"请输入密码","data":""}


  1. {"error":"-2","msg":"账户已被禁用","data":""}


  1. {"error":"-1","msg":"用户名或密码错误","data":""}


状态 成功
  1. {"error":"1","msg":{"id":"28","email":"160294913@qq.com","passwd":"7/4O","openid":"2016101712349","status":"1","t":"1477300685","u":"731869","d":"4909987","transfer_enable":"102400000000","port":"2048","switch1":"1","enable":"1"},"data":""}
返回参数说明

登出接口 action=logout

http://www.110.abc/index.php?mod=mobile&name=api&do=user&action=logout

状态
  1. {"error":"1","msg":"","data":""}

用户信息 action=member

http://www.110.abc/index.php?mod=mobile&name=api&do=user&action=member

状态
  1. {"error":"1","msg":{"id":"28","email":"160294913@qq.com","openid":"2016101712349","realname":"aa","passwd":"","createtime":"1476678736","t":"1477300685","u":"731869","d":"4909987","transfer_enable":"102400000000","port":"2048","switch1":"1","enable":"1","vip":"0"},"data":""}
返回参数说明

用户信息修改 action=memberedit

http://www.110.abc/index.php?mod=mobile&name=api&do=user&action=memberedit&realname=aa

传递参数 realname(用户昵称)

状态 错误
  1. {"error":"-1","msg":"用户名不能为空","data":""}
状态 成功
  1. {"error":"1","msg":"资料修改成功","data":""}

修改密码 action=pwd

http://www.110.abc/index.php?mod=mobile&name=api&do=user&action=pwd&pwd=000000&oldpwd=123456

传递参数 pwd(密码) oldpwd(旧密码)
状态 错误
  1. {"error":"-1","msg":"请输入密码","data":""}
  1. {"error":"-1","msg":"原始密码错误","data":""}
  1. {"error":"-1","msg":"请输入密码","data":""}
状态 成功
  1. {"error":"1","msg":"密码修改成功","data":""}

订单删除 action=myorderdel

http://www.110.abc/index.php?mod=mobile&name=api&do=user&action=myorderdel&id=xxx

id 订单id

状态 成功

  1. {"error":"1","msg":"操作成功","data":""}

状态 错误

  1. {"error":"-1","msg":"系统错误","data":""}

我的订单 action=myorder

http://www.110.abc/index.php?mod=mobile&name=api&do=user&action=myorder&status=99
http://www.110.abc/index.php?mod=mobile&name=api&do=user&action=myorder&status=99&page=2

传递参数 status(状态) status=0 待付款 status=3 已完成 status=99 全部 status=-1 已关闭 page 分页 status=5 已删除

page 分页

状态 错误 (status获取失败)
  1. {"error":"-1","msg":"系统错误","data":""}
状态 成功

有数据

  1. {"error":"1","msg":"获取成功","data":{"count":"7","pagesize":"10","pagecount":"1","thispage":"1","list":{"516":{"id":"516","openid":"2016112109504","ordersn":"20161122769883","price":"0.01","status":"0","paytypename":"微信支付","remark":"xxx","createtime":"1479809898","title":"400G流量套餐"},"511":{"id":"511","openid":"2016112109504","ordersn":"20161122542477","price":"0.01","status":"0","paytypename":"支付宝(手机版)","remark":"xxx","createtime":"1479809850","title":"400G流量套餐"},"510":{"id":"510","openid":"2016112109504","ordersn":"20161122162578","price":"0.01","status":"0","paytypename":"微信支付","remark":"xxx","createtime":"1479809813","title":"400G流量套餐"},"509":{"id":"509","openid":"2016112109504","ordersn":"20161122491121","price":"0.01","status":"0","paytypename":"支付宝(手机版)","remark":"xxx","createtime":"1479809779","title":"400G流量套餐"},"508":{"id":"508","openid":"2016112109504","ordersn":"20161122456777","price":"0.01","status":"0","paytypename":"微信支付","remark":"xxx","createtime":"1479809385","title":"400G流量套餐"},"491":{"id":"491","openid":"2016112109504","ordersn":"20161122367973","price":"0.01","status":"0","paytypename":"支付宝(手机版)","remark":"","createtime":"1479796610","title":"400G流量套餐"},"483":{"id":"483","openid":"2016112109504","ordersn":"20161121535869","price":"0.01","status":"3","paytypename":"支付宝(手机版)","remark":"","createtime":"1479727454","title":"400G流量套餐"}}}}
  1. {"error":"2","msg":"没有数据","data":""}

分类 action=category

http://www.110.abc/index.php?mod=mobile&name=api&do=user&action=category

状态 错误 (status获取失败)

  1. {"error":"-1","msg":"没有产品","data":""}
状态 成功
  1. {"error":"1","msg":"ok","data":[{"id":"1","name":"基础产品"},{"id":"2","name":"高级产品"},{"id":"3","name":"回国模式产品"}]}

分类商品列表 action=goodlists

http://www.110.abc/index.php?mod=mobile&name=api&do=user&action=goodlists

  1. {"error":"1","msg":"ok","data":{"1":{"id":"1","name":"包月服务","deleted":"0","enabled":"1","parentid":"0","displayorder":"0","goods":[{"id":"9","title":"6个月套餐","description":"6个月套餐","marketprice":"0.10"},{"id":"7","title":"1个月套餐","description":"1个月套餐","marketprice":"0.10"},{"id":"8","title":"3个月套餐","description":"3个月套餐","marketprice":"0.10"}]},"2":{"id":"2","name":"包年服务","deleted":"0","enabled":"1","parentid":"0","displayorder":"0","goods":[{"id":"10","title":"3年套餐","description":"3年套餐","marketprice":"0.10"},{"id":"11","title":"1年套餐","description":"1年套餐","marketprice":"0.10"},{"id":"12","title":"2年套餐","description":"2年套餐","marketprice":"0.10"}]},"3":{"id":"3","name":"流量购买","deleted":"0","enabled":"1","parentid":"0","displayorder":"0","goods":[{"id":"13","title":"1G流量套餐","description":"1G流量套餐","marketprice":"0.10"},{"id":"14","title":"3G流量套餐","description":"3G流量套餐","marketprice":"0.10"},{"id":"15","title":"5G流量套餐","description":"5G流量套餐","marketprice":"0.10"},{"id":"16","title":"10G流量套餐","description":"10G流量套餐","marketprice":"0.10"}]}}}
  2. ``` json
  3. <div class="md-section-divider"></div>
  4. ### 分类商品列表 action=goodlist
  5. > http://www.110.abc/index.php?mod=mobile&name=api&do=user&action=goodlist
  6. <div class="md-section-divider"></div>
  7. #### 传递参数 pcate 分类id
  8. > http://www.110.abc/index.php?mod=mobile&name=api&do=user&action=goodlist&pcate=1
  9. <div class="md-section-divider"></div>
  10. ##### 状态 错误
  11. <div class="md-section-divider"></div>
  12. ``` json
  13. {"error":"-1","msg":"没有产品","data":""}
状态 成功
  1. {"error":"1","msg":"ok","data":[{"id":"1","title":"一天-1G流量(免费)每天0点前有效","description":"一天-1G流量(免费)每天0点前有效","marketprice":"1.00"},{"id":"2","title":"包年-A套餐(聪明版)","description":"包年-A套餐(聪明版)","marketprice":"45.00"},{"id":"3","title":"轻松月付套餐","description":"轻松月付套餐","marketprice":"12.00"},{"id":"4","title":"流量通用包","description":"","marketprice":"0.00"},{"id":"5","title":"苹果6s","description":"","marketprice":"1000.00"}]}
  1. {"error":"2","msg":"没有数据","data":""}

商品信息 action=detail

传递参数 id 商品id

http://www.110.abc/index.php?mod=mobile&name=api&do=user&action=detail&id=2

状态 错误
  1. {"error":"-1","msg":"系统错误","data":""}
  1. {"error":"-2","msg":"请选择包月|包年套餐","data":""}
  1. {"error":"-2","msg":"请选择流量套餐","data":""}
  1. {"error":"-1","msg":"抱歉,商品不存在或是已经被删除","data":""}
  1. {"error":"-1","msg":"抱歉,商品库存不足","data":""}
状态 成功

带规格参数 (废除)

  1. {"error":"1","msg":"ok","data":{"id":"2","title":"包年-A套餐(聪明版)","description":"包年-A套餐(聪明版)","totalcnf":"0","total":"198","content":"<p>包年-A套餐(聪明版)<br></p>","marketprice":"45.00","createtime":"1475054035","allspecs":[{"id":"2","title":"选择帐单周期","goodsid":"2","displayorder":"0","items":[{"id":"5","title":"¥45.00RMB 每年","displayorder":"0"},{"id":"6","title":"¥80.00RMB 每两年","displayorder":"1"},{"id":"7","title":"¥110.00RMB 每三年","displayorder":"2"}]},{"id":"3","title":"流量(每月/GB)","goodsid":"2","displayorder":"1","items":[{"id":"8","title":"20G 免费","displayorder":"0"},{"id":"9","title":"30G 加 ¥10.00RMB","displayorder":"1"},{"id":"10","title":"40G 加 ¥20.00RMB","displayorder":"2"},{"id":"11","title":"50G 加 ¥30.00RMB","displayorder":"3"}]}]}}

不带规格参数

  1. {"error":"2","msg":"ok","data":{"id":"3","title":"轻松月付套餐","description":"轻松月付套餐","totalcnf":"0","total":"10","content":"<p>轻松月付套餐<br></p>","marketprice":"12.00","createtime":"1475054183"}}

商品信息规格参数返回价格信息 action=goodoption

传递参数 id 商品id id1 自定义商品规格列表1 id2 自定义商品规格列表2(没有不用填)

http://www.110.abc/index.php?mod=mobile&name=api&do=user&action=goodoption&id=2&id1=5&id2=11

状态 错误
  1. {"error":"-1","msg":"系统错误","data":""}
状态 成功
  1. {"error":"1","msg":"ok","data":[{"id":"5","title":"¥45.00RMB 每年+50G 加 ¥30.00RMB","marketprice":"75.00","specs":"5_11"}]}

文章列表 action=articlelist

传递参数 id 商品id

http://www.110.abc/index.php?mod=mobile&name=api&do=user&action=articlelist&id=2&page=1

传递参数 id 2 公告信息 3 帮助中心 page 分页

状态 错误
  1. {"error":"-1","msg":"非法操作","data":""}
状态 成功
  1. {"error":"2","msg":"没有数据","data":""}
  1. {"error":"1","msg":"ok","data":{"count":"6","pagesize":"5","pagecount":"2","thispage":"1","list":[{"id":"6","title":"文章11","description":"帮助","did":"2"},{"id":"5","title":"文章11","description":"帮助","did":"2"},{"id":"4","title":"文章11","description":"帮助","did":"2"},{"id":"3","title":"文章11","description":"帮助","did":"2"},{"id":"2","title":"文章11","description":"帮助","did":"2"}]}}

文章信息 action=article

传递参数 id 商品id

http://www.110.abc/index.php?mod=mobile&name=api&do=user&action=article&did=2&id=6

传递参数 did 分类id id 文章id

状态 错误
  1. {"error":"-1","msg":"非法操作","data":""}
状态
  1. {"error":"2","msg":"没有数据","data":""}
  1. {"error":"1","msg":"ok","data":{"id":"6","title":"文章11","description":"帮助","content":"<p>帮助</p>","createtime":"1476164439"}}

忘记密码(发送邮箱验证码) action=repwd

http://www.110.abc/index.php?mod=mobile&name=api&do=user&action=repwd&email=390771667@qq.com

传递参数 email 邮箱

状态 错误
  1. {"error":"-1","msg":"未找到相关账户","data":""}
  1. {"error":"-1","msg":"系统错误","data":""}
状态 成功
  1. {"error":"1","msg":"验证码发送成功","data":""}

忘记密码(验证邮箱安全码修改密码) action=newpwd

http://www.110.abc/index.php?mod=mobile&name=api&do=user&action=newpwd&email=390771667@qq.com

传递参数 email 邮箱 email_password 邮箱验证码 recheckpwd 新密码

状态 错误
  1. {"error":"-1","msg":"未找到相关账户","data":""}
  1. {"error":"-1","msg":"请输入邮箱地址","data":""}
  1. {"error":"-1","msg":"请输入邮箱验证码","data":""}
  1. {"error":"-1","msg":"请输入新密码","data":""}
  1. {"error":"-1","msg":"验证码错误","data":""}
  1. {"error":"-1","msg":"系统错误","data":""}
状态 成功
  1. {"error":"1","msg":"密码修改成功","data":""}

注册账号 action=regedit (只能注册普通会员)

http://www.110.abc/index.php?mod=mobile&name=api&do=user&action=regedit&email=390771667@qq.com&pwd=222222&realname=xx

传递参数 email 邮箱 pwd 密码 realname 用户昵称

状态 错误
  1. {"error":"-4","msg":"商城已关闭注册","data":""}
  1. {"error":"-1","msg":"请输入邮箱地址","data":""}
  1. {"error":"-1","msg":"请输入密码","data":""}
  1. {"error":"-2","msg":"该邮箱已被注册","data":""}
  1. {"error":"-1","msg":"系统错误","data":""}
  1. {"error":"-1","msg":"端口不足","data":""}
状态 成功
  1. {"error":"1","msg":"注册成功","data":""}

ss密码修改 action=ss

传递参数 passwd ss密码

http://www.110.abc/index.php?mod=mobile&name=api&do=user&action=ss&passwd=xxx

状态 错误
  1. {"error":"-1","msg":"ss密码不能为空","data":""}
状态 成功
  1. {"error":"1","msg":"SS密码修改成功","data":""}

得到用户流量信息 action=showtransfer

http://www.110.abc/index.php?mod=mobile&name=api&do=user&action=showtransfer&port=1032

传递参数 port 端口号

状态 错误
  1. {"error":"-2","msg":"端口不能为空","data":""}
  1. {"error":"-1","msg":"系统错误","data":""}
状态 成功
  1. {"error":"1","msg":"ok","data":{"t":"0","u":"0","d":"0","transfer_enable":"20971520","switch1":"1","enable":"1","vip":"0","end_time":"","istest":""}}

- istest 这个先保留

修改中.......

商品购买 属性选择 action=confirm

传递参数 passwd ss密码

http://www.110.abc/index.php?mod=mobile&name=api&do=user&action=confirm&id=5&optionid=21

传递参数 id 商品id optionid 规格参数id

状态 错误
  1. {"error":"-1","msg":"商品自定义信息出错","data":""}
  1. {"error":"-2","msg":"请选择包月|包年套餐","data":""}
  1. {"error":"-2","msg":"请选择流量套餐","data":""}
状态 成功
  1. {"error":"1","msg":"ok","data":[{"id":"5","title":"苹果6s","createtime":"1476952033","marketprice":"1200.00","credit":"0","total":"1","optionid":"21","optionname":"32GB","weight":"0.00","stock":"4","totalprice":"1200"}]}

商品购买 提交订单 action=orders

传递参数 passwd ss密码

http://www.110.abc/index.php?mod=mobile&name=api&do=user&action=orders&id=5&optionid=21&passwd=123&remark=xxx&pay=2

传递参数 id 商品id optionid 规格参数id(取消) passwd ss密码 remark 备注信息(可不写)

传递参数 pay 1 微信 2 支付宝

状态 错误
  1. {"error":"-1","msg":"非法操作","data":""}
  1. {"error":"-2","msg":"请选择包月|包年套餐","data":""}
  1. {"error":"-2","msg":"请选择流量套餐","data":""}
  1. {"error":"-1","msg":"没有找到商品","data":""}
  1. {"error":"-1","msg":"请填写SS密码","data":""}
  1. {"error":"-1","msg":"支付选项不能为空","data":""}
状态 成功
  1. {"error":"1","msg":"ok","data":{"info":{"openid":"2016111713409","ordersn":"20161118829476","price":"0.01","dispatchprice":"","goodsprice":"0.01","credit":"0","status":"0","isverify":"0","paytype":"2","sendtype":"0","dispatchexpress":"","dispatch":"","paytypecode":"alipay","paytypename":"支付宝(手机版)","remark":"xxx","addressid":"","address_mobile":"","address_realname":"","address_province":"","address_city":"","address_area":"","address_address":"","createtime":"1479435727","types":"4","typeselect":"419430400","title":"400G流量套餐","notify_url":"http://182.61.23.246/notify/alipay_notify.php"}}}
添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注