注册

注册新的弹弹play用户

接口说明

通过此接口可以注册新的弹弹play用户,注册成功后将返回登录结果。 调用此接口需要有应用的AppId与AppSecret,您可以联系弹弹play开发方申请。

Hash计算方法

Hash属性的计算方法为,将登录请求中 appId email password screenName unixTimestamp userName 属性的值加上您应用的 AppSecret 密钥的值按顺序拼接起来, 计算出32位MD5(不区分大小写)。举例来说,appId为dandanplay,AppSecret为FFFFF,用户名为test1,密码为test2,邮箱为test3@example.com,昵称为弹弹 那么计算方法将会是 hash=MD5(dandanplaytest3@example.comtest2弹弹666666666test1FFFFF)。

错误代码

当调用接口发生错误时,例如参数不完整、验证错误、登录失败,success属性值将为false,errorCode代码将不为0, 同时errorMessage属性将包含错误的描述信息 。

post/api/v2/register

Request

  • Base URL: https://api.dandanplay.net
  • URL: https://api.dandanplay.net/api/v2/register
  • Auth: one of:
    • API key in header X-AppId
    • API key in header X-AppSecret
    • HTTP bearer

Request body

appIdstring required

客户端ID

userNamestring required

用户名。只能包含英文或数字,长度为5-20位,首位不能为数字。

passwordstring required

密码。长度为5到20位之间。

emailstring required

备用邮箱(找回密码用)。长度不能超过50个字符。

screenNamestring required

昵称。长度不能超过50个字符。

unixTimestampinteger

Unix时间戳:从协调世界时1970年1月1日0时0分0秒起至现在的总秒数,不考虑闰秒。

hashstring required

通过参数计算得到的32位MD5值,不区分大小写。计算方法请参考接口说明。

captchaTokenstring nullable

风险触发时的人机验证令牌,不参与旧版Hash计算。

Response

errorCodeinteger

错误代码,0表示没有发生错误,非0表示有错误,详细信息会包含在errorMessage属性中

successboolean

接口是否调用成功

errorMessagestring nullable

当发生错误时,说明错误具体原因

errorDetailstring nullable

当参数校验失败时,提供可供调用方定位问题字段的补充信息。

registerRequiredboolean

该用户是否需要先注册弹弹play账号才可正常登录。当此值为true时表示用户使用了QQ微博等第三方登录但没有注册弹弹play账号。

userIdinteger

用户编号

userNamestring nullable

弹弹play用户名。如果用户使用第三方账号登录(如QQ微博)且没有关联弹弹play账号,此属性将为null

emailstring nullable

用户邮箱地址

legacyTokenNumberinteger

旧API中使用的数字形式的token,仅为兼容性设置,不要在新代码中使用此属性

tokenstring nullable

字符串形式的JWT token。将来调用需要验证权限的接口时,需要在HTTP Authorization头中设置“Bearer token”。

tokenExpireTimestring date-time

JWT token过期时间,默认为21天。如果是APP应用开发者账号使用自己的应用登录则为1年。

userTypestring nullable

用户注册来源类型

screenNamestring nullable

昵称

profileImagestring nullable

头像图片的地址

appScopestring nullable

当前登录会话内应用权限列表,可以由此判断能否调用哪些API

codestring nullable

消息体验证码

tsinteger

当前时间戳

Changes

No recorded changes to this operation across all 1 revision of this API.