Get Views

Gets the View settings of an App.

MethodGET
URLhttps://{subdomain}.kintone.com/k/v1/app/views.json
URL(guest space)https://{subdomain}.kintone.com/k/guest/{SpaceID}/v1/app/views.json
AuthenticationAPI Token Authentication , Password Authentication
Content-Typeapplication/json (not needed if specifying the query with a query string)

Contents

Pre-live settings

Apps may hold pre-live settings that have not yet been deployed to the live app.
Access the pre-live settings with the below URL.

URL https://{subdomain}.kintone.com/k/v1/preview/app/views.json
URL(guest space) https://{subdomain}.kintone.com/k/guest/{SpaceID}/v1/preview/app/views.json

Permissions

  • Permission to view records are needed when obtaining information of live apps.
  • App Management Permissions are needed when obtaining information of pre-live settings.

Request Parameters

Parameter Value Required Description
app Integer Yes The App ID
lang String The localized language to retrieve the data in:
- default: retrieves the default names
- en: retrieves the localized English names
- zh: retrieves the localized Chinese names
- ja: retrieves the localized Japanese names
- user: retrieves the localized names, in the same language as the language setting* set on the user used for the authentication.
If ignored, the default names will be retrieved.

*If the user language setting is set to “Use Web browser settings”, the settings set in the Accept-Language header will be used. If there is no Accept-Language header, the language set in the “Localization” settings in the System Administrator’s menu will be used.

Sample Request

JavaScript (using Kintone REST API Request )

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
var body = {
  'app': 1,
  'lang': 'en'
};

kintone.api(kintone.api.url('/k/v1/app/views', true), 'GET', body, function(resp) {
  // success
  console.log(resp);
}, function(error) {
  // error
  console.log(error);
});

XMLHttpRequest

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
var url = 'https://{subdomain}.kintone.com/k/v1/app/views.json?app=1&lang=en';
var xhr = new XMLHttpRequest();
xhr.open('GET', url);
xhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest');
xhr.onload = function() {
  if (xhr.status === 200) {
    // success
    console.log(JSON.parse(xhr.responseText));
  } else {
    // error
    console.log(JSON.parse(xhr.responseText));
  }
};
xhr.send();

Response Parameters

Parameter Type Description
revision String The revision number of the App settings.
views Object An object listing View information.
views.{viewname}.builtinType String The type of the built-in View.
- ASSIGNEE: The “Assigned to me” View.
  (This list is automatically created if the Process Management settings have been enabled in the app.)
Currently, there are no other types of built-in Views.
views.{viewname}.date String The field code set for the Date Field.
Responded for Calendar Views.
views.{viewname}.fields Array The list of field codes for the fields displayed in the View.
Responded for List Views.
views.{viewname}.filterCond String The filter condition as a query.
Check here for more information on query formats.
views.{viewname}.html String The HTML code set for the View.
Responded for Custom Views.
views.{viewname}.id String The View ID.
views.{viewname}.index String The display order (ascending) of the View, when listed with other views.
views.{viewname}.name String The name of the View.
views.{viewname}.pager Boolean The pagination settings.
Responded for Custom Views.
- true: Enabled
- false: Disabled
views.{viewname}.device String The scope of where the view is displayed.
- DESKTOP: Display only on desktop
- ANY: Display on both desktop and mobile
views.{viewname}.sort String The sort order as a query.
Check here for more information on query formats.
views.{viewname}.title String The field code set for the Title Field.
Responded for Calendar Views.
views.{viewname}.type String The type of View.
- LIST: List View
- CALENDAR: Calendar View
- CUSTOM: Custom View

Sample Response

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
{
  "views": {
    "View1": {
      "type": "LIST",
      "name": "View1",
      "id": "20733",
      "filterCond": "Date_2 > LAST_WEEK()",
      "sort": "Record_number asc",
      "index": "1",
      "fields": ["Record_number", "Author"]
    },
    "Calendar View1": {
      "type": "CALENDAR",
      "name": "Calendar View1",
      "id": "20735",
      "filterCond": "",
      "sort": "Record_number asc",
      "index": "2",
      "date": "Updated_datetime",
      "title": "Rich_text"
    },
    "Custom View1": {
      "type": "CUSTOM",
      "name": "Custom View1",
      "id": "20736",
      "filterCond": "Updated_datetime >= LAST_WEEK() and Updated_datetime <= TODAY()",
      "sort": "Updated_datetime desc",
      "index": "3",
      "html": "<div>Custom View HTML</div>",
      "pager": true
    },
    "(Assigned to me)": {
      "type": "LIST",
      "name": "(Assigned to me)",
      "id": "9668",
      "filterCond": "Assignee in (LOGINUSER())",
      "sort": "Date asc",
      "index": "0",
      "fields": [
        "Date",
        "Single_line_text",
        "Drop_down",
        "Single_line_text_2",
        "Total_Expenses",
        "Attachment",
        "Itemized_Expenses"
      ],
      "builtinType": "ASSIGNEE"
    }
  },
  "revision": "19"
}

Limitations

This API cannot be used to retrieve View settings if there are multiple Views with the same name.