Skip to contents

This function provides a method for generating and sending a json based data query to the EES API. As a minimum, it requires the dataset_id flag and either the indicators flag or a json file containing a query to be provided.

Usage

post_dataset(
  dataset_id,
  indicators = NULL,
  time_periods = NULL,
  geographies = NULL,
  filter_items = NULL,
  json_query = NULL,
  dataset_version = NULL,
  preview_token = NULL,
  ees_environment = NULL,
  api_version = NULL,
  page = NULL,
  page_size = 10000,
  parse = TRUE,
  debug = FALSE,
  verbose = FALSE
)

Arguments

dataset_id

ID of data set to be connected to. This is required if the endpoint is one of "get-dataset-versions", "get-summary", "get-meta", "get-csv", "get-data" or "post-data"

indicators

Indicators required as a string or vector of strings (required)

time_periods

Time periods required as a string ("period|code") or vector of strings

geographies

String, vector or data frame containing the geographic levels and locations to be queried.

filter_items

Filter items required as a string or vector of strings

json_query

Optional path to a json file containing the query parameters

dataset_version

Version of data set to be connected to

preview_token

Preview token required for access to private data sets

ees_environment

EES ees_environment to connect to: "dev", "test", "preprod" or "prod"

api_version

EES API version

page

Page number of query results to return

page_size

Number of results to return in a single query

parse

Logical flag to activate parsing of the results. Default: TRUE

debug

Run POST query in debug mode. Logical, default = FALSE

verbose

Run with additional contextual messaging. Logical, default = FALSE

Value

Data frame containing query results of an API data set

Examples

