1. Outline
This page explains how to communicate with the server and retrieve information via API.
Unifinity Platform uses UniBaaS to manage users, so we will use a sample application that communicates with UniBaaS as an example.
The UniBaaS administration screen (WEB data) allows you to distribute apps and manage users, and in this article we will explain the procedure for getting user information into an app via API.
Processing] Sample of obtaining information from a server via API
2. Creation Procedure
Retrieving user information from UniBaaS
The sample consists of the following
- Screen:
- Form to enter your UniBaaS credentials
- Forms for displaying acquired company information (contract information)
- Table control to display user information (ID, name, email address)
- DB:
- Table to store acquired user information
- PROCESSING:
- Set of data using [Dictionary].
- Authentication process to UniBaaS
- Processing to display acquired user information
2.1. Screen Creation
Text control] for entering the following information required for login and authentication process
Place the 【Button Control】.
- Company Code
- Email Address
- (computer) password
In the sample, a [text control] is placed to display the "Contracting Company Name," "Contracting Company ID," and "Access Token.
The purpose of this page is to display the results of the authentication process and to make it easier to understand the information required to "Obtain User Information".
Next, place a [Table Control] to display the user information you wish to display if the authentication is successful. The "Display Item" in the "Table Control" section is set to the DB item you created (see 2.2.).
In the sample, a [button control] called "Get User" is placed to make the "authentication process" and "getting user information" easier to understand.
2.2. DB Creation
Create a table to store user information retrieved from UniBaaS.
The "Stored Data" contains the authentication information for the sample.
You can authenticate to your contracted tenants by rewriting this information to your own contract information.
2.3. Creating a process
2.3.1. Login Process
The login process follows the flow below.
- Retrieve the contents of the "Company Code", "Email Address" and "Password" that you entered.
- Log in to UniBaaS
- Displays "Contractor Name," "Contractor ID," and "Access Token" as authentication results
2.3.2. Display of user information
User information is displayed in the following flow.
- Connect to UniBaaS with "contracted company ID" and "access token
- Store acquired information in [Dictionary].
- Display the contents of 2. on the 【Table Control】 placed on the screen
2.3.3. Supplementation
The sample includes the following logic as "communication processing": "user authentication", "user acquisition", and "common_HTTP status code acquisition".
The login process and the display of user information call the "Communication Process".
The "communication process" will be explained in another article, but please use the "communication process" as a sample of the logic used to authenticate to UniBaaS.
2.4. Assign the created process to a button
Return to the【【Screen】and embed the process you created into the button.
Login button
User acquisition button
3. Reference
User information that can be managed by UniBaaS can be given a variety of information by using json.
For example, a single "group" is not sufficient for a grouping (e.g., "department" connected to "division"), or a supplementary description of the users who use the system.
If you prepare an application to manage this ancillary information, you can use it when you are in a situation where you have a wide range of distribution destinations.
It will be easier to deal with.
The sample layout is designed to be used on mobile devices, but when it is operated as an administration screen, it will mainly be used on PCs, so the [Table Control] can be effectively used by expanding the screen size horizontally, for example, to include the ancillary information described above.
4. Sample application
You can download it from the following link
Processing] Sample of obtaining information from a server via API