(POST) - Create a new User Account
Creating a new User Account is easy - send a POST request to the api/user service with the following key/value pairs:
(optional) a user name for the new user account
(optional) a unique email address for the new user account
(required) a password for the new user account
Note that you can configure which of the additional fields are required in your Proxima User Global Config from the Jamroom ACP.
So to create a new user account where we have not required a "user_name" or "user_email" would look like:
All we need to pass to the service is a password - if everything goes as planned, you will receive a 201 HTTP Status Code
with a note of "user created and session started".
The response will be a JSON response and look similar to:
note: 'user created and session started',
Things to note:
- all Proxima responses will have (at minimum) a code
field - in this case a code of "201" means the new user account was "Created".
- there is a "data" object in the response that includes the unique "_id" field - this is the unique user id that was created for this new user account, and should be stored for use on future logins.
- the "session_id" is a unique session identifier that means the user has successfully been logged in to the system. You must save this value
in your client and include it on all future requests as the "password" portion of the HTTP Basic Authentication header.
- the "location" value is the unique URL for actions pertaining to this unique user account (i.e. to retrieve information about, request a password reset, delete the account, etc.)