eesyapi:::post_dataset(
  example_id(group = "attendance"),
  json_query = example_json_query()
)
#>    time_period time_identifier geographic_level nat_name  nat_code   reg_name
#> 1         2025          Week 3         Regional  England E92000001 North East
#> 2         2025          Week 3         Regional  England E92000001 North East
#> 3         2025          Week 3         Regional  England E92000001 North East
#> 4         2025          Week 3         Regional  England E92000001 North East
#> 5         2025          Week 3         Regional  England E92000001 North East
#> 6         2025          Week 3         Regional  England E92000001 North East
#> 7         2025          Week 3         Regional  England E92000001 North East
#> 8         2025          Week 3         Regional  England E92000001 North East
#> 9         2025          Week 3         Regional  England E92000001 North East
#> 10        2025          Week 3         Regional  England E92000001 North East
#> 11        2025          Week 3         Regional  England E92000001 North East
#> 12        2025          Week 3         Regional  England E92000001 North East
#> 13        2025          Week 3         Regional  England E92000001 North East
#> 14        2025          Week 3         Regional  England E92000001 North East
#> 15        2025          Week 3         Regional  England E92000001 North East
#> 16        2025          Week 3         Regional  England E92000001 North East
#> 17        2025          Week 3         Regional  England E92000001 North West
#> 18        2025          Week 3         Regional  England E92000001 North West
#> 19        2025          Week 3         Regional  England E92000001 North West
#> 20        2025          Week 3         Regional  England E92000001 North West
#> 21        2025          Week 3         Regional  England E92000001 North West
#> 22        2025          Week 3         Regional  England E92000001 North West
#> 23        2025          Week 3         Regional  England E92000001 North West
#> 24        2025          Week 3         Regional  England E92000001 North West
#> 25        2025          Week 3         Regional  England E92000001 North West
#> 26        2025          Week 3         Regional  England E92000001 North West
#> 27        2025          Week 3         Regional  England E92000001 North West
#> 28        2025          Week 3         Regional  England E92000001 North West
#> 29        2025          Week 3         Regional  England E92000001 North West
#> 30        2025          Week 3         Regional  England E92000001 North West
#> 31        2025          Week 3         Regional  England E92000001 North West
#> 32        2025          Week 3         Regional  England E92000001 North West
#>     reg_code                 attendance_reason attendance_status
#> 1  E12000001 All approved educational activity        Attendance
#> 2  E12000001             All possible sessions Possible sessions
#> 3  E12000001            Education off site (b)        Attendance
#> 4  E12000001                     Interview (j)        Attendance
#> 5  E12000001    Approved sporting activity (p)        Attendance
#> 6  E12000001        Educational visit trip (v)        Attendance
#> 7  E12000001               Work experience (w)        Attendance
#> 8  E12000001      Education arranged by LA (k)        Attendance
#> 9  E12000001 All approved educational activity        Attendance
#> 10 E12000001             All possible sessions Possible sessions
#> 11 E12000001            Education off site (b)        Attendance
#> 12 E12000001                     Interview (j)        Attendance
#> 13 E12000001    Approved sporting activity (p)        Attendance
#> 14 E12000001        Educational visit trip (v)        Attendance
#> 15 E12000001               Work experience (w)        Attendance
#> 16 E12000001      Education arranged by LA (k)        Attendance
#> 17 E12000002 All approved educational activity        Attendance
#> 18 E12000002             All possible sessions Possible sessions
#> 19 E12000002            Education off site (b)        Attendance
#> 20 E12000002                     Interview (j)        Attendance
#> 21 E12000002    Approved sporting activity (p)        Attendance
#> 22 E12000002        Educational visit trip (v)        Attendance
#> 23 E12000002               Work experience (w)        Attendance
#> 24 E12000002      Education arranged by LA (k)        Attendance
#> 25 E12000002 All approved educational activity        Attendance
#> 26 E12000002             All possible sessions Possible sessions
#> 27 E12000002            Education off site (b)        Attendance
#> 28 E12000002                     Interview (j)        Attendance
#> 29 E12000002    Approved sporting activity (p)        Attendance
#> 30 E12000002        Educational visit trip (v)        Attendance
#> 31 E12000002               Work experience (w)        Attendance
#> 32 E12000002      Education arranged by LA (k)        Attendance
#>                  attendance_type education_phase time_frame session_count
#> 1  Approved educational activity     All schools       Week         21584
#> 2          All possible sessions     All schools       Week       3237578
#> 3  Approved educational activity     All schools       Week          7216
#> 4  Approved educational activity     All schools       Week             0
#> 5  Approved educational activity     All schools       Week          2896
#> 6  Approved educational activity     All schools       Week          9049
#> 7  Approved educational activity     All schools       Week           519
#> 8  Approved educational activity     All schools       Week          1904
#> 9  Approved educational activity         Primary       Week          7173
#> 10         All possible sessions         Primary       Week       1658991
#> 11 Approved educational activity         Primary       Week          1088
#> 12 Approved educational activity         Primary       Week             0
#> 13 Approved educational activity         Primary       Week          1159
#> 14 Approved educational activity         Primary       Week          4793
#> 15 Approved educational activity         Primary       Week             0
#> 16 Approved educational activity         Primary       Week           133
#> 17 Approved educational activity     All schools       Week         56450
#> 18         All possible sessions     All schools       Week       9714685
#> 19 Approved educational activity     All schools       Week         20796
#> 20 Approved educational activity     All schools       Week             0
#> 21 Approved educational activity     All schools       Week          6720
#> 22 Approved educational activity     All schools       Week         23925
#> 23 Approved educational activity     All schools       Week          2054
#> 24 Approved educational activity     All schools       Week          2955
#> 25 Approved educational activity         Primary       Week         19296
#> 26         All possible sessions         Primary       Week       5175969
#> 27 Approved educational activity         Primary       Week          4707
#> 28 Approved educational activity         Primary       Week             0
#> 29 Approved educational activity         Primary       Week          2963
#> 30 Approved educational activity         Primary       Week         11224
#> 31 Approved educational activity         Primary       Week             0
#> 32 Approved educational activity         Primary       Week           402

