kntn_record: 'kintone' Record API

Description Usage Arguments Details See Also Examples

View source: R/kntn_record.R

Description

kntn_record() gets a single record from the specified kintone application. kntn_records() retrieves multiple records at once. If the number of records is more than records_per_request (the default is 100), kntn_records() automatically splits the request into smaller subrequests.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
kntn_record(app, id, as = c("data.frame", "list", "text"), verbose = FALSE)

kntn_records(
  app,
  fields = NULL,
  query = "",
  max_records = 1000L,
  offset = 0L,
  records_per_request = 100L,
  as = c("data.frame", "list", "text"),
  verbose = FALSE
)

Arguments

app

App ID.

id

Record ID.

as

Desired type of output: data.frame, list or text (data.frame means tbl_df).

verbose

If TRUE, output logs verbosely.

fields

Names of fields.

query

Query (e.g. "updated_time > \"2012-02-03T09:00:00+0900\" and updated_time < \"2012-02-03T10:00:00+0900\"").

max_records

Max number of records to get.

offset

Offset of records.

records_per_request

Number of records per request (max: 100).

Details

A field will be converted to the correspondent object by the type:

Some types will be converted to nested objects. You can unnest these fields by kntn_unnest.

See Also

https://developer.kintone.io/hc/en-us/articles/213149287/

Examples

 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
## Not run: 
kntn_set_auth()

app <- 10

# get a single record
d <- kntn_record(app, id = 1)

# get records up to 1000 (default)
d <- kntn_records(app)

# get records up to 5000 records at the latency of 500 records/request.
d <- kntn_records(app, max_records = 5000, records_per_request = 500L)

# get records as list
d <- kntn_records(app, as = "list")

# get records matched with the specified query and fields.
# See https://developer.kintone.io/hc/en-us/articles/213149287/ for the query syntax
d <- kntn_records(app, fields = c("timestamp", "value"),
                  query = "updated_time > \"2016-10-03T09:00:00+0900\"")

# Some types like SUBTABLE are converted as nested data.frame.
# You can unnest them by using kntn_unnest.
kntn_unnest(d)

## End(Not run)

kntnr documentation built on April 14, 2020, 5:36 p.m.