Skip to content

Signup endpoint

Alvin Cheng edited this page Apr 23, 2023 · 2 revisions

Description

This is the signup endpoint, as the name suggests the endpoint will create a user instance in the database. This endpoint will except an 'id' argument for the user id, usually created with the uuid package. A 'username' for the username, a 'password' for the user's password to be hashed and stored, a 'verified' argument for the verified status, a 'bot' argument for the bot status and a 'blocked' argument to determine if the user is blocked. Furthermore, the endpoint will return a status of '401' on an invalid API key, '201' on success or '500' on server error. finally, the source for this endpoint is stored in /src/endpoints/signup.ts.

Example

post("http://<URL>/api/signup?key=<YOUR_API_KEY>", {
  id: "<ID>",
  verified: false,
  blocked: false,
  bot: false,
  username: "<USERNAME>",
  password: "<PASSWORD>", // Must be raw unencrypted passcode!!
})
  .then((res) => {
    console.log(res);
  })
  .catch((err) => {
    console.error(err);
  });
Clone this wiki locally