1. Outline
Learn how to connect to Kintone from your Unifinity app using the REST API.
This sample project uses the GET method to retrieve a single record in JSON format.
The sample project used in the explanation can be downloaded from the following link. We hope you will take advantage of it.
2. Operation image
3. Implementation method (explanation of key points only)
3-1. Screen Creation
Create a new screen and place the necessary controls.
(1) Label
This control indicates the name of each parameter that must be entered.
(2) Text
(2) 1 This control is used to input each parameter corresponding to "①Label".
2-2 This control displays the results of acquisition in JSON format.
(3) button
A control that executes the logic for calling the Kintone REST API.
3-2. Logic implementation
3-2-1. Kintone REST Logic
The "②-1 Text" on the main screen is used as follows
logical input value | use |
---|---|
subdomain |
Logic concatenates the strings and makes them the destination URL. https://(Subdomain).cybozu.com/k/v1/record.json |
login name | Concatenate the login name and password with ":" (colon) and add them to the dictionary. Converted and used in the GET method. |
(computer) password | |
app | Used as a key in the GET method. |
id | Used as a key in the GET method. |
The processing logic is as follows
The "10. Base64 encoding" process encodes the concatenated login name and password using a string function.
Next, the encoded string is concatenated after the authentication string in the "11.
A dictionary is then created based on this string.
Now that you have the necessary parameters for the REST API, set "GET3" in "Network" to the component and send GET. Character codes, etc., are specified as shown in the figure.
3-3. Logic calls from the screen
Set "3-2-1. Kintone REST Logic" as "Execution Process" in "③ Button" on the main screen.
This completes the implementation.