How to check if user email/name is taken

Hi,

When using the API Docs and you would test this functionality (POST /user/register) you will find out that it will throw and error when creating a user with a username that is already taken.

If you add to the body:

{
  "email": "Email@email.com",
  "first_name": "MrJohny",
  "last_name": "Unknown",
  "display_name": "MrJohny Unknown",
  "new_password": "Password000",
  "code": ""
}

it would give the response

{
  "error": {
    "context": {
      "email": [
        "The email has already been taken."
      ]
    },
    "message": "Validation failed",
    "code": 400,

If you want to create something that before you hit the submit button to check if the username it taken, you probably need to query GET /user/profile to check if that user already exists.

You can setup access to these APIs under roles. You could create a default guest user and use that token to access this information. In the API Docs you can see which need a valid session token (Implementation Notes).

Good luck