Skip to main content

UserRegistration API

Register a new user and create your first workspace

Overview

This section describes the flow for registering a new user to the system and the API to be used. In order to send emails, the SendGrid service must be used.

Pre Requisites

Contact Hexabase with the SendGrid API_KEY and template ID for sending emails and receive an email_template_id. (Optional) By using the Hexabase default email template, you can proceed with development without issuing an email_template_id.

API

NoAPI NameAPI nameMethodURIPurposeversionSupport for display ID(display_id)
53UserRegistrationInitial user registrationPOST/api/v0/users/registrationRequest for initial user registrationv0-
55RegisterUserUser initial registrationPOST/api/v0/users/registration/confirmInitial user registration, password registrationv0-
ConfirmRegistrationConfirm user's initial registrationGET/api/v0/users/registration/confirmConfirm the user and mark the confirmation information as confirmed from the URL attached to the user's initial registration emailv0-

Sequence Diagram

User Registration Sequence

sequenceDiagram
participant br as Browser
participant ml as Mailer
participant ap as your WebSite(SPA)
participant hx as Hexabase
participant sg as SendGrid

%% register email
br->>+ap: access the URL
ap->>ap: Enter email and press Register
ap->>+hx: UserRegistration [POST /users/registration]
Note right of ap: [email, email_template_id, registration_path(redirect url)]
ap-->>-br: show "email sent" message
hx->>-sg: Send email request
Note right of hx: Hexabase will call sendgrid API using template settings

%% send mail from sendgrid
sg-->>+ml: Send email with url link and confirm id
Note right of ml: confirm id
ml->>ml: Click the URL link in the mail
ml->>+hx: [GET /users/registration/confirm&id=xxxxxxx]

%% redirect to "set password"
hx-->>-br: Redirect
br->>+ap: registration_path(redirect url)
ap->>ap: Enter initial passwords
ap->>+hx: RegisterUser [POST users/registration/confirm]
Note left of hx: confirmation_id, email, password, user_info
hx->>hx: Create default workspace and group<br> and add the user in it
hx-->>-ap: return result