Make Kintone REST API Requests with Postman using OAuth
- Benefits of the OAuth Client Method
- Prepare Kintone
- Prepare Postman
- Configure the Authorization Settings
- Configure the Get New Access Token settings
- Allow Postman to access Kintone
- Select to use the Access Token
- Make a Kintone REST API Request from Postman
Benefits of the OAuth Client Method
Using the password authentication method
With the password authentication method, Kintone login credentials must be shared with the linked service. This method effectively grants the linked service all privileges held by the user. The password authentication method does not allow for granting specific privileges per service. Also, the linked service's access to Kintone is affected every time the user changes their login credentials.
Using the OAuth client method
With the OAuth Client method, the OAuth 2.0 protocol is used to grant specific privileges to the linked service. This method allows for linked services to have specified access to Kintone without sharing the user's login credentials. Maintaining the integration will be simpler since the linked service's access to Kintone will not be affected by the user changing their login credentials.
Create an App
Create an App in Kintone with any fields inside. After activating the App, add some records inside.
Register an OAuth Client
Follow the 7 steps listed in the Register your application to Kintone section of the How to add OAuth clients article. On Step 4, enter the URL https://www.getpostman.com/oauth2/callback for the Redirect endpoint option. Set all the other parameters according to the How to add OAuth clients article.
Configure the Authorization Settings
On the Authorization tab, configure settings as follows:
- TYPE: OAuth 2.0
- Add authorization data to: Request Headers
After filling in the settings, click the Get New Access Token button.
Postman will display settings for getting a new access token.
Configure the Get New Access Token settings
Enter the following information for the Get New Access Token settings.
|Data to Enter
|The URL of the OAuth authorization endpoint
|Access Token URL
|The URL of the OAuth token endpoint URL
|The unique ID created when the Postman app was registered to Kintone
|The client Secret created when the Postman app was registered to Kintone
|The scope determines the level of access to grant to the Postman app.
|A random value in order to prevent CSRF(Cross-site request forgery)
After entering the information above, click the Request Token button.
Allow Postman to access Kintone
A Kintone authentication page appears when the Request Token button is clicked. Log in to Kintone and approve the authorization request.
Select to use the Access Token
Upon approving authorization, the Postman app generates a token. Postman's term "Token" corresponds to Kintone's Access Token. Select the newly generated Token and then click the Use Token button.
This Access Token is set as the Token in the Authorization settings.
Make a Kintone REST API Request from Postman
Enter the REST API parameters
Enter the Kintone REST API URL in the Request URL field. In the screenshot below, the Get Records endpoint is used. The App ID of the App created in this article is placed in the URL parameter.
Check the response
Click Send to make the API Request. The response body should be displayed on Postman.