App
Gets general information of an App, including the name, description, related Space, creator and updater information.
- Permissions to view the App is needed.
- API Tokens cannot be used with this API.
Constructor
Parameter
Name | Type | Required | Description |
---|---|---|---|
params | Object | yes | Constructor params. |
params.connection | Connection | yes | The connection module of this SDK. |
Sample code
Init app sample
const kintone = require('@kintone/kintone-wechat-miniprogram-sdk'); let kintoneApp = new kintone.App({connection: connection});
Methods
getApp(params)
Get single app
Parameter
Name | Type | Required | Description |
---|---|---|---|
params | Object | yes | Get app params. |
params.id | Integer | yes | The kintone app ID |
Return
Promise
Sample code
Get app sample
const appId = 'your_app_id'; kintoneApp.getApp({id: appId}).then((rsp) => { console.log(rsp); }).catch((err) => { // This SDK return err with KintoneAPIException console.log(err.get()); });
getApps(params)
Get multiple apps
Parameter
Name | Type | Required | Description |
---|---|---|---|
params | Object | (optional) | Get apps params. |
params.offset | Integer | (optional) | The offset off data result |
params.limit | Integer | (optional) | The limit number of result |
Return
Promise
Sample code
Get apps sample
const limit = 'your_limit_number'; const offset = 'your_offset_number'; kintoneApp.getApps({offset, limit}).then((rsp) => { console.log(rsp); }).catch((err) => { // This SDK return err with KintoneAPIException console.log(err.get()); });
getAppsByIDs(params)
Get multiple apps by list of ids
Parameter
Name | Type | Required | Description |
---|---|---|---|
params | Object | yes | Get apps by ids params. |
params.ids | Array<Integer> | yes | The array of app ids |
params.offset | Integer | (optional) | The offset off data result |
params.limit | Integer | (optional) | The limit number of result |
Return
Promise
Sample code
Get apps sample
const ids = ['YOUR_APP_ID_1', 'YOUR_APP_ID_2', 'YOUR_APP_ID_n']; const limit = 'your_limit_number'; const offset = 'your_offset_number'; kintoneApp.getAppsByIDs({ids, offset, limit}).then((rsp) => { console.log(rsp); }).catch((err) => { // This SDK return err with KintoneAPIException console.log(err.get()); });
getAppsByCodes(params)
Get multiple apps by a list of codes name
Parameter
Name | Type | Required | Description |
---|---|---|---|
params | Object | yes | Get apps by codes params. |
params.codes | Array<String> | yes | The array of app codes |
params.offset | Integer | (optional) | The offset off data result |
params.limit | Integer | (optional) | The limit number of result |
Return
Promise
Sample code
Get apps sample
const codes = ['YOUR_APP_CODE_1', 'YOUR_APP_CODE_2']; const limit = 'your_limit_number'; const offset = 'your_offset_number'; kintoneApp.getAppsByCodes({codes, offset, limit}).then((rsp) => { console.log(rsp); }).catch((err) => { // This SDK return err with KintoneAPIException console.log(err.get()); });
getAppsByName(params)
Get multiple apps by name
Parameter
Name | Type | Required | Description |
---|---|---|---|
params | Object | yes | Get apps by name params. |
params.name | String | yes | The app name |
params.offset | Integer | (optional) | The offset off data result |
params.limit | Integer | (optional) | The limit number of result |
Return
Promise
Sample code
Get apps sample
const name = 'your_app_name'; const limit = 'your_limit_number'; const offset = 'your_offset_number'; kintoneApp.getAppsByName({name, offset, limit}).then((rsp) => { console.log(rsp); }).catch((err) => { // This SDK return err with KintoneAPIException console.log(err.get()); });
getAppsBySpaceIDs(params)
Get multiple apps by list of space's ids
Parameter
Name | Type | Required | Description |
---|---|---|---|
params | Object | yes | Get apps by space ids params. |
params.spaceIds | Array<Integer> | yes | The array of space ids |
params.offset | Integer | (optional) | The offset off data result |
params.limit | Integer | (optional) | The limit number of result |
Return
Promise
Sample code
Get apps sample
const spaceIds = []; const limit = 'your_limit_number'; const offset = 'your_offset_number'; kintoneApp.getAppsBySpaceIDs({spaceIds, offset, limit}).then((rsp) => { console.log(rsp); }).catch((err) => { // This SDK return err with KintoneAPIException console.log(err.get()); });
addPreviewApp(params)
Creates a preview App.
Warning
- After using this method, use the deployAppSettings to deploy the settings to the live App.
Parameter
Name | Type | Required | Description |
---|---|---|---|
params | Object | yes | Params to add preview app. |
params.name | String | yes | The App name. The maximum length is 64 characters. |
params.space | Integer | (optional) | The Space ID of where the App will be created. |
params.thread | Integer | (optional) | The Thread ID of the thread in the Space where the App will be created. It is recommended to ignore this parameter so that Apps are created in the default thread. There is currently no helpful reason to create Apps in threads other than the default thread, as there are no visual representations in kintone of Apps being related to threads. There are only visual representations of Apps being related to Spaces. |
Return
Promise
Sample code
Add preview App sample
const name = 'your_app_name'; const space = 'space_of_app'; const thread = 'thread_id_in_space'; kintoneApp.addPreviewApp({name, space, thread}).then((rsp) => { console.log(rsp); }).catch((err) => { // This SDK return err with KintoneAPIException console.log(err.get()); });
deployAppSettings(params)
Updates the settings of a pre-live App to the live App.
Parameter
Name | Type | Required | Description |
---|---|---|---|
params | Object | yes | Params to deploy app settings. |
params.apps | Array<JSONObject> | yes | The list of preview apps. |
params.apps[].app | Integer | yes | The preview app ID |
params.apps[].revision | Integer | (optional) | Specify the revision number of the settings that will be deployed. |
params.revert | Boolean | (optional) | Specify "true" to cancel all changes made to the pre-live settings. The pre-live settings will be reverted back to the current settings of the live app. |
Return
Promise
Sample code
Deploy app settings sample
const appPreview = { app: 'preview_app_id', revision: 'settings_revision' }; const apps = [ appPreview // Another app preview here ]; const revert = false; kintoneApp.deployAppSettings({apps, revert}).then((rsp) => { console.log(rsp); }).catch((err) => { // This SDK return err with KintoneAPIException console.log(err.get()); });
getAppDeployStatus(params)
Gets the deployment status of the App settings for multiple Apps.
Parameter
Name | Type | Required | Description |
---|---|---|---|
params | Object | yes | Get app deploy status params. |
params.apps | Array<Integer> | yes | The list of Apps to check the deploy statuses of. The Maximum limit is 300. If Apps in Guest Spaces are specified, all Apps specified in the request must belong to that Guest Space. |
Return
Promise
Sample code
Get app deploy status sample
const apps = [ 'your_app_id' // Another app id here ]; kintoneApp.getAppDeployStatus({apps}).then((rsp) => { console.log(rsp); }).catch((err) => { // This SDK return err with KintoneAPIException console.log(err.get()); });
getViews(params)
Gets the View settings of an App.
Parameter
Name | Type | Required | Description |
---|---|---|---|
params | Object | yes | Get views params. |
params.app | Integer | yes | The app ID |
params.lang | String | (optional) | The language code. Support:
|
params.isPreview | Boolean | (optional) | Get the views with a pre-live settings. |
Return
Promise
Sample code
Get views sample
const app = 'your_app_id'; const lang = 'language_code'; // Ex: JA kintoneApp.getViews({app, lang}).then((rsp) => { console.log(rsp); }).catch((err) => { // This SDK return err with KintoneAPIException console.log(err.get()); }); // Get a pre-live (preview) views const app = 'your_app_id'; const lang = 'language_code'; // Ex: JA const isPreview = true; kintoneApp.getViews({app, lang, isPreview}).then((rsp) => { console.log(rsp); }).catch((err) => { // This SDK return err with KintoneAPIException console.log(err.get()); });
updateViews(params)
Update the View settings of an App.
Parameter
Name | Type | Required | Description |
---|---|---|---|
params | Object | yes | Params to update views. |
params.app | Integer | yes | The app ID |
params.views | JSONObject | yes | An object of data of Views. About the format, please look the sample below or reference at the end of this page |
params.revision | Integer | (optional) | Specify the revision number of the settings that will be deployed. |
Return
Promise
Sample code
Update views sample
const app = 'your_app_id'; const views = { "Your_view_name": { "index": 0, "type": "your_view_type", // Default: 'LIST', 'CALENDAR', 'CUSTOM' "name": "Your_view_name", "fields": [ "your_field_code" // Another field code here ], "filterCond": "your_query", "sort": "your_sort" } // Another view here }; const revision = 'settings_revision'; kintoneApp.updateViews({app, views, revision}).then((rsp) => { console.log(rsp); }).catch((err) => { // This SDK return err with KintoneAPIException console.log(err.get()); });
getGeneralSettings(params)
Gets the description, name, icon, revision and color theme of an App.
Parameter
Name | Type | Required | Description |
---|---|---|---|
params | Object | yes | Get general settings params. |
params.app | Integer | yes | The app ID |
params.lang | String | (optional) | The language code. Support:
|
params.isPreview | Boolean | (optional) | Get the general with a pre-live settings. |
Return
Promise
Sample code
Get general settings sample
const app = 'your_app_id'; const lang = 'language_code'; // Ex: JA kintoneApp.getGeneralSettings({app, lang}).then((rsp) => { console.log(rsp); }).catch((err) => { // This SDK return err with KintoneAPIException console.log(err.get()); }); // Get a pre-live (preview) general settings const app = 'your_app_id'; const lang = 'language_code'; // Ex: JA const isPreview = true; kintoneApp.getGeneralSettings({app, lang, isPreview}).then((rsp) => { console.log(rsp); }).catch((err) => { // This SDK return err with KintoneAPIException console.log(err.get()); });
updateGeneralSettings(params)
Update the description, name, icon, revision and color theme of an App.
Parameter
Name | Type | Required | Description |
---|---|---|---|
params | Object | yes | Params to update general settings. |
params.app | Integer | yes | The app ID |
params.name | String | (Conditional) | Name of an App. |
params.description | String | (Conditional) | The description of an App. |
params.icon | Icon | (Conditional) | The icon of an App. |
params.theme | String | (Conditional) | Color theme of an App. |
params.revision | Integer | (optional) | Specify the revision number of the settings that will be deployed. |
Return
Promise
Sample code
Update general settings sample
const params = { app: 'your_app_id', name: 'APP_NAME', description: 'Here is app description.', icon: { type: 'icon_type', // specified: FILE, PRESET key: 'icon_key' }, theme: 'your_theme', // specified: WHITE, RED, BLUE, GREEN, YELLOW, BLACK revision: 'settings_revision' }; kintoneApp.updateGeneralSettings(params).then((rsp) => { console.log(rsp); }).catch((err) => { // This SDK return err with KintoneAPIException console.log(err.get()); });
getFormFields(params)
Get field of form in kintone app
Parameter
Name | Type | Required | Description |
---|---|---|---|
params | Object | yes | Get form fields params. |
params.app | Integer | yes | The app ID |
params.lang | String | (optional) | The language code. Support:
|
params.isPreview | Boolean | (optional) | Get the app form fields with a pre-live settings. |
Return
Promise
Sample code
Get app form field sample
const app = 'your_app_id'; const lang = 'language_code'; // Ex: JA kintoneApp.getFormFields({app, lang}).then((rsp) => { console.log(rsp); }).catch((err) => { // This SDK return err with KintoneAPIException console.log(err.get()); }); // Get a pre-live (preview) form fields const app = 'your_app_id'; const lang = 'language_code'; // Ex: JA const isPreview = true; kintoneApp.getFormFields({app, lang, isPreview}).then((rsp) => { console.log(rsp); }).catch((err) => { // This SDK return err with KintoneAPIException console.log(err.get()); });
addFormFields(params)
Adds fields to a form of an App.
Warning
- After using this method, use the deployAppSettings to deploy the settings to the live App.
Parameter
Name | Type | Required | Description |
---|---|---|---|
params | Object | yes | Params to add form fields. |
params.app | Integer | yes | The app ID |
params.fields | JSONObject | yes | The formFields which will add to form of kintone app. About the format, please look the sample below or reference at the end of this |
params.revision | Integer | (optional) | Specify the revision number of the settings that will be deployed. |
Return
Promise
Sample code
Add app form field sample
const app = 'your_app_id'; const fields = { YourFieldCode: { 'type': 'SINGLE_LINE_TEXT', 'code': 'YourFieldCode', 'label': 'Text (single-line)', 'noLabel': false, 'required': true, 'unique': true } // Another field here }; const revision = 'the_revision_of_the_settings '; kintoneApp.addFormFields({app, fields, revision}).then((rsp) => { console.log(rsp); }).catch((err) => { // This SDK return err with KintoneAPIException console.log(err.get()); });
updateFormFields(params)
Updates the field settings of fields in a form of an App.
Warning
- After using this method, use the deployAppSettings to deploy the settings to the live App.
Parameter
Name | Type | Required | Description |
---|---|---|---|
params | Object | yes | Params to update form fields. |
params.app | Integer | yes | The app ID |
params.fields | JSONObject | yes | The formFields which will add to form of kintone app. About the format, please look the sample below or reference at the end of this |
params.revision | Integer | (optional) | Specify the revision number of the settings that will be deployed. |
Return
Promise
Sample code
Update app form field sample
const app = 'your_app_id'; const fields = { YourFieldCode: { 'type': 'SINGLE_LINE_TEXT', 'code': 'YourFieldCode', 'label': 'Text (single-line)', 'noLabel': false, 'required': true, 'unique': true } // Another field here }; const revision = 'the_revision_of_the_settings '; kintoneApp.updateFormFields({app, fields, revision}).then((rsp) => { console.log(rsp); }).catch((err) => { // This SDK return err with KintoneAPIException console.log(err.get()); });
deleteFormFields(params)
Updates the field settings of fields in a form of an App.
Warning
- After using this method, use the deployAppSettings to deploy the settings to the live App.
Parameter
Name | Type | Required | Description |
---|---|---|---|
params | Object | yes | Params to delete form fields. |
params.app | Integer | yes | The app ID |
params.fields | Array<String> | yes | The list of field codes of the fields to delete. Up to 100 field codes can be specified. |
params.revision | Integer | (optional) | Specify the revision number of the settings that will be deployed. |
Return
Promise
Sample code
Delete app form field sample
const app = 'your_app_id'; const fields = [ 'your_field_cde' // Another field code here ]; const revision = 'revision_of_the_Settings '; kintoneApp.deleteFormFields({app, fields, revision}).then((rsp) => { console.log(rsp); }).catch((err) => { // This SDK return err with KintoneAPIException console.log(err.get()); });
getFormLayout(params)
Get layout of form in kintone app
Parameter
Name | Type | Required | Description |
---|---|---|---|
params | Object | yes | Get form layout params. |
params.app | Integer | yes | The kintone app id |
params.isPreview | Boolean | (optional) | Get the app form layout with a pre-live settings. |
Return
Promise
Sample code
Get form layout sample
const app = 'your_app_id'; // Get form layout kintoneApp.getFormLayout({app}).then((rsp) => { console.log(rsp); }).catch((err) => { // This SDK return err with KintoneAPIException console.log(err.get()); }); // Get a preview (pre-live) form layout const isPreview = true; kintoneApp.getFormLayout({app, isPreview}).then((rsp) => { console.log(rsp); }).catch((err) => { // This SDK return err with KintoneAPIException console.log(err.get()); });
updateFormLayout(params)
Updates the field layout info of a form in an App.
Warning
- After using this method, use the deployAppSettings to deploy the settings to the live App.
Parameter
Name | Type | Required | Description |
---|---|---|---|
params | Object | yes | Params to update form layout. |
params.app | Integer | yes | The kintone app id |
params.layout | Array<JSONObject> | yes | A list of field layouts for each row. About the format, please look the sample below or reference at the end of this page. |
params.revision | Integer | (optional) | Specify the revision number of the settings that will be deployed. The request will fail if the revision number is not the latest revision. |
Return
Promise
Sample code
Update form layout sample
const app = 'your_app_id'; const fisrtRowLayout = { 'type': 'kintone_layout_type', 'fields': [ { 'type': 'kintone_field_type', 'code': 'your_field_code', 'size': { 'width': 'your_field_width' } } ] }; const layout = [ fisrtRowLayout // Another row layout here ]; const revision = 'settings_revision'; // Update form layout kintoneApp.updateFormLayout({app, layout, revision}).then((rsp) => { console.log(rsp); }).catch((err) => { // This SDK return err with KintoneAPIException console.log(err.get()); });
Reference
- Get App
on developer network
- Get Apps
on developer network
- Get Form fields
on developer network
- Get Form Layout
on developer network