How to start using Kintone in your Hackathon!

We will go through a short tutorial on how to get started off with using Kintone in your Hackathon.

This tutorial will go through the following:

  1. Getting your hands on Kintone
  2. Logging into Kintone
  3. Creating Users on Kintone
  4. Creating your Web Database (Kintone Apps) on Kintone
  5. Inputting Data into your Database manually
  6. Generating an API Token for your Database
  7. Checking the identifiers within your Database
  8. Inputting Data into your Database via REST API
  9. Getting Data from your Database via REST API

1. Getting your hands on Kintone

Kintone is a teamwork platform, accessible via modern browsers.

You can get your hands on Kintone by either:

  1. Following the instructions on the "Get a Developer License" article (recommended to be done a few days before the Hackathon)
  2. By asking a Kintone mentor at your Hackathon for a Kintone Developer License

2. Logging into Kintone

Once you receive your Kintone Developer License and credentials, you're ready to log into Kintone.


Your Kintone Developer License should have a unique URL, in the form of https://{subdomain_name}.kintone.com . Access this URL to display the login page.

Enter Administrator for your login name, and enter the password you received (via email or from the mentor) in the password field to log in.

loginpage.PNG

3. Creating Users on Kintone

You will first be directed to a page with a link to Administration or Kintone.
Click on Administration, then on Departments & Users from the left menu.

admin_kintone.PNG

 

newuser.png

Click on New User, and input the information of your Hackathon team member. This process will give them access to log into your Kintone domain. The following information is recommended to be filled out:

 

Display Name: The Username that will be displayed inside the Kintone platform.
Login Name: The login name for the user. This does not have to be in the form of an email address.
E-mail Address: The email address of the user. New users will be sent invites to this email. 

 

aliceuser.PNG

 

After clicking on Save, you will be prompted to create a password for the user.
Choose an option of your choice, and click on Create and Send via E-mail to send the login credentials of the new user to the specified e-mail address. These credentials can only be used in this specific Kintone domain (i.e. the domain you logged into in step 2).

createpasword.png

4. Creating your Web Database (Kintone Apps) on Kintone

Click on the top left Kintone logo to access Kintone's home portal.

 

topleftlogo.png

 

Since you have just obtained a new Kintone domain, there may not be much information in this portal - so let's start adding some in.

Click on the + button in the Apps widget to start creating Kintone Apps. "Kintone Apps" is a term used to describe a single instance of a Web Database.

clickonapp.png

Click on Create App from Scratch, and start off by giving your Kintone App a name.
If nothing comes to mind, why not start off with something fun and useful such as a Lunch Database, which we will use to store information of local eateries. You can also click on the icon to give your Kintone App a custom icon.

app_name.PNG

 

Next, we'll create the input form for the Kintone App.
Choose a field from the left menu, and drag it onto the canvas to start creating the input form.

drag_and_drop.png

Hovering over the newly placed field will display a cog wheel. Hover over this icon, and click on Settings to access the field's settings.

select_field_settings.png

Enter a name for the field, and click on Save.

eatery_name.png

The settings should be applied, and a name should be displayed above the field.

eatery_name_result.PNG

 

Repeat this process for however many input fields you will need.

Here's an example list of fields and settings you can use for the Lunch Database. Don't worry about making a mistake - you can always edit and update your input fields later on.

Field type Settings Comments
Text [Name]
Eatery Name
This field is used for inputting the name of the Eatery.
Drop-down

[Name]
  Type

