Skip to main content

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.

ParameterDescriptionRequired
baseUrlBase url for calling the API.

Value: app.rested.dev/api

Yes
versionNumberService version.

Value: The current value is 1.

Yes
customEndpointRouteThe route which identifies custom endpoints.

Default value: ce

Yes
userEndpointThe endpoint name generated by the user.

Value: the name created at https://app.rested.dev

Yes
keyThe API Key of the project.Yes
dataOnlyIf used, the endpoint response will be the POST body, without additional information such as ‘uniqueId’.

Value: true

No

Request Headers

HeaderDescriptionRequired
Content-Type

Specifies the MIME type of the body of the Request. Options:

  • application/json
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:

ParameterDescriptionRequired
usernameType: StringYes - if the email is not used
emailType: StringYes - if the username is not used
passwordType: 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 codeDescription
400Possible reasons:
  • Endpoint or API Key not valid.
  • Wrong Content-Type, it only accepts "application/json".
  • Empty Request body.
  • If username/email or password are not present in the request body.
  • If the username already exists.
403Missing 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"
}