User Registration¶
The user registration API can be used to create user accounts in the application. A registration request must provide a user object as a collection of key/value properties. The collection must contain all the required properties which must include a property marked as identity as well as the "password"
property. The default identity property is "email
", however, it can be changed in Backendless Console. Additionally, the "email"
property is required if the application is configured to confirm email addresses for the registered users.
When this API is used to convert a guest user account to a regular registered user,the request body must include the objectId property. The value of the property is the same as returned from the Guest Login API.
Method¶
POST
URL¶
https://api.backendless.com/application-id/REST-api-key/users/register
where:
Argument | Description |
---|---|
application-id |
the ID of your application. You can obtain the value in the Manage > App Settings section of the Backendless Console. |
REST-api-key |
REST API key of your application. You can obtain the value in the Manage > App Settings section of the Backendless Console. |
Request Headers¶
Content-Type:application/json
where:
Argument | Description |
---|---|
Content-Type |
must be set to application/json . This header is mandatory. |
Request Body¶
{ "email" : value, "password" : value, "objectId" : value, <<< THIS VALUE IS OPTIONAL. USE IT ONLY WITH GUEST LOGINS ... }
The objectId
parameter is optional. It should be present only when you convert a guest user to the regular registered user. For more information about guest logins, see the Anonymous Login section of this guide.
Response Body¶
{ "objectId" : value, "email" : value, "password" : value, ... }
Error Codes¶
When the server-side reports an error, it returns a JSON object in the following format:
{ "message":error-message, "code":error-code }
The following errors may occur during User Registration API calls.
Error Code |
Description |
---|---|
2002 |
Invalid application info (application id or api key) |
3009 |
User registration is disabled for the application |
3010 |
User registration has an unknown property and dynamic properties are disabled for this version of the application |
3011 |
Missing "password" property |
3012 |
Required property is missing |
3013 |
Missing value for the identity property |
3014 |
External registration failed with an error. |
3021 |
General user registration error. Details included with the error message. |
3033 |
User with the same identity already exists |
3038 |
Missing application-id or collection of properties for the registering user |
3039 |
Property "id" cannot be used in the registration call |
3040 |
Email address is in the wrong format |
3041 |
A value for a required property is missing |
3043 |
Duplicate properties in the registration request |
8000 |
Property value exceeds the length limit |
curl -H Content-Type:application/json -X POST -d '{"name":"James Bond", "password":"watchingya", "email":"jbond@007.com"}' -v https://api.backendless.com/application-id/rest-api-key/users/register
Turning Registration Off¶
User registration can be disabled for a particular version of the application using the Backendless Console:
- Login to the console and select the application.
- Click the Users icon in the vertical icon menu on the left.
- Click User Registration.
The Registration toggle turns the registration API on or off. When the registration is turned off and a user attempts to register, the system returns error 3009
.
Email Confirmations¶
Backendless can send out an email requesting new registered users to confirm their email address. This feature can be configured in the Backendless Console:
- Log into the console and select the application.
- Click the Users icon in the vertical icon menu on the left.
- Click User Registration.
When email confirmations are turned on (the feature is disabled by default), the "email"
user property is required and must contain a value formatted as an email address. To configure the text of the email message, click the Messaging icons in the vertical icon bar in Backendless console and select the EMAILS tab. Use the User made registration template.
When email confirmations are enabled in the app, new registered users will not be able to login until they confirm their email address. For more information see the User Status section of this guide.