Register User
Register a user to your workspace.
Argument | Example | Required | Description |
---|---|---|---|
email | Required | The email of the channel. | |
pass | ["rocket.12"] | Required | The password |
name | Test | Required | The name of the account. |
{
"msg": "method",
"method": "registerUser",
"id":"482",
"params": [{
"email": "[email protected]",
"pass": "test31457",
"name": "new te1st",
"secretURL": ""
}]
}
{
"msg": "result",
"id": "482",
"result": "3Dw26TXWxvi8gwfgM"
}
If there are any errors during registration, here is a sample response format to expect:
{
"msg": "result",
"id": "42",
"error": {
"error": 403,
"reason": "...",
"message": "... [403]",
"errorType": "Meteor.Error"
}
}
"reason": "error-user-registration-disabled",
"message": "User registration is disabled [403]",
"reason": "error-user-registration-secret",
"message": "User registration is only allowed via Secret URL [403]",
"reason": "error-invalid-customfield-json",
"message": "Invalid JSON for Custom Fields [403]",
"reason": "error-user-registration-custom-field",
"message": "Field ${ fieldName } is required [403]",
"reason": "error-user-registration-custom-field",
"message": "Value for field ${ fieldName } is invalid [403]",
"reason": "error-user-registration-custom-field",
"message": "Max length of field ${ fieldName } ${ field.maxLength } [403]",
"reason": "error-user-registration-custom-field",
"message": "Min length of field ${ fieldName } ${ field.minLength } [403]",
You can use
customFields
as extra fields for user registration.To register with custom fields, add
Accounts_CustomFields
encoded as JSON:{
"msg": "method",
"method": "registerUser",
"id":"482",
"params": [{
"email": "[email protected]",
"pass": "test31457",
"name": "new te1st",
"secretURL": "" ,
"Accounts_CustomFields": {
"role": {
"type": "select",
"defaultValue": "student",
"options": ["teacher", "student"],
"required": true,
"modifyRecordField": {
"array": true,
"field": "roles"
}
},
"twitter": {
"type": "text",
"required": true,
"minLength": 2,
"maxLength": 10
}
}
}]
}
Last modified 4mo ago