SysCreateUserEmailPassword
Manually creates a new user for the current app. Note that this API is normally used for in an admin app for pre-creating users. Standard, dynamic, on-the-fly authentication is done via the Authentication service.
Service | Operation |
---|---|
user | SYS_CREATE_USER_EMAIL_PASSWORD |
Method Parameters
Parameter | Description |
---|---|
externalId | The email address of the user |
password | The user's initial password (if the password is null, a random one will be generated) |
userName | The display or contact name of the user (stored in player state) |
notificationTemplateId | If specified, the user will be sent an email confirming that the account has been created |
Usage
http://localhost:3000
- C#
- C++
- Objective-C
- Java
- JavaScript
- Dart
- Cloud Code
- Raw
// Cloud Code only. To view example, switch to the Cloud Code tab
// Cloud Code only. To view example, switch to the Cloud Code tab
// Cloud Code only. To view example, switch to the Cloud Code tab
// Cloud Code only. To view example, switch to the Cloud Code tab
// Cloud Code only. To view example, switch to the Cloud Code tab
// Cloud Code only. To view example, switch to the Cloud Code tab
var userProxy = bridge.getUserServiceProxy();
var postResult = userProxy.sysCreateUserEmailPassword(
"bruce@wayneent.com", // externalId = email
"R@b1n3gg", // password
"Bats", // userName
"d-eb88215a71bb42e44xb5a35d75fcd6193" );
// notificationTemplateId
if (postResult.status == 200) {
// Success!
}
// Cloud Code only. To view example, switch to the Cloud Code tab
JSON Response
{
"status": 200,
"data": {
"profileId": "0b53155b-1fc8-4916-xxxx-298379efc67a"
}
}
Common Error Code
Status Codes
Code | Name | Description |
---|---|---|
550022 | INVALID_PASSWORD_CONTENT | The password doesn't meet the minimum password requirements. |