# Run post_dataset() to select rows containing either of two geographic locations and a single
# filter item.
eesyapi:::post_dataset(
  example_id(group = "attendance"),
  indicators = example_id("indicator", group = "attendance"),
  time_periods = example_id("time_period", group = "attendance"),
  geographies = example_id("location_code", group = "attendance"),
  filter_items = example_id("filter_item", group = "attendance"),
  page = 1,
  page_size = 32
)
#>    time_period time_identifier geographic_level nat_name  nat_code
#> 1         2025          Week 3         National  England E92000001
#> 2         2025          Week 3         National  England E92000001
#> 3         2025          Week 3         National  England E92000001
#> 4         2025          Week 3         National  England E92000001
#> 5         2025          Week 3         National  England E92000001
#> 6         2025          Week 3         National  England E92000001
#> 7         2025          Week 3         National  England E92000001
#> 8         2025          Week 3         National  England E92000001
#> 9         2025          Week 3         National  England E92000001
#> 10        2025          Week 3         National  England E92000001
#> 11        2025          Week 3         National  England E92000001
#> 12        2025          Week 3         National  England E92000001
#> 13        2025          Week 3         National  England E92000001
#> 14        2025          Week 3         National  England E92000001
#> 15        2025          Week 3         National  England E92000001
#> 16        2025          Week 3         National  England E92000001
#> 17        2025          Week 3         National  England E92000001
#> 18        2025          Week 3         National  England E92000001
#> 19        2025          Week 3         National  England E92000001
#> 20        2025          Week 3         National  England E92000001
#> 21        2025          Week 3         National  England E92000001
#> 22        2025          Week 3         National  England E92000001
#> 23        2025          Week 3         National  England E92000001
#> 24        2025          Week 3         National  England E92000001
#>    attendance_reason attendance_status   attendance_type education_phase
#> 1  All late sessions     Late sessions All late sessions     All schools
#> 2  All late sessions     Late sessions All late sessions     All schools
#> 3  All late sessions     Late sessions All late sessions     All schools
#> 4  All late sessions     Late sessions All late sessions     All schools
#> 5  All late sessions     Late sessions All late sessions     All schools
#> 6  All late sessions     Late sessions All late sessions     All schools
#> 7  All late sessions     Late sessions All late sessions         Primary
#> 8  All late sessions     Late sessions All late sessions         Primary
#> 9  All late sessions     Late sessions All late sessions         Primary
#> 10 All late sessions     Late sessions All late sessions         Primary
#> 11 All late sessions     Late sessions All late sessions         Primary
#> 12 All late sessions     Late sessions All late sessions         Primary
#> 13 All late sessions     Late sessions All late sessions       Secondary
#> 14 All late sessions     Late sessions All late sessions       Secondary
#> 15 All late sessions     Late sessions All late sessions       Secondary
#> 16 All late sessions     Late sessions All late sessions       Secondary
#> 17 All late sessions     Late sessions All late sessions       Secondary
#> 18 All late sessions     Late sessions All late sessions       Secondary
#> 19 All late sessions     Late sessions All late sessions         Special
#> 20 All late sessions     Late sessions All late sessions         Special
#> 21 All late sessions     Late sessions All late sessions         Special
#> 22 All late sessions     Late sessions All late sessions         Special
#> 23 All late sessions     Late sessions All late sessions         Special
#> 24 All late sessions     Late sessions All late sessions         Special
#>    time_frame session_count
#> 1      Monday        351238
#> 2     Tuesday        339489
#> 3   Wednesday        332601
#> 4    Thursday        325478
#> 5      Friday        290697
#> 6        Week       1639503
#> 7      Monday        119171
#> 8     Tuesday        108143
#> 9   Wednesday        104015
#> 10   Thursday        103341
#> 11     Friday         88855
#> 12       Week        523525
#> 13     Monday        228420
#> 14    Tuesday        227692
#> 15  Wednesday        225185
#> 16   Thursday        218840
#> 17     Friday        199159
#> 18       Week       1099296
#> 19     Monday          3647
#> 20    Tuesday          3654
#> 21  Wednesday          3401
#> 22   Thursday          3297
#> 23     Friday          2683
#> 24       Week         16682