接口描述
统一POST请求参数:appid,authkey 必须
appid:应用id
authkey:通信密码
sign:签名,签名规则下面第6点将会描述(用户应用启用验证签名选项才会进行验证)
1、登录请求接口:login
参数:
username //用户名
password //密码
返回值:
{"code":-4,"msg":"invalid access"}//无效访问
{"code":-1,"msg":"invalid username"}//用户名无效
{"code":7,"msg":"wrong password"}//密码不正确
{"code":2,"msg":"username d2on't exists"}//用户不存在
{"code":1,"msg":"success","user":{"uid":"uid","username":"username"}}//登录成功,返回用户信息
2、注册请求接口:register
参数:
username //用户名
password //密码
mobile //手机
email //邮件
ip //客户端IP地址
返回值:
{"code":-4,"msg":"invalid access"}//无效访问
{"code":-1,"msg":"invalid username"}//用户名无效
{"code":3,"msg":"mobile exists"}//手机号已经存在
{"code":5,"msg":"wrong
mobile"}//手机号码格式不正确
{"code":4,"msg":"email
exists"}//邮件地址已经存在
{"code":6,"msg":"wrong
email"}//邮件格式不正确
{"code":-2,"msg":"failed"}//注册失败
{"code":2,"msg":"username
exists"}//用户名已经存在
{"code":1,"msg":"success","user":{"uid":"nuid"}}//注册成功
3、修改请求接口:modify
参数: username //用户名 newusername//新用户名 password //密码 oldpassword mobile //手机 email //邮件 ip //客户端IP地址 force //是否强制修改 true|false 返回值: {"code":-4,"msg":"invalid access"}//无效访问 {"code":2,"msg":"username not
found"}
{"code":3,"msg":"mobile exists"}
{"code":5,"msg":"wrong
mobile"}
{"code":4,"msg":"email exists"}
{"code":6,"msg":"wrong
email"}
{"code":8,"msg":"wrong old
password"}"
{"code":-2,"msg":"failed"}
{"code":1,"msg":"success"}
4、删除请求接口:drop
参数:
username //用户名
ip //客户端IP地址
返回值:
{"code":-4,"msg":"invalid access"}//无效访问 {"code":-2,"msg":"failed"}
{"code":1,"msg":"success"}
5、查询请求接口:check
参数:
value //值
column //列名(只能是username,mobiel,email 之一)
ip //客户端IP地址
返回值:
{"code":-1,"msg":"invalid
username"}
{"code":5,"msg":"wrong mobile"}
{"code":6,"msg":"wrong
email"}
{"code":-3,"msg":"invalid
check"}
{"code":1,"msg":"success","uid":uid,"username":"username","mobile":"mobile","email":"email"}
{"code":2,"msg":"column
don't exists"}
6、签名规则
所有参数按参数名升序排列,进行md5后再进行RsaSignMd5签名
如:
请求参数是:username=abc&ip=192.168.1.1&password=123456&authkey=sswwer&appid=1
升序排列结果:sortstr="appid=1&authkey=sswwer&ip=192.168.1.1&password=123456&username=abc"
进行md5: mdrstr=md5(sortstr);
用密钥进行RsaSignMd5签名:RsaSignMd5(md5str,prikey);