User Sign Up
User Sign Up
C2S POST /bp/user/signup
S2S POST /bp/server/user/signup
接口功能:注册 BytePower
请求头部参数 (Headers):
请求体
content-type: "application/json"
描述:用户注册所需信息
请求体示例: 支持用户名密码注册和邮箱注册
js
{
"name_password": {
"name": "username",
"password": "123456"
},
"segment_id": "test_segment_id",
"custom_config_id": "custom_config_id_123",
"login_device_id": "login_device_id", // 配合 device 登录使用,设备登录中 id 与 login_device_id 是同一个 id,取值相同。
"simple_cuid": "test_simple_cuid",
"cuid_v2": "test_custom_uid_v2",
"imei": "test_imei",
"oaid": "test_oaid",
"cuid": "test_custom_uid",
"platform": "ios",
"idfa": "test_idfa",
"idfv": "test_idfv",
"gaid": "test_gaid",
"appsflyer_id": "appsflyer_id",
"app_instance_id": "app_instance_id",
"uuid": "uuid"
}
或
{
"email_password": {
"email": "mou@ihandysoft.com",
"password": "123456",
"verify_code": "123456", // 可选,console 开启 Enable sign up verification 后才会生效
"platform": "website" // 可选
},
"segment_id": "test_segment_id",
"custom_config_id": "custom_config_id_123",
"login_device_id": "login_device_id", // 配合 device 登录使用,设备登录中 id 与 login_device_id 是同一个 id,取值相同。
"simple_cuid": "test_simple_cuid",
"cuid_v2": "test_custom_uid_v2",
"imei": "test_imei",
"oaid": "test_oaid",
"cuid": "test_custom_uid",
"platform": "ios",
"idfa": "test_idfa",
"idfv": "test_idfv",
"gaid": "test_gaid",
"appsflyer_id": "appsflyer_id",
"app_instance_id": "app_instance_id",
"uuid": "uuid"
}响应
HTTP 状态码:200
描述:注册成功 响应示例:
json
{
"user": {
"uid": "u12345",
"create_time": 1737600199329,
"name": "happymumu",
"is_new_user": true, // 是否是新注册用户
"social_accounts": [
//省略部分详细信息...
],
"phone": {
"phone_number": "+8615512345678"
},
"session": {
"session_token": "test_session_token"
},
"email": {
"email_address": "XXXX",
"verified": false
}, // 邮箱注册绑定才会有email字段
"cuid": "test_custom_uid"
}
}HTTP 状态码:400 描述:400 错误 响应示例:
json
{
"error": {
"error_type": "invalid_api_version",
"message": "api version is not valid."
}
}- HTTP 状态码:405 描述:请求方法错误 响应示例:
json
{
"error": {
"error_type": "method_not_allowed",
"message": "string"
}
}- HTTP 状态码:500 描述:500 错误 响应示例:
json
{
"error": {
"error_type": "config_invalid",
"message": "configuration is not valid."
}
}- HTTP 状态码:502 描述:gateway 失败 响应示例:
json
{
"error": {
"error_type": "gateway",
"message": "string"
}
}Detect Email
C2S POST /bp/user/detect
S2S POST /bp/server/user/detect
接口功能:检查邮箱是否已被使用
请求头部参数 (Headers):
C2S 无需 X-BytePower-Session-Token
请求体
content-type: "application/json"
描述:检查邮箱是否存在所需信息
请求体示例:
js
{
"email": "test@example.com"
}响应
HTTP 状态码:200
描述:查询成功 响应示例:
json
{
"email_data": {
"exists": true // true 表示邮箱已存在,false 表示邮箱未被使用
}
}- HTTP 状态码:400 描述:请求参数错误 响应示例:
json
{
"error": {
"error_type": "account.email_invalid",
"message": "account.email_invalid"
}
}json
{
"error": {
"error_type": "account.email_login_not_allowed",
"message": "account.email_login_not_allowed"
}
}- HTTP 状态码:500 描述:服务器内部错误 响应示例:
json
{
"error": {
"error_type": "internal",
"message": "internal server error"
}
}