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
No | API Name | API name | Method | URI | Purpose | version | Support for display ID(display_id) |
---|---|---|---|---|---|---|---|
53 | UserRegistration | Initial user registration | POST | /api/v0/users/registration | Request for initial user registration | v0 | - |
55 | RegisterUser | User initial registration | POST | /api/v0/users/registration/confirm | Initial user registration, password registration | v0 | - |
ConfirmRegistration | Confirm user's initial registration | GET | /api/v0/users/registration/confirm | Confirm the user and mark the confirmation information as confirmed from the URL attached to the user's initial registration email | v0 | - |
Sequence Diagram
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