Skip to content

admin_rockstar

larsverp edited this page May 22, 2020 · 1 revision

The /users/register/rockstar endpoint is used to create a user with the rockstar role.

The /users/register/admin endpoint is used to create a user with the admin role.

🚨ONLY SEND REQUESTS VIA A HTTPS CONNECTION! 🚨

In the near future the API will only accept https calls.

🙋 Create a new user

Send a POST request to the /users/register/{role} endpoint. This endpoint requires this data:

  • first_name(required, string, max:191)
  • insertion (string, max:191)
  • last_name (required, string, max:191)
  • email (required, email with existing domain, max:191, unique in users table)
  • postal_code (required, NL,BE or DE postal code) This is not required for admins
  • password (required, string, max:191)

This is a working example for the body text:

{
	"first_name":"Lars",
	"insertion":"van",
	"last_name":"Erp",
	"email":"l.erp@rockstar.nl",
	"postal_code":"5673RE",
	"password":"Il0ve-D0gg!es@"
}
✔️ On succes:

If the user is created you will receive a 201 Created status and receive the following JSON response:

{
    "insertion":"van",
    "last_name":"Erp",
    "email":"l.erp@rockstar.nl",
    "postal_code":"5673RE",
    "password": "secret",
    "role": "{role}"
}

A rockstar does not have to validate the email. An email is send about the newly created account.

❌ No succes:

If the user registration fails you will receive a 422 Unprocessable Entity status and a JSON response (containing the problem) similar to this one:

{
    "message": "The given data was invalid.",
    "errors": {
        "email": [
            "The email has already been taken."
        ]
    }
}

Clone this wiki locally