New user registration
Use the Authentication endpoint to register new users in your application.
Request data
HTTP method: POST
URL format: https://baseUrl/versionNumber/customEndpointRoute/userEndpoint?key=apiKey[&dataOnly=true]
Example:
https://app.rested.dev/api/1/ce/examples/auth?key=d59eb2859c284168ac48aef65046d5dd[&dataOnly=true]
Request Parameters
The following table describes the Request parameters.
Parameter | Description | Required |
baseUrl | Base url for calling the API. Value: app.rested.dev/api | Yes |
versionNumber | Service version. Value: The current value is 1. | Yes |
customEndpointRoute | The route which identifies custom endpoints. Default value: ce | Yes |
userEndpoint | The endpoint name generated by the user. Value: the name created at https://app.rested.dev | Yes |
key | The API Key of the project. | Yes |
dataOnly | If used, the endpoint response will be the POST body, without additional information such as ‘uniqueId’. Value: true | No |
Request Headers
Header | Description | Required |
Content-Type | Specifies the MIME type of the body of the Request. Options:
| Yes |
POST body
The registration endpoint expects a JSON with user credentials. It checks if username and password are provided and doesn’t accept duplicate usernames.
See the table below for more details:
Parameter | Description | Required |
username | Type: String | Yes - if the email is not used |
Type: String | Yes - if the username is not used | |
password | Type: String The password is not encrypted on the server side. | Yes |
<otherParams> | It accepts more parameters. | No |
Note: We recommend storing other user information in a separate endpoint, because other users won’t have access to this endpoint.
Response data
Error codes
Error code | Description |
400 | Possible reasons:
|
403 | Missing API Key, not allowed origin or disallowed request without orign. |
Successful response
{
uniqueId: "3f38bf9e1bb54d2396d1f1b8fbba1630",
data: { username: "usernameeee", password: "passworddddd" },
createdAt: "2020-12-27T10:58:45.000Z",
updatedAt: "2020-12-27T10:58:45.000Z"
}