Skip to main content

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.

NoAPI NameAPI NameMethodURIPurposeversionSupport for display ID(display_id)
43GetUserInfoUser information acquisitionGET/api/v0/userinfoObtaining user related informationv0-
61UpdateUserInfoUpdate user informationPUT/api/v0/userinfoUpdate username and informationv0-
GetUserProfilePictureObtaining the user's profile image (image data)GET/api/v0/public/userinfo/profilepic/:user-idObtaining the user's profile image (image data)v0-
UploadUserProfilePictureRegister and update user profile imagePOST/api/v0/userinfo/profilepicRegister and update user profile imagev0-
DeleteUserProfilePictureDelete user profile imageDELETE/api/v0/userinfo/profilepicDelete user profile imagev0-

Change password

Reissue passwords for users who have forgotten their passwords

NoAPI NameAPI NameMethodURIPurposeversionSupport for display ID(display_id)
56ForgotPasswordPassword initialization requestPOST/api/v0/users/password/forgotBefore login, password initialization starts.v0-
57SetNewPasswordPassword re-registrationPUT/api/v0/users/password/forgotReset the password before logging in. Change passwordv0-
58ValidatePasswordValidate password changeGET/api/v0/users/password/validateBefore login, initialize password  Validation of password change statusv0-
59SetPasswordPassword change registrationPUT/api/v0/users/passwordChange password after logging inv0-

Sequence Diagram

password_update 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: 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

NoAPI NameAPI NameMethodURIPurposeversionSupport for display ID (display_id)
72UpdateUserEmailRequestEmail address change requestPOST/api/v0/users/emailEmail address change requestv0-
73ConfirmUserEmailEmail address change confirmationGET/api/v0/users/confirmations/:confirmation_idEmail address change confirmationv0-
74UpdateUserEmailEmail address changePOST/api/v0/users/confirmationsConfirm email address changev0-

Sequence Diagram

email_update 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 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