UserInfo API
APIs related to obtaining logged-in user information, changing passwords, and updating email addresses
Overview
- This is an API that searches for and updates logged-in user information.
- Use the SendGrid service to send emails.
Pre Requisites
A Hexabase account that can be logged in already exists
API
Login user information
Get information about the logged-in user.
No | API Name | API Name | Method | URI | Purpose | version | Support for display ID(display_id) |
---|---|---|---|---|---|---|---|
43 | GetUserInfo | User information acquisition | GET | /api/v0/userinfo | Obtaining user related information | v0 | - |
61 | UpdateUserInfo | Update user information | PUT | /api/v0/userinfo | Update username and information | v0 | - |
GetUserProfilePicture | Obtaining the user's profile image (image data) | GET | /api/v0/public/userinfo/profilepic/:user-id | Obtaining the user's profile image (image data) | v0 | - | |
UploadUserProfilePicture | Register and update user profile image | POST | /api/v0/userinfo/profilepic | Register and update user profile image | v0 | - | |
DeleteUserProfilePicture | Delete user profile image | DELETE | /api/v0/userinfo/profilepic | Delete user profile image | v0 | - |
Change password
Reissue passwords for users who have forgotten their passwords
No | API Name | API Name | Method | URI | Purpose | version | Support for display ID(display_id) |
---|---|---|---|---|---|---|---|
56 | ForgotPassword | Password initialization request | POST | /api/v0/users/password/forgot | Before login, password initialization starts. | v0 | - |
57 | SetNewPassword | Password re-registration | PUT | /api/v0/users/password/forgot | Reset the password before logging in. Change password | v0 | - |
58 | ValidatePassword | Validate password change | GET | /api/v0/users/password/validate | Before login, initialize password Validation of password change status | v0 | - |
59 | SetPassword | Password change registration | PUT | /api/v0/users/password | Change password after logging in | 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: Press "password forgot" button or link
ap->>+hx: ForgotPassword [POST /users/password/forgot]
ap-->>-br: show "email sent" message
hx->>-sg: Send email request
Note right of hx: Hexabase will call sendgrid API
%% 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/password/validate]
%% redirect to "set password"
hx-->>-br: Redirect
br->>+ap: registration_path(redirect url)
ap->>ap: Enter new passwords
ap->>+hx: RegisterUser [POST /users/password]
hx->>hx: Reset to new password
hx-->>-ap: return result
Email address change
Change the registered user's email address
No | API Name | API Name | Method | URI | Purpose | version | Support for display ID (display_id) |
---|---|---|---|---|---|---|---|
72 | UpdateUserEmailRequest | Email address change request | POST | /api/v0/users/email | Email address change request | v0 | - |
73 | ConfirmUserEmail | Email address change confirmation | GET | /api/v0/users/confirmations/:confirmation_id | Email address change confirmation | v0 | - |
74 | UpdateUserEmail | Email address change | POST | /api/v0/users/confirmations | Confirm email address change | 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 new email
br->>+ap: access the URL
ap->>ap: Enter new email and press Update
ap->>+hx: UpdateUserEmailRequest [POST /users/email]
Note right of ap: [email, registration_path(redirect url)]
ap-->>-br: show "email sent" message
hx->>-sg: Send email request
Note right of hx: Hexabase will call sendgrid API
%% 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/confirmations/xxxxxxx]
%% redirect to "confirm change email"
hx-->>-br: Redirect
br->>+ap: registration_path(redirect url)
ap->>ap: press Confirm button
ap->>+hx: RegisterUser [POST users/confirmations]
Note left of hx: confirmation_id
hx->>hx: Change email
hx-->>-ap: return status 200