User registration (/register) Print

  • user, registration, register, account
  • 0

The very first step to be able to use our great product is to create a new user and this is where this method can help you if you with to do that programatically. You can also register via our managment dashboard at https://my.noraina.cloud but, if you prefer your good old console or want to write a piece of code to integrate with our service this is definetely the way to go.

To create a new user you shuold send a POST request to https://nacp01.noraina.net/api/register with a JSON payload like the one below:

{
	"name": "User",
	"mail": "[email protected]",
	"password": "my_password",
	"billing": {
		"company": "my_company",
		"vatId": "12345678X",
		"address": "22nd my_company's Street, my_postal_code, my_city",
		"creditBalance": 12345
	}
}

As you may notice, besides the user's name, the e-mail and the password fields, there is a billing one and that is because if your are registering the first user of your company and you provide this information, we will also create a new tenant automatically and start the registration process and credit funding automatically.

And you may be thinking..."but what happens if I already have a tenant and just want to create a user"? No problem. Providing billing information is optional. You can send just the user information and we will create just the user. The payload would be something like:

{
	"name": "User",
	"mail": "[email protected]",
	"password": "my_password",
}

As an example, let's creat a user with curl:

curl --location --request POST 'https://nacp01.noraina.net/api/register' \
--header 'Content-Type: application/json' \
--data-raw '{
	"name": "User",
	"mail": "[email protected]",
	"password": "my_password",
	"billing": {
		"company": "my_company",
		"vatId": "12345678X",
		"address": "22nd my_company'\''s Street, my_postal_code, my_city",
		"creditBalance": 12345
	}
}'

If everything worked as expected, you shoud get a JSON response like the one below:

{
    "status": "success",
    "data": {
        "message": "User successfully created.",
        "token": "xxxxxxxxxxxxxxxxxxxxxxxxxxx"
    }
}

Now you have created a new user and you have your very first token also! You don't have any permissions yet and therefore, can't do much by now until we activate your account but you can get your user details (/me or /user) to test that your user is working properly.

Attention! You can't use the same e-mail account to create multiple users (but you could use aliases like [email protected]). If you try to create a user with the same email we will respond with something like this:

{
    "status": "error",
    "message": "User already exists.",
    "data": null
}

Was this answer helpful?

« Back