[Options
  Chinese
  Pizza
  Ramen
  Fast Food

This field is used for selecting what type of food the eatery offers.
Drop-down

[Name]
  Price Range

[Options
  -$10
  $10 - $15
  $15 - $20
  $20+

This field is used for selecting how much a lunch would cost in average at the eatery.
Text [Name]
Address
This field is used to store the location of the eatery.
Attachment [Name]
Images
This field is used to store any images of the eatery or their food.

 

fields_on_canvas.PNG

Once you're done, click on Save form, and then on Activate App to deploy the Kintone App to you domain. Kintone Apps deployed in this way are now accessible by other users in your Kintone domain, or via REST API.

save_and_activate.png

5. Inputting Data into your Database manually

After clicking on Activate App, you will be directed to what we call the List view of the Kintone App, which lists any recorded data in a spreadsheet-like view. We just created the Kintone App, so you may have noticed we have no data to display in this view yet.

listview_nodata.PNG

To add new data, click on the + button.

plus_button.png

This will take you to the input form that you created earlier.
Input some data into this form, and click on Save.

tacobellinfo.png

You have now successfully added some data into your Kintone App!
Click on the Kintone App name at the top of the page to return to the List view.

listview_with1record.PNG

You can see that your new data is listed in this view.
One line of data in a Kintone App is referred to as "A record of data" in Kintone. Go ahead and repeat the process to add a few more records into the Kintone App.

recordlist_5records.PNG

6. Generating an API Token for your Database

To interact with your Kintone API via REST API, you must first generate an API Token for your Kintone App.

To do this, click on the cog wheel in your App to access the App's settings.

cogwheelofapp.png

Click on API Token, and on Generate. Select the scope of the API Token by checking the boxes in the Permissions settings, and take note of the API Token string.

After this, you must click on Save, and on "Update App" to be able to start using the API Token with your REST API calls.

generate_api_token.png

7. Checking the identifiers within your Database

Apart from the API Token, you need to take note of a number of other identifiers in your App which will be included in the REST API request.

  • The App ID
    Each Kintone App you create will have its own unique App ID. This is generally included in the request of most REST API calls in Kintone.
    You can find the App ID of your Kintone App by looking at the URL of the Kintone App.
    The App below has an ID of 338:

    appid.png

  • The Record ID
    Each record within your Kintone App will be allocated an ID. The first record will have an ID of 1, the second record will have an ID of 2, and so on. No two records within the same Kintone App will have the same ID, even if any records have been deleted from the Kintone App.
    Some REST API calls may need the Record ID to be specified in their call - such as when you would like to retrieve information from a record with a specific Record ID.

    Click on the blue icon of the record to access the record details page of a specific record.

    record_details.png

    You can find the Record ID of the record by looking at the URL of this record.
    The record below has an ID of 3.

    recordid.png

  • The Field code
    Field codes are unique identifiers allocated to your fields in the input form of the Kintone App. These field codes need to be specified in some REST API calls, such as when adding in new data to the Kintone App. They are also included in the response of API calls that retrieve data.

    Access the Kintone App's settings (through the cog wheel introduced in step 6), make sure that the "Form" tab is selected, and open the settings for any field in the canvas. Update the Field Code shown at the bottom of the settings, to a string of your choice, and take note of it. Note that if you include a blank space in the field code, this will be automatically converted to an underscore.

    changefieldcode.png

    Repeat this process for all fields within your Kintone App.

    For the rest of this article, assume that fields in this Kintone App have the following field codes:
    Field name Field Code
    Eatery Name eatery_name
    Type eatery_type
    Price Range price_range
    Address address
    Images images

8. Inputting Data into your Database via REST API

Refer to the Add Record API document to add a record of data into the Kintone App via API.
https://developer.kintone.io/hc/en-us/articles/212494628/

Here is an example of running the Add Record API, to add a record of a new eatery.

curl -X POST 'https://{subdomain}.kintone.com/k/v1/record.json' \
-H 'X-Cybozu-API-Token: {API_TOKEN}' \
-H 'Content-Type: application/json' \
-d '{"app": 338,"record": {"eatery_name":{"value":"North Beach Pizza"},"eatery_type":{"value":"Pizza"},"price_range":{"value":"$10 - $15"}}}'

 added_record.png

9. Getting Data from your Database via REST API

Refer to the Get Record API document on how to retrieve record data from a single record in the Kintone App.
https://developer.kintone.io/hc/en-us/articles/213149287/


Here is an example of running the Get Record API, to get a record of an eatery with the record ID of 1.

curl -X GET 'https://{subdomain}.kintone.com/k/v1/record.json?app=338&id=1' \
-H 'X-Cybozu-API-Token: {API_TOKEN}'

 

Refer to the Get Records API document on how to retrieve data of multiple records from the Kintone App, by specifying a query.
https://developer.kintone.io/hc/en-us/articles/213149287/#getrecords


Here is an example of running the Get Records API with the following conditions:
- the returned field data are narrowed down to eatery_name and eatery_type
- the returned records include "Ramen" in their drop-down value for eatery_type

curl -G 'https://{subdomain}.kintone.com/k/v1/records.json' \
-H 'X-Cybozu-API-Token: {API_TOKEN}' \
--data-urlencode 'app=338' \
--data-urlencode 'fields[0]=eatery_name' \
--data-urlencode 'fields[1]=eatery_type' \
--data-urlencode 'query=eatery_type in ("Ramen")'
{ 
"records":[
{
"eatery_name":{
"type":"SINGLE_LINE_TEXT",
"value":"Himawari"
},
"eatery_type":{
"type":"DROP_DOWN",
"value":"Ramen"
}
},
{
"eatery_name":{
"type":"SINGLE_LINE_TEXT",
"value":"Ramen Dojo"
},
"eatery_type":{
"type":"DROP_DOWN",
"value":"Ramen"
}
}
],
"totalCount":null
}
Was this article helpful?
0 out of 0 found this helpful
Do you have any questions or issues related to this article?
Please share your views with us in the Community forums!