├── .gitignore
├── LICENSE
├── tests
├── test-all.R
└── testthat
│ ├── test-server.R
│ └── test-connect.R
├── R
├── zzz.R
├── rjsonapi-package.R
├── jsonapi_server.R
└── connect.R
├── NEWS.md
├── NAMESPACE
├── README.md
├── .Rbuildignore
├── .github
├── issue_template.md
├── pull_request_template.md
└── CONTRIBUTING.md
├── inst
├── examples
│ ├── authors2.json
│ ├── authors1.json
│ ├── stores.json
│ ├── v1.json
│ ├── series.json
│ ├── authors.json
│ ├── server.R
│ ├── authors_1_books.json
│ ├── authors_2_books.json
│ ├── photos.json
│ ├── books.json
│ └── chapters.json
└── ignore
│ └── JsonAPIModel.R
├── README-NOT.md
├── cran-comments.md
├── .travis.yml
├── DESCRIPTION
├── Makefile
├── man
├── rjsonapi-package.Rd
├── jsonapi_server.Rd
└── jsonapi_connect.Rd
├── README.Rmd
└── codemeta.json
/.gitignore:
--------------------------------------------------------------------------------
1 | .Rproj.user
2 | .Rhistory
3 | .RData
4 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | YEAR: 2017
2 | COPYRIGHT HOLDER: Scott Chamberlain
3 |
--------------------------------------------------------------------------------
/tests/test-all.R:
--------------------------------------------------------------------------------
1 | library("testthat")
2 | test_check("rjsonapi")
3 |
--------------------------------------------------------------------------------
/R/zzz.R:
--------------------------------------------------------------------------------
1 | comp <- function(l) {
2 | Filter(Negate(is.null), l)
3 | }
4 |
--------------------------------------------------------------------------------
/NEWS.md:
--------------------------------------------------------------------------------
1 | rjsonapi 0.1.0
2 | ==============
3 |
4 | * Initial release to CRAN
5 |
--------------------------------------------------------------------------------
/tests/testthat/test-server.R:
--------------------------------------------------------------------------------
1 | context("jsonapi_server")
2 |
3 | test_that("jsonapi_connect to a jsonapi - local", {
4 | expect_is(jsonapi_server, "function")
5 | expect_true(any(grepl("plumber", deparse(jsonapi_server))))
6 | })
7 |
--------------------------------------------------------------------------------
/NAMESPACE:
--------------------------------------------------------------------------------
1 | # Generated by roxygen2: do not edit by hand
2 |
3 | export(jsonapi_connect)
4 | export(jsonapi_server)
5 | importFrom(R6,R6Class)
6 | importFrom(crul,HttpClient)
7 | importFrom(jsonlite,fromJSON)
8 | importFrom(plumber,plumb)
9 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # rjsonapi
2 |
3 | [](https://www.repostatus.org/#abandoned)
4 |
5 | This repository has been archived. The former README is now in [README-NOT.md](README-NOT.md).
6 |
--------------------------------------------------------------------------------
/.Rbuildignore:
--------------------------------------------------------------------------------
1 | ^.*\.Rproj$
2 | ^\.Rproj\.user$
3 | ^\.travis\.yml$
4 | ^appveyor\.yml$
5 | ^\.httr-oauth$
6 | cran-comments.md
7 | vignettes/figure
8 | README.Rmd
9 | endpoints-example
10 | ^CONDUCT\.md$
11 | Makefile
12 | .github
13 |
14 | ^codemeta\.json$
15 |
--------------------------------------------------------------------------------
/.github/issue_template.md:
--------------------------------------------------------------------------------
1 |
2 |
3 | Session Info
4 |
5 | ```r
6 |
7 | ```
8 |
9 |
--------------------------------------------------------------------------------
/inst/examples/authors2.json:
--------------------------------------------------------------------------------
1 | {"data":{"id":"2","type":"authors","attributes":{"name":"J. K. Rowling","date_of_birth":"1965-07-31","date_of_death":null,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"books":{"links":{"self":"/v1/authors/2/relationships/books","related":"/v1/authors/2/books"}},"photos":{"links":{"self":"/v1/authors/2/relationships/photos","related":"/v1/authors/2/photos"}}},"links":{"self":"/v1/authors/2"}}}
2 |
--------------------------------------------------------------------------------
/inst/examples/authors1.json:
--------------------------------------------------------------------------------
1 | {"data":{"id":"1","type":"authors","attributes":{"name":"J. R. R. Tolkien","date_of_birth":"1892-01-03","date_of_death":"1973-09-02","created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"books":{"links":{"self":"/v1/authors/1/relationships/books","related":"/v1/authors/1/books"}},"photos":{"links":{"self":"/v1/authors/1/relationships/photos","related":"/v1/authors/1/photos"}}},"links":{"self":"/v1/authors/1"}}}
2 |
--------------------------------------------------------------------------------
/README-NOT.md:
--------------------------------------------------------------------------------
1 | rjsonapi
2 | ========
3 |
4 |
5 |
6 | [](https://www.repostatus.org/#abandoned)
7 |
8 |
9 | An R client for consuming APIs that follow the [JSONAPI spec][spec]. This library
10 | does not do server side JSONAPI things.
11 |
12 |
--------------------------------------------------------------------------------
/inst/examples/stores.json:
--------------------------------------------------------------------------------
1 | {"data":[{"id":"1","type":"stores","attributes":{"name":"empty store","created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"books":{"links":{"self":"/v1/stores/1/relationships/books","related":"/v1/stores/1/books"}}},"links":{"self":"/v1/stores/1"}},{"id":"2","type":"stores","attributes":{"name":"full store","created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"books":{"links":{"self":"/v1/stores/2/relationships/books","related":"/v1/stores/2/books"}}},"links":{"self":"/v1/stores/2"}}]}
2 |
--------------------------------------------------------------------------------
/cran-comments.md:
--------------------------------------------------------------------------------
1 | ## Test environments
2 |
3 | * local OS X install, R 3.3.2
4 | * ubuntu 12.04 (on travis-ci), R 3.3.2
5 | * win-builder (devel and release)
6 |
7 | ## R CMD check results
8 |
9 | 0 errors | 0 warnings | 1 note
10 |
11 | License components with restrictions and base license permitting such:
12 | MIT + file LICENSE
13 | File 'LICENSE':
14 | YEAR: 2017
15 | COPYRIGHT HOLDER: Scott Chamberlain
16 |
17 | ## Reverse dependencies
18 |
19 | This is a new submission, so now reverse dependencies.
20 |
21 | --------
22 |
23 | I have ..
24 |
25 | Thanks!
26 | Scott Chamberlain
27 |
--------------------------------------------------------------------------------
/inst/examples/v1.json:
--------------------------------------------------------------------------------
1 | {
2 | "authors": "/v1/authors?include={books,books.chapters,photos}&filter[{id,name,alive,dead,date_of_birth,date_of_death,born_before,born_after}]",
3 | "books": "/v1/books?include={chapters,firstChapter,series,author,stores,photos}&filter[{author_id,series_id,date_published,published_before,published_after,title}]",
4 | "chapters": "/v1/chapters?include={book}&filter[{book_id,title,ordering}]",
5 | "photos": "/v1/photos?include={imageable}",
6 | "series": "/v1/series?include={books,photos}&filter[{title}]",
7 | "stores": "/v1/stores?include={books,books.author}"
8 | }
9 |
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 | language: r
2 | sudo: required
3 | cache: packages
4 | dist: trusty
5 |
6 | addons:
7 | apt:
8 | packages:
9 | - libcurl4-openssl-dev
10 |
11 | r_github_packages:
12 | - jimhester/covr
13 |
14 | r_check_args: "--as-cran"
15 |
16 | after_success:
17 | - Rscript -e 'covr::codecov()'
18 |
19 | notifications:
20 | email:
21 | on_success: change
22 | on_failure: change
23 | slack:
24 | secure: JgCatgv7Eeh6qHmi3TwWLdKHkCjnr5KHcBzVwy2F4IPafqPMEEhnSFxqP2Td8f7YcPqvdiv/blTGdgIOAi3V64O4fp3NZLLpzINNiL0i9iBZqkT71uw8ovcfrAeIHA9D9gapLtx3D4hdUF9jIyLIW2kMzIvaIA5PiDJ+oZitHow=
25 |
--------------------------------------------------------------------------------
/.github/pull_request_template.md:
--------------------------------------------------------------------------------
1 |
2 |
3 | ## Description
4 |
5 |
6 | ## Related Issue
7 |
10 |
11 | ## Example
12 |
14 |
15 |
17 |
--------------------------------------------------------------------------------
/inst/examples/series.json:
--------------------------------------------------------------------------------
1 | {"data":[{"id":"1","type":"series","attributes":{"title":"The Lord of the Rings","photo_id":16,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"books":{"links":{"self":"/v1/series/1/relationships/books","related":"/v1/series/1/books"}},"photos":{"links":{"self":"/v1/series/1/relationships/photos","related":"/v1/series/1/photos"}}},"links":{"self":"/v1/series/1"}},{"id":"2","type":"series","attributes":{"title":"Harry Potter","photo_id":17,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"books":{"links":{"self":"/v1/series/2/relationships/books","related":"/v1/series/2/books"}},"photos":{"links":{"self":"/v1/series/2/relationships/photos","related":"/v1/series/2/photos"}}},"links":{"self":"/v1/series/2"}}]}
2 |
--------------------------------------------------------------------------------
/DESCRIPTION:
--------------------------------------------------------------------------------
1 | Package: rjsonapi
2 | Title: Consumer for APIs that Follow the JSON API Specification
3 | Description: Consumer for APIs that Follow the JSON API Specification
4 | (). Package mostly consumes data - with experimental
5 | support for serving JSON API data.
6 | Version: 0.1.9.91
7 | Authors@R: person("Scott", "Chamberlain", role = c("aut", "cre"),
8 | email = "myrmecocystus@gmail.com",
9 | comment = c(ORCID = "0000-0003-1444-9135"))
10 | License: MIT + file LICENSE
11 | URL: https://docs.ropensci.org/rjsonapi/, https://github.com/ropensci/rjsonapi
12 | BugReports: https://github.com/ropensci/rjsonapi/issues
13 | Encoding: UTF-8
14 | Language: en-US
15 | Roxygen: list(markdown = TRUE)
16 | Imports:
17 | crul,
18 | R6,
19 | jsonlite,
20 | plumber (>= 0.3.1)
21 | Suggests:
22 | testthat
23 | RoxygenNote: 7.1.1
24 |
--------------------------------------------------------------------------------
/inst/examples/authors.json:
--------------------------------------------------------------------------------
1 | {"data":[{"id":"1","type":"authors","attributes":{"name":"J. R. R. Tolkien","date_of_birth":"1892-01-03","date_of_death":"1973-09-02","created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"books":{"links":{"self":"/v1/authors/1/relationships/books","related":"/v1/authors/1/books"}},"photos":{"links":{"self":"/v1/authors/1/relationships/photos","related":"/v1/authors/1/photos"}}},"links":{"self":"/v1/authors/1"}},{"id":"2","type":"authors","attributes":{"name":"J. K. Rowling","date_of_birth":"1965-07-31","date_of_death":null,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"books":{"links":{"self":"/v1/authors/2/relationships/books","related":"/v1/authors/2/books"}},"photos":{"links":{"self":"/v1/authors/2/relationships/photos","related":"/v1/authors/2/photos"}}},"links":{"self":"/v1/authors/2"}}]}
2 |
--------------------------------------------------------------------------------
/Makefile:
--------------------------------------------------------------------------------
1 | PACKAGE := $(shell grep '^Package:' DESCRIPTION | sed -E 's/^Package:[[:space:]]+//')
2 | RSCRIPT = Rscript --no-init-file
3 |
4 | vign:
5 | cd vignettes;\
6 | ${RSCRIPT} -e "Sys.setenv(NOT_CRAN='true'); knitr::knit('rjsonapi.Rmd.og', output = 'rjsonapi.Rmd')";\
7 | cd ..
8 |
9 | install: doc build
10 | R CMD INSTALL . && rm *.tar.gz
11 |
12 | build:
13 | R CMD build .
14 |
15 | doc:
16 | ${RSCRIPT} -e "devtools::document()"
17 |
18 | eg:
19 | ${RSCRIPT} -e "devtools::run_examples(run = TRUE)"
20 |
21 | check: build
22 | _R_CHECK_CRAN_INCOMING_=FALSE R CMD CHECK --as-cran --no-manual `ls -1tr ${PACKAGE}*gz | tail -n1`
23 | @rm -f `ls -1tr ${PACKAGE}*gz | tail -n1`
24 | @rm -rf ${PACKAGE}.Rcheck
25 |
26 | test:
27 | ${RSCRIPT} -e 'devtools::test()'
28 |
29 | readme:
30 | ${RSCRIPT} -e 'knitr::knit("README.Rmd")'
31 |
32 | check_windows:
33 | ${RSCRIPT} -e "devtools::check_win_devel(); devtools::check_win_release()"
34 |
35 |
--------------------------------------------------------------------------------
/man/rjsonapi-package.Rd:
--------------------------------------------------------------------------------
1 | % Generated by roxygen2: do not edit by hand
2 | % Please edit documentation in R/rjsonapi-package.R
3 | \docType{package}
4 | \name{rjsonapi-package}
5 | \alias{rjsonapi-package}
6 | \alias{rjsonapi}
7 | \title{rjsonapi}
8 | \description{
9 | Consumer for APIs that follow the JSON API specification
10 | }
11 | \section{JSON API}{
12 |
13 | JSON API is a specification for building APIs (Application Programming
14 | Interfaces) in JSON (Javascript Object Notation).
15 |
16 | The JSON API website is at https://jsonapi.org/ . The specification
17 | itself is at https://jsonapi.org/format/, with implementations at
18 | https://jsonapi.org/implementations/
19 | }
20 |
21 | \section{Examples}{
22 |
23 | There are very few examples to see in the real world. One example
24 | comes from CodeClimate. Their API docs are at
25 | https://developer.codeclimate.com/#overview
26 | }
27 |
28 | \author{
29 | Scott Chamberlain
30 | }
31 | \keyword{package}
32 |
--------------------------------------------------------------------------------
/R/rjsonapi-package.R:
--------------------------------------------------------------------------------
1 | #' @title rjsonapi
2 | #' @description Consumer for APIs that follow the JSON API specification
3 | #' @importFrom jsonlite fromJSON
4 | #' @importFrom R6 R6Class
5 | #' @importFrom plumber plumb
6 | #' @importFrom crul HttpClient
7 | #' @name rjsonapi-package
8 | #' @aliases rjsonapi
9 | #' @docType package
10 | #' @author Scott Chamberlain
11 | #' @keywords package
12 | #'
13 | #' @section JSON API:
14 | #' JSON API is a specification for building APIs (Application Programming
15 | #' Interfaces) in JSON (Javascript Object Notation).
16 | #'
17 | #' The JSON API website is at https://jsonapi.org/ . The specification
18 | #' itself is at https://jsonapi.org/format/, with implementations at
19 | #' https://jsonapi.org/implementations/
20 | #'
21 | #' @section Examples:
22 | #' There are very few examples to see in the real world. One example
23 | #' comes from CodeClimate. Their API docs are at
24 | #' https://developer.codeclimate.com/#overview
25 | NULL
26 |
--------------------------------------------------------------------------------
/.github/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | # CONTRIBUTING #
2 |
3 | ### Bugs?
4 |
5 | * Submit an issue on the [Issues page](https://github.com/ropensci/rjsonapi/issues)
6 |
7 | ### Code contributions
8 |
9 | * Fork this repo to your Github account
10 | * Clone your version on your account down to your machine from your account, e.g,. `git clone https://github.com//rjsonapi.git`
11 | * Make sure to track progress upstream (i.e., on our version of `rjsonapi` at `ropensci/rjsonapi`) by doing `git remote add upstream https://github.com/ropensci/rjsonapi.git`. Before making changes make sure to pull changes in from upstream by doing either `git fetch upstream` then merge later or `git pull upstream` to fetch and merge in one step
12 | * Make your changes (bonus points for making changes on a new feature branch)
13 | * Push up to your account
14 | * Submit a pull request to home base at `ropensci/rjsonapi`
15 |
16 | ### Also, check out our [discussion forum](https://discuss.ropensci.org)
17 |
--------------------------------------------------------------------------------
/man/jsonapi_server.Rd:
--------------------------------------------------------------------------------
1 | % Generated by roxygen2: do not edit by hand
2 | % Please edit documentation in R/jsonapi_server.R
3 | \name{jsonapi_server}
4 | \alias{jsonapi_server}
5 | \title{Start a JSONAPI server}
6 | \usage{
7 | jsonapi_server(port = 8000)
8 | }
9 | \arguments{
10 | \item{port}{(integer) the port to run the server on. default: 8000}
11 | }
12 | \description{
13 | Start a JSONAPI server
14 | }
15 | \details{
16 | Right now, this function doesn't take arbitrary input, but
17 | instead serves the same content as this JSON API example
18 | https://github.com/endpoints/endpoints-example . Note that not all
19 | features are the same as the full \code{endpoints-example}, but most
20 | should work.
21 |
22 | Right now, this function serves data from static, minified JSON files,
23 | so there's no dynamic database underneath.
24 |
25 | Kill the server by CTRL+C, ESC or similar.
26 | }
27 | \examples{
28 | \dontrun{
29 | if (interactive()) {
30 | # start a server in another R session
31 | jsonapi_server()
32 |
33 | # Back in this session ...
34 | # Connect
35 | (conn <- jsonapi_connect("http://localhost:8000"))
36 |
37 | # Get data
38 | conn$url
39 | conn$version
40 | conn$content_type
41 | conn$routes()
42 | conn$route("authors")
43 | conn$route("chapters")
44 | conn$route("authors/1")
45 | conn$route("authors/1/books")
46 | conn$route("chapters/5")
47 | }
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/R/jsonapi_server.R:
--------------------------------------------------------------------------------
1 | #' Start a JSONAPI server
2 | #'
3 | #' @export
4 | #' @param port (integer) the port to run the server on. default: 8000
5 | #'
6 | #' @details Right now, this function doesn't take arbitrary input, but
7 | #' instead serves the same content as this JSON API example
8 | #' https://github.com/endpoints/endpoints-example . Note that not all
9 | #' features are the same as the full `endpoints-example`, but most
10 | #' should work.
11 | #'
12 | #' Right now, this function serves data from static, minified JSON files,
13 | #' so there's no dynamic database underneath.
14 | #'
15 | #' Kill the server by CTRL+C, ESC or similar.
16 | #'
17 | #' @examples \dontrun{
18 | #' if (interactive()) {
19 | #' # start a server in another R session
20 | #' jsonapi_server()
21 | #'
22 | #' # Back in this session ...
23 | #' # Connect
24 | #' (conn <- jsonapi_connect("http://localhost:8000"))
25 | #'
26 | #' # Get data
27 | #' conn$url
28 | #' conn$version
29 | #' conn$content_type
30 | #' conn$routes()
31 | #' conn$route("authors")
32 | #' conn$route("chapters")
33 | #' conn$route("authors/1")
34 | #' conn$route("authors/1/books")
35 | #' conn$route("chapters/5")
36 | #' }
37 | #' }
38 | jsonapi_server <- function(port = 8000) {
39 | r <- plumber::plumb(system.file("examples", "server.R",
40 | package = "rjsonapi"))
41 | r$run(port = port)
42 | }
43 |
--------------------------------------------------------------------------------
/tests/testthat/test-connect.R:
--------------------------------------------------------------------------------
1 | context("jsonapi_connect")
2 |
3 | cn <- jsonapi_connect(url = "http://localhost:8088")
4 |
5 | test_that("jsonapi_connect to a jsonapi - local", {
6 | skip_on_cran()
7 | expect_is(cn, "jsonapi_connection")
8 | expect_is(cn, "R6")
9 | expect_equal(cn$base_url(), "http://localhost:8088")
10 | expect_null(cn$endpt)
11 | expect_equal(cn$content_type, "application/vnd.api+json")
12 | expect_equal(cn$version, "v1")
13 | })
14 |
15 | test_that("private methods are actually private", {
16 | skip_on_cran()
17 | expect_null(cn$fromjson)
18 | expect_null(cn$check)
19 | })
20 |
21 | test_that("status method is as expected", {
22 | skip_on_cran()
23 | skip_on_travis()
24 | if (identical(Sys.getenv("TRAVIS"), "true")) {
25 | expect_equal(cn$status(), "OK (200)")
26 | }
27 | })
28 |
29 | test_that("routes method is as expected", {
30 | skip_on_cran()
31 | skip_on_travis()
32 | if (identical(Sys.getenv("TRAVIS"), "true")) {
33 | aa <- cn$routes()
34 |
35 | expect_is(aa, "list")
36 | expect_named(aa, c('authors','books','chapters','photos','series','stores'))
37 | expect_equal(length(aa), 6)
38 | expect_equal(length(aa$authors), 1)
39 | }
40 | })
41 |
42 | test_that("route method is as expected", {
43 | skip_on_cran()
44 | skip_on_travis()
45 | if (identical(Sys.getenv("TRAVIS"), "true")) {
46 | expect_error(cn$route(), "\"endpt\" is missing")
47 |
48 | aa <- cn$route("authors")
49 |
50 | expect_is(aa, "list")
51 | expect_named(aa, 'data')
52 | expect_equal(length(aa), 1)
53 | expect_equal(NROW(aa$data), 2)
54 | expect_named(aa$data, c('id','type','attributes','relationships','links'))
55 | }
56 | })
57 |
58 | test_that("include parameter works", {
59 | skip_on_cran()
60 | skip_on_travis()
61 | if (identical(Sys.getenv("TRAVIS"), "true")) {
62 | aa <- cn$route("authors/1")
63 | bb <- cn$route("authors/1", include = "books")
64 |
65 | expect_is(aa, "list")
66 | expect_is(bb, "list")
67 |
68 | expect_named(aa, "data")
69 | expect_named(bb, c("data", "included"))
70 |
71 | expect_is(bb$included, "data.frame")
72 | }
73 | })
74 |
--------------------------------------------------------------------------------
/inst/examples/server.R:
--------------------------------------------------------------------------------
1 | #* @get /v1/?
2 | v1 <- function(){
3 | lapply(jsonlite::fromJSON("v1.json", FALSE), jsonlite::unbox)
4 | }
5 |
6 |
7 |
8 | #* @get /v1/authors/?
9 | authors <- function(){
10 | jsonlite::fromJSON("authors.json", FALSE)
11 | }
12 |
13 | #* @get /v1/authors//?
14 | author <- function(author){
15 | # jsonlite::fromJSON(sprintf("authors%s.json", author), FALSE)
16 | res <- jsonlite::fromJSON("authors.json", FALSE)
17 | list(data = res$data[vapply(res$data, "[[", "", "id") == as.character(author)])
18 | }
19 |
20 | #* @get /v1/authors//books/?
21 | author_book <- function(author){
22 | jsonlite::fromJSON(sprintf("authors_%s_books.json", author), FALSE)
23 | }
24 |
25 |
26 |
27 | #* @get /v1/books/?
28 | books <- function(){
29 | jsonlite::fromJSON("books.json", FALSE)
30 | }
31 |
32 | #* @get /v1/books/?
33 | book <- function(book){
34 | res <- jsonlite::fromJSON("books.json", FALSE)
35 | list(data = res$data[vapply(res$data, "[[", "", "id") == as.character(book)])
36 | }
37 |
38 |
39 |
40 | #* @get /v1/chapters/?
41 | chapters <- function(){
42 | jsonlite::fromJSON("chapters.json", FALSE)
43 | }
44 |
45 | #* @get /v1/chapters/?
46 | chapter <- function(chapter){
47 | res <- jsonlite::fromJSON("chapters.json", FALSE)
48 | list(data = res$data[vapply(res$data, "[[", "", "id") == as.character(chapter)])
49 | }
50 |
51 |
52 | #* @get /v1/photos/?
53 | photos <- function(){
54 | jsonlite::fromJSON("photos.json", FALSE)
55 | }
56 |
57 | #* @get /v1/photos/?
58 | photo <- function(photo){
59 | res <- jsonlite::fromJSON("photos.json", FALSE)
60 | list(data = res$data[vapply(res$data, "[[", "", "id") == as.character(photo)])
61 | }
62 |
63 |
64 |
65 | #* @get /v1/series/?
66 | series <- function(){
67 | jsonlite::fromJSON("series.json", FALSE)
68 | }
69 |
70 | #* @get /v1/series/?
71 | series <- function(ser){
72 | res <- jsonlite::fromJSON("series.json", FALSE)
73 | list(data = res$data[vapply(res$data, "[[", "", "id") == as.character(ser)])
74 | }
75 |
76 |
77 |
78 | #* @get /v1/stores/?
79 | stores <- function(){
80 | jsonlite::fromJSON("stores.json", FALSE)
81 | }
82 |
83 | #* @get /v1/stores/?
84 | store <- function(store){
85 | res <- jsonlite::fromJSON("stores.json", FALSE)
86 | list(data = res$data[vapply(res$data, "[[", "", "id") == as.character(store)])
87 | }
88 |
--------------------------------------------------------------------------------
/man/jsonapi_connect.Rd:
--------------------------------------------------------------------------------
1 | % Generated by roxygen2: do not edit by hand
2 | % Please edit documentation in R/connect.R
3 | \name{jsonapi_connect}
4 | \alias{jsonapi_connect}
5 | \title{Connection}
6 | \usage{
7 | jsonapi_connect(url, version, content_type, headers, ...)
8 | }
9 | \arguments{
10 | \item{url}{(character) Base url, without the version information,
11 | e.g., \verb{http://localhost:8088}}
12 |
13 | \item{version}{(character) API version. Default: \code{v1}}
14 |
15 | \item{content_type}{(character) the content type to set in all request
16 | headers. Default: 'application/vnd.api+json'}
17 |
18 | \item{headers}{(list) A list of headers to be applied to each requset.}
19 |
20 | \item{...}{Curl options passed on to \link[crul:verb-GET]{crul::verb-GET}. You
21 | can set these for all requests, or on each request - see examples.}
22 | }
23 | \description{
24 | Connection
25 | }
26 | \details{
27 | \strong{Methods}
28 | \itemize{
29 | \item \code{status(...)}: Check server status with a HEAD request
30 | \itemize{
31 | \item \code{...}: curl options passed on to \link[crul:verb-GET]{crul::verb-GET}
32 | }
33 | \item \code{routes(...)}: Get routes the server supports
34 | \itemize{
35 | \item \code{...}: curl options passed on to \link[crul:verb-GET]{crul::verb-GET}
36 | }
37 | \item \code{route(endpt, query, include, error_handler, ...)}: Fetch a route,
38 | optional query parameters
39 | \itemize{
40 | \item \code{endpt}: The endpoint to request data from. required.
41 | \item \code{query}: a set of query parameters. combined with include
42 | parameter
43 | \item \code{include}: A comma-separated list of relationship paths.
44 | combined with query parameter
45 | \item \code{error_handler}: A function for error handling
46 | \item \code{...}: curl options passed on to \link[crul:verb-GET]{crul::verb-GET}
47 | }
48 | }
49 | }
50 | \examples{
51 | \dontrun{
52 | library("crul")
53 | (conn <- jsonapi_connect("http://localhost:8088"))
54 | conn$url
55 | conn$version
56 | conn$content_type
57 | conn$status()
58 | conn$routes()
59 | conn$routes(verbose = TRUE)
60 |
61 | # get data from speicific routes
62 | conn$route("authors")
63 | conn$route("chapters")
64 | conn$route("authors/1")
65 | conn$route("authors/1/books")
66 | conn$route("chapters/5")
67 | conn$route("chapters/5/book")
68 | conn$route("chapters/5/relationships/book")
69 |
70 | ## include
71 | conn$route("authors/1", include = "books")
72 | conn$route("authors/1", include = "photos")
73 | conn$route("authors/1", include = "photos.title")
74 |
75 | ## set curl options on jsonapi_connect() call
76 | xx <- jsonapi_connect("http://localhost:8088", verbose = TRUE)
77 | xx$opts
78 | xx$status()
79 |
80 | ## set headers on initializing the client
81 | (conn <- jsonapi_connect("http://localhost:8088", headers = list(foo = "bar")))
82 |
83 | ## errors
84 | ### route doesn't exist
85 | # conn$route("foobar")
86 |
87 | ### document doesn't exist
88 | # conn$route("authors/56")
89 | }
90 | }
91 |
--------------------------------------------------------------------------------
/inst/examples/authors_1_books.json:
--------------------------------------------------------------------------------
1 | {"data":[{"id":"1","type":"books","attributes":{"date_published":"1954-07-29","title":"The Fellowship of the Ring","created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"chapters":{"links":{"self":"/v1/authors/1/relationships/chapters","related":"/v1/authors/1/chapters"}},"firstChapter":{"links":{"self":"/v1/authors/1/relationships/firstChapter","related":"/v1/authors/1/firstChapter"}},"series":{"links":{"self":"/v1/authors/1/relationships/series","related":"/v1/authors/1/series"},"data":{"id":"1","type":"series"}},"author":{"links":{"self":"/v1/authors/1/relationships/author","related":"/v1/authors/1/author"},"data":{"id":"1","type":"authors"}},"stores":{"links":{"self":"/v1/authors/1/relationships/stores","related":"/v1/authors/1/stores"}},"photos":{"links":{"self":"/v1/authors/1/relationships/photos","related":"/v1/authors/1/photos"}}},"links":{"self":"/v1/authors/1"}},{"id":"2","type":"books","attributes":{"date_published":"1954-11-11","title":"The Two Towers","created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"chapters":{"links":{"self":"/v1/authors/2/relationships/chapters","related":"/v1/authors/2/chapters"}},"firstChapter":{"links":{"self":"/v1/authors/2/relationships/firstChapter","related":"/v1/authors/2/firstChapter"}},"series":{"links":{"self":"/v1/authors/2/relationships/series","related":"/v1/authors/2/series"},"data":{"id":"1","type":"series"}},"author":{"links":{"self":"/v1/authors/2/relationships/author","related":"/v1/authors/2/author"},"data":{"id":"1","type":"authors"}},"stores":{"links":{"self":"/v1/authors/2/relationships/stores","related":"/v1/authors/2/stores"}},"photos":{"links":{"self":"/v1/authors/2/relationships/photos","related":"/v1/authors/2/photos"}}},"links":{"self":"/v1/authors/2"}},{"id":"3","type":"books","attributes":{"date_published":"1955-10-20","title":"Return of the King","created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"chapters":{"links":{"self":"/v1/authors/3/relationships/chapters","related":"/v1/authors/3/chapters"}},"firstChapter":{"links":{"self":"/v1/authors/3/relationships/firstChapter","related":"/v1/authors/3/firstChapter"}},"series":{"links":{"self":"/v1/authors/3/relationships/series","related":"/v1/authors/3/series"},"data":{"id":"1","type":"series"}},"author":{"links":{"self":"/v1/authors/3/relationships/author","related":"/v1/authors/3/author"},"data":{"id":"1","type":"authors"}},"stores":{"links":{"self":"/v1/authors/3/relationships/stores","related":"/v1/authors/3/stores"}},"photos":{"links":{"self":"/v1/authors/3/relationships/photos","related":"/v1/authors/3/photos"}}},"links":{"self":"/v1/authors/3"}},{"id":"11","type":"books","attributes":{"date_published":"1937-09-21","title":"The Hobbit","created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"chapters":{"links":{"self":"/v1/authors/11/relationships/chapters","related":"/v1/authors/11/chapters"}},"firstChapter":{"links":{"self":"/v1/authors/11/relationships/firstChapter","related":"/v1/authors/11/firstChapter"}},"series":{"links":{"self":"/v1/authors/11/relationships/series","related":"/v1/authors/11/series"},"data":null},"author":{"links":{"self":"/v1/authors/11/relationships/author","related":"/v1/authors/11/author"},"data":{"id":"1","type":"authors"}},"stores":{"links":{"self":"/v1/authors/11/relationships/stores","related":"/v1/authors/11/stores"}},"photos":{"links":{"self":"/v1/authors/11/relationships/photos","related":"/v1/authors/11/photos"}}},"links":{"self":"/v1/authors/11"}}]}
2 |
--------------------------------------------------------------------------------
/inst/ignore/JsonAPIModel.R:
--------------------------------------------------------------------------------
1 | #' JSON API Model and Serializer
2 | #'
3 | #' @export
4 | #' @param ... named parameters
5 | #' @examples
6 | #' mod <- japi_model("id", "name", "year", "actor_ids",
7 | #' "owner_id", "movie_type_id")
8 | #' mod
9 | #'
10 | #' # assign values
11 | #' mod$id = 232
12 | #' mod$name = 'test movie'
13 | #' mod$actor_ids = 1:3
14 | #' mod$movie_type_id = 1
15 | #' mod
16 | #'
17 | #' # put into json api serializer
18 | #' x <- japi_serializer$new(
19 | #' model = mod,
20 | #' type = "movie",
21 | #' attributes = c('name', 'year'),
22 | #' has_many = "actors",
23 | #' belongs_to = "movie_type"
24 | #' )
25 | #' x$model
26 | #' x$attributes
27 | #' x$json_api_model
28 | #' x$serialized_json()
29 | #' x$serialized_json(pretty = TRUE)
30 | japi_model <- function(...) {
31 | nms <- list(...)
32 | model_names <- unlist(nms)
33 | args <- as.list(stats::setNames(rep(NA, length(nms)), model_names))
34 | args$model_names <- model_names
35 | R6::R6Class(
36 | "japi_model",
37 | portable = FALSE,
38 | lock_objects = TRUE,
39 | public = args
40 | )$new()
41 | }
42 |
43 | #' JSON API Serializer
44 | #'
45 | #' @export
46 | #' @param model an object of class `japi_model`
47 | #' @param type the type
48 | #' @param attributes attributes
49 | #' @param has_many variables that are many
50 | #' @param belongs_to belongs to type
51 | #' @format NULL
52 | #' @usage NULL
53 | #' @details see \code{\link{japi_model}} for examples
54 | japi_serializer <- R6::R6Class(
55 | "japi_serializer",
56 | public = list(
57 | model = NULL,
58 | type = NULL,
59 | attributes = NULL,
60 | has_many = NULL,
61 | belongs_to = NULL,
62 | json_api_model = NULL,
63 |
64 | initialize = function(model, type = NULL, attributes = NULL,
65 | has_many = NULL, belongs_to = NULL) {
66 |
67 | if (!inherits(model, "japi_model")) {
68 | stop("'model' must be of class 'japi_model'")
69 | }
70 | self$model <- model
71 | self$type <- type
72 | self$attributes <- attributes
73 | self$has_many <- has_many
74 | self$belongs_to <- belongs_to
75 |
76 | # build json api data model
77 | self$json_api_model <- list(
78 | data = list(
79 | id = self$model$id,
80 | type = self$type,
81 | attributes = stats::setNames(
82 | lapply(self$attributes, function(z) self$model[[z]]),
83 | self$attributes
84 | )
85 | )
86 | )
87 |
88 | if (!is.null(self$has_many)) {
89 | self$json_api_model$data$relationships <- list()
90 | sing <- hunspell::hunspell_stem(self$has_many)[[1]]
91 | toget <- grep(sing, self$model$model_names, value = TRUE)
92 | dat <- Map(function(z) list(id = z, type = sing), self$model[[toget]])
93 | self$json_api_model$data$relationships <-
94 | stats::setNames(list(list(data = dat)), self$has_many)
95 | }
96 | },
97 |
98 | serialized_json = function(...) {
99 | jsonlite::toJSON(self$json_api_model, ..., auto_unbox = TRUE)
100 | }
101 | )
102 | )
103 |
104 | # Rs <- R6::R6Class(
105 | # "Rs",
106 | # portable = FALSE,
107 | # lock_objects = FALSE,
108 | # public = list(
109 | # x = NULL,
110 | # initialize = function(...) {
111 | # args <- list(...)
112 | # self
113 | # },
114 | # getx = function() self$x,
115 | # setx = function(value) self$x <<- value
116 | # )
117 | # )
118 |
119 | # JsonAPIModel <- R6::R6Class(
120 | # "JsonAPIModel",
121 | # public = list(
122 | # x = NULL,
123 |
124 | # getx = function() self$x,
125 | # setx = function(value) self$x <<- value
126 | # )
127 | # )
128 |
--------------------------------------------------------------------------------
/README.Rmd:
--------------------------------------------------------------------------------
1 | rjsonapi
2 | ========
3 |
4 | ```{r echo=FALSE}
5 | knitr::opts_chunk$set(
6 | warning = FALSE,
7 | message = FALSE,
8 | collapse = TRUE,
9 | comment = "#>"
10 | )
11 | ```
12 |
13 | [](https://travis-ci.org/ropensci/rjsonapi)
14 | [](https://cranchecks.info/pkgs/rjsonapi)
15 | [](https://codecov.io/github/ropensci/rjsonapi?branch=master)
16 | [](https://cran.r-project.org/package=rjsonapi)
17 |
18 | An R client for consuming APIs that follow the [JSONAPI spec][spec]. This library
19 | does not do server side JSONAPI things.
20 |
21 | * rjsonapi home:
22 | * rjsonapi spec:
23 |
24 | ## Setup a JSONAPI
25 |
26 | * `git clone git@github.com:endpoints/endpoints-example.git` (or via `hub`: `hub clone endpoints/endpoints-example`)
27 | * `cd endpoints-example`
28 | * `npm install`
29 | * `PORT=8088 npm start` (start with port 8088 instead of 8080, can use a different port) - OR, `npm install forever`, then `PORT=8088 forever start -c "npm start" '.'`
30 |
31 | Which starts a server. Then point your browser to e.g.:
32 |
33 | * http://localhost:8088/v1
34 | * http://localhost:8088/v1/authors
35 | * http://localhost:8088/v1/authors/1
36 |
37 | ## Install rjsonapi R client
38 |
39 | Stabler version
40 |
41 | ```{r eval=FALSE}
42 | install.packages("rjsonapi")
43 | ```
44 |
45 | Dev version
46 |
47 | ```{r eval=FALSE}
48 | devtools::install_github("ropensci/rjsonapi")
49 | ```
50 |
51 | ```{r}
52 | library("rjsonapi")
53 | ```
54 |
55 | ## Connect
56 |
57 | ```{r}
58 | (conn <- jsonapi_connect("http://localhost:8088", "v1"))
59 | ```
60 |
61 | ## Get API info
62 |
63 | Get version
64 |
65 | ```{r}
66 | conn$version
67 | ```
68 |
69 | Get base URL
70 |
71 | ```{r}
72 | conn$base_url()
73 | ```
74 |
75 | Get server status
76 |
77 | ```{r}
78 | conn$status()
79 | ```
80 |
81 | Get routes (not available in a standard JSONAPI i think)
82 |
83 | ```{r}
84 | conn$routes()
85 | ```
86 |
87 | ## Call a route
88 |
89 | books route
90 |
91 | ```{r}
92 | conn$route("authors")
93 | ```
94 |
95 | ## Get a single document
96 |
97 | First authors document
98 |
99 | ```{r}
100 | conn$route("authors/1")
101 | ```
102 |
103 | Sub-part under that document: `books`
104 |
105 | ```{r}
106 | conn$route("authors/1/books")
107 | ```
108 |
109 | A different sub-part under that document: `photos`
110 |
111 | ```{r}
112 | conn$route("authors/1/photos")
113 | ```
114 |
115 | ## Experimental - startup a server from R
116 |
117 | In one R session:
118 |
119 | ```{r eval=FALSE}
120 | jsonapi_server()
121 | #> Starting server to listen on port 8000
122 | ```
123 |
124 | Then in another R session:
125 |
126 | Connect to the server:
127 |
128 | ```{r eval=FALSE}
129 | (conn <- jsonapi_connect("http://localhost:8000"))
130 | ```
131 |
132 | Get routes
133 |
134 | ```{r eval=FALSE}
135 | conn$routes()
136 | ```
137 |
138 | Get chapters
139 |
140 | ```{r eval=FALSE}
141 | conn$route("chapters")
142 | ```
143 |
144 | Note: This server stuff is still in infancy. Working on getting a more complete set
145 | of routes and data.
146 |
147 | Right now, `jsonapi_server()` only loads data that comes with this package - in the
148 | future it will support your own data.
149 |
150 | [spec]: http://jsonapi.org/format/
151 |
152 | ## Meta
153 |
154 | * Please [report any issues or bugs](https://github.com/ropensci/rjsonapi/issues).
155 | * License: MIT
156 | * Get citation information for `rjsonapi` in R doing `citation(package = 'rjsonapi')`
157 | * Please note that this project is released with a [Contributor Code of Conduct](CONDUCT.md). By participating in this project you agree to abide by its terms.
158 |
159 | [](https://ropensci.org)
160 |
--------------------------------------------------------------------------------
/codemeta.json:
--------------------------------------------------------------------------------
1 | {
2 | "@context": ["http://purl.org/codemeta/2.0", "http://schema.org"],
3 | "@type": "SoftwareSourceCode",
4 | "identifier": "rjsonapi",
5 | "description": "Consumer for APIs that Follow the JSON API Specification\n (). Package mostly consumes data - with experimental\n support for serving JSON API data.",
6 | "name": "rjsonapi: Consumer for APIs that Follow the JSON API Specification",
7 | "codeRepository": "https://github.com/ropensci/rjsonapi",
8 | "issueTracker": "https://github.com/ropensci/rjsonapi/issues",
9 | "license": "https://spdx.org/licenses/MIT",
10 | "version": "0.1.1.9210",
11 | "programmingLanguage": {
12 | "@type": "ComputerLanguage",
13 | "name": "R",
14 | "version": "3.4.3",
15 | "url": "https://r-project.org"
16 | },
17 | "runtimePlatform": "R version 3.4.3 Patched (2018-01-01 r74017)",
18 | "provider": {
19 | "@id": "https://cran.r-project.org",
20 | "@type": "Organization",
21 | "name": "Central R Archive Network (CRAN)",
22 | "url": "https://cran.r-project.org"
23 | },
24 | "author": [
25 | {
26 | "@type": "Person",
27 | "givenName": "Scott",
28 | "familyName": "Chamberlain",
29 | "email": "myrmecocystus@gmail.com"
30 | }
31 | ],
32 | "maintainer": {
33 | "@type": "Person",
34 | "givenName": "Scott",
35 | "familyName": "Chamberlain",
36 | "email": "myrmecocystus@gmail.com"
37 | },
38 | "softwareSuggestions": [
39 | {
40 | "@type": "SoftwareApplication",
41 | "identifier": "roxygen2",
42 | "name": "roxygen2",
43 | "version": "6.0.1",
44 | "provider": {
45 | "@id": "https://cran.r-project.org",
46 | "@type": "Organization",
47 | "name": "Central R Archive Network (CRAN)",
48 | "url": "https://cran.r-project.org"
49 | }
50 | },
51 | {
52 | "@type": "SoftwareApplication",
53 | "identifier": "testthat",
54 | "name": "testthat",
55 | "provider": {
56 | "@id": "https://cran.r-project.org",
57 | "@type": "Organization",
58 | "name": "Central R Archive Network (CRAN)",
59 | "url": "https://cran.r-project.org"
60 | }
61 | }
62 | ],
63 | "softwareRequirements": [
64 | {
65 | "@type": "SoftwareApplication",
66 | "identifier": "crul",
67 | "name": "crul",
68 | "version": "0.2.0",
69 | "provider": {
70 | "@id": "https://cran.r-project.org",
71 | "@type": "Organization",
72 | "name": "Central R Archive Network (CRAN)",
73 | "url": "https://cran.r-project.org"
74 | }
75 | },
76 | {
77 | "@type": "SoftwareApplication",
78 | "identifier": "R6",
79 | "name": "R6",
80 | "version": "2.2.0",
81 | "provider": {
82 | "@id": "https://cran.r-project.org",
83 | "@type": "Organization",
84 | "name": "Central R Archive Network (CRAN)",
85 | "url": "https://cran.r-project.org"
86 | }
87 | },
88 | {
89 | "@type": "SoftwareApplication",
90 | "identifier": "jsonlite",
91 | "name": "jsonlite",
92 | "version": "1.2",
93 | "provider": {
94 | "@id": "https://cran.r-project.org",
95 | "@type": "Organization",
96 | "name": "Central R Archive Network (CRAN)",
97 | "url": "https://cran.r-project.org"
98 | }
99 | },
100 | {
101 | "@type": "SoftwareApplication",
102 | "identifier": "plumber",
103 | "name": "plumber",
104 | "version": "0.3.1",
105 | "provider": {
106 | "@id": "https://cran.r-project.org",
107 | "@type": "Organization",
108 | "name": "Central R Archive Network (CRAN)",
109 | "url": "https://cran.r-project.org"
110 | }
111 | }
112 | ],
113 | "contIntegration": "https://travis-ci.org/ropensci/rjsonapi",
114 | "releaseNotes": "https://github.com/ropensci/rjsonapi/blob/master/NEWS.md",
115 | "readme": "https://github.com/ropensci/rjsonapi/blob/master/README.md",
116 | "fileSize": "19.88KB"
117 | }
118 |
--------------------------------------------------------------------------------
/R/connect.R:
--------------------------------------------------------------------------------
1 | #' Connection
2 | #'
3 | #' @export
4 | #' @param url (character) Base url, without the version information,
5 | #' e.g., `http://localhost:8088`
6 | #' @param version (character) API version. Default: `v1`
7 | #' @param content_type (character) the content type to set in all request
8 | #' headers. Default: 'application/vnd.api+json'
9 | #' @param headers (list) A list of headers to be applied to each requset.
10 | #' @param ... Curl options passed on to [crul::verb-GET]. You
11 | #' can set these for all requests, or on each request - see examples.
12 | #' @details
13 | #' **Methods**
14 | #'
15 | #' - `status(...)`: Check server status with a HEAD request
16 | #' - `...`: curl options passed on to [crul::verb-GET]
17 | #' - `routes(...)`: Get routes the server supports
18 | #' - `...`: curl options passed on to [crul::verb-GET]
19 | #' - `route(endpt, query, include, error_handler, ...)`: Fetch a route,
20 | #' optional query parameters
21 | #' - `endpt`: The endpoint to request data from. required.
22 | #' - `query`: a set of query parameters. combined with include
23 | #' parameter
24 | #' - `include`: A comma-separated list of relationship paths.
25 | #' combined with query parameter
26 | #' - `error_handler`: A function for error handling
27 | #' - `...`: curl options passed on to [crul::verb-GET]
28 | #'
29 | #' @examples \dontrun{
30 | #' library("crul")
31 | #' (conn <- jsonapi_connect("http://localhost:8088"))
32 | #' conn$url
33 | #' conn$version
34 | #' conn$content_type
35 | #' conn$status()
36 | #' conn$routes()
37 | #' conn$routes(verbose = TRUE)
38 | #'
39 | #' # get data from speicific routes
40 | #' conn$route("authors")
41 | #' conn$route("chapters")
42 | #' conn$route("authors/1")
43 | #' conn$route("authors/1/books")
44 | #' conn$route("chapters/5")
45 | #' conn$route("chapters/5/book")
46 | #' conn$route("chapters/5/relationships/book")
47 | #'
48 | #' ## include
49 | #' conn$route("authors/1", include = "books")
50 | #' conn$route("authors/1", include = "photos")
51 | #' conn$route("authors/1", include = "photos.title")
52 | #'
53 | #' ## set curl options on jsonapi_connect() call
54 | #' xx <- jsonapi_connect("http://localhost:8088", verbose = TRUE)
55 | #' xx$opts
56 | #' xx$status()
57 | #'
58 | #' ## set headers on initializing the client
59 | #' (conn <- jsonapi_connect("http://localhost:8088", headers = list(foo = "bar")))
60 | #'
61 | #' ## errors
62 | #' ### route doesn't exist
63 | #' # conn$route("foobar")
64 | #'
65 | #' ### document doesn't exist
66 | #' # conn$route("authors/56")
67 | #' }
68 | jsonapi_connect <- function(url, version, content_type, headers, ...) {
69 | .jsapi_c$new(url, version, content_type, headers, ...)
70 | }
71 |
72 | .jsapi_c <-
73 | R6::R6Class("jsonapi_connection",
74 | public = list(
75 | url = "http://localhost:8088",
76 | version = "v1",
77 | content_type = "application/vnd.api+json",
78 | opts = NULL,
79 | headers = NULL,
80 | cli = NULL,
81 |
82 | initialize = function(url, version, content_type, headers = list(),
83 | ...) {
84 |
85 | if (!missing(url)) self$url <- url
86 | self$cli <- crul::HttpClient$new(
87 | url = self$url,
88 | opts = list(...),
89 | headers = headers
90 | )
91 | self$opts <- self$cli$opts
92 | if (!missing(version)) self$version <- version
93 | if (!missing(content_type)) self$content_type <- content_type
94 | self$cli$headers <- c(
95 | self$cli$headers,
96 | list(`Content-Type` = self$content_type)
97 | )
98 | },
99 |
100 | status = function(...) {
101 | stat <- self$cli$head(self$version, ...)$status_http()
102 | sprintf("%s (%s)", stat$message, stat$status_code)
103 | },
104 |
105 | routes = function(...) {
106 | private$fromjson(
107 | self$cli$get(self$version, ...)$parse(encoding = "UTF-8"),
108 | "text", encoding = "UTF-8")
109 | },
110 |
111 | route = function(endpt, query = NULL, include = NULL,
112 | error_handler = private$check, ...) {
113 | query <- comp(c(query, list(include = include)))
114 | tmp <- self$cli$get(file.path(self$version, endpt), query = query, ...)
115 | error_handler(tmp)
116 | private$fromjson(tmp$parse(encoding = "UTF-8"))
117 | },
118 |
119 | base_url = function() self$url
120 | ),
121 |
122 | private = list(
123 | fromjson = function(...) jsonlite::fromJSON(...),
124 |
125 | check = function(x, ...) {
126 | if (x$status_code > 300) {
127 | if (grepl("application/vnd.api\\+json", x$response_headers$`content-type`)) {
128 | self$fromjson(x$parse(encoding = "UTF-8"))
129 | } else {
130 | stop(x$parse(encoding = "UTF-8"), call. = FALSE)
131 | }
132 | }
133 | }
134 | ),
135 |
136 | cloneable = FALSE
137 | )
138 |
--------------------------------------------------------------------------------
/inst/examples/authors_2_books.json:
--------------------------------------------------------------------------------
1 | {"data":[{"id":"4","type":"books","attributes":{"date_published":"1997-06-26","title":"Harry Potter and the Philosopher's Stone","created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"chapters":{"links":{"self":"/v1/authors/4/relationships/chapters","related":"/v1/authors/4/chapters"}},"firstChapter":{"links":{"self":"/v1/authors/4/relationships/firstChapter","related":"/v1/authors/4/firstChapter"}},"series":{"links":{"self":"/v1/authors/4/relationships/series","related":"/v1/authors/4/series"},"data":{"id":"2","type":"series"}},"author":{"links":{"self":"/v1/authors/4/relationships/author","related":"/v1/authors/4/author"},"data":{"id":"2","type":"authors"}},"stores":{"links":{"self":"/v1/authors/4/relationships/stores","related":"/v1/authors/4/stores"}},"photos":{"links":{"self":"/v1/authors/4/relationships/photos","related":"/v1/authors/4/photos"}}},"links":{"self":"/v1/authors/4"}},{"id":"5","type":"books","attributes":{"date_published":"1998-07-02","title":"Harry Potter and the Chamber of Secrets","created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"chapters":{"links":{"self":"/v1/authors/5/relationships/chapters","related":"/v1/authors/5/chapters"}},"firstChapter":{"links":{"self":"/v1/authors/5/relationships/firstChapter","related":"/v1/authors/5/firstChapter"}},"series":{"links":{"self":"/v1/authors/5/relationships/series","related":"/v1/authors/5/series"},"data":{"id":"2","type":"series"}},"author":{"links":{"self":"/v1/authors/5/relationships/author","related":"/v1/authors/5/author"},"data":{"id":"2","type":"authors"}},"stores":{"links":{"self":"/v1/authors/5/relationships/stores","related":"/v1/authors/5/stores"}},"photos":{"links":{"self":"/v1/authors/5/relationships/photos","related":"/v1/authors/5/photos"}}},"links":{"self":"/v1/authors/5"}},{"id":"6","type":"books","attributes":{"date_published":"1999-07-08","title":"Harry Potter and the Prisoner of Azkaban","created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"chapters":{"links":{"self":"/v1/authors/6/relationships/chapters","related":"/v1/authors/6/chapters"}},"firstChapter":{"links":{"self":"/v1/authors/6/relationships/firstChapter","related":"/v1/authors/6/firstChapter"}},"series":{"links":{"self":"/v1/authors/6/relationships/series","related":"/v1/authors/6/series"},"data":{"id":"2","type":"series"}},"author":{"links":{"self":"/v1/authors/6/relationships/author","related":"/v1/authors/6/author"},"data":{"id":"2","type":"authors"}},"stores":{"links":{"self":"/v1/authors/6/relationships/stores","related":"/v1/authors/6/stores"}},"photos":{"links":{"self":"/v1/authors/6/relationships/photos","related":"/v1/authors/6/photos"}}},"links":{"self":"/v1/authors/6"}},{"id":"7","type":"books","attributes":{"date_published":"2000-07-08","title":"Harry Potter and the Goblet of Fire","created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"chapters":{"links":{"self":"/v1/authors/7/relationships/chapters","related":"/v1/authors/7/chapters"}},"firstChapter":{"links":{"self":"/v1/authors/7/relationships/firstChapter","related":"/v1/authors/7/firstChapter"}},"series":{"links":{"self":"/v1/authors/7/relationships/series","related":"/v1/authors/7/series"},"data":{"id":"2","type":"series"}},"author":{"links":{"self":"/v1/authors/7/relationships/author","related":"/v1/authors/7/author"},"data":{"id":"2","type":"authors"}},"stores":{"links":{"self":"/v1/authors/7/relationships/stores","related":"/v1/authors/7/stores"}},"photos":{"links":{"self":"/v1/authors/7/relationships/photos","related":"/v1/authors/7/photos"}}},"links":{"self":"/v1/authors/7"}},{"id":"8","type":"books","attributes":{"date_published":"2003-06-21","title":"Harry Potter and the Order of the Phoenix","created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"chapters":{"links":{"self":"/v1/authors/8/relationships/chapters","related":"/v1/authors/8/chapters"}},"firstChapter":{"links":{"self":"/v1/authors/8/relationships/firstChapter","related":"/v1/authors/8/firstChapter"}},"series":{"links":{"self":"/v1/authors/8/relationships/series","related":"/v1/authors/8/series"},"data":{"id":"2","type":"series"}},"author":{"links":{"self":"/v1/authors/8/relationships/author","related":"/v1/authors/8/author"},"data":{"id":"2","type":"authors"}},"stores":{"links":{"self":"/v1/authors/8/relationships/stores","related":"/v1/authors/8/stores"}},"photos":{"links":{"self":"/v1/authors/8/relationships/photos","related":"/v1/authors/8/photos"}}},"links":{"self":"/v1/authors/8"}},{"id":"9","type":"books","attributes":{"date_published":"2005-07-16","title":"Harry Potter and the Half-Blood Prince","created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"chapters":{"links":{"self":"/v1/authors/9/relationships/chapters","related":"/v1/authors/9/chapters"}},"firstChapter":{"links":{"self":"/v1/authors/9/relationships/firstChapter","related":"/v1/authors/9/firstChapter"}},"series":{"links":{"self":"/v1/authors/9/relationships/series","related":"/v1/authors/9/series"},"data":{"id":"2","type":"series"}},"author":{"links":{"self":"/v1/authors/9/relationships/author","related":"/v1/authors/9/author"},"data":{"id":"2","type":"authors"}},"stores":{"links":{"self":"/v1/authors/9/relationships/stores","related":"/v1/authors/9/stores"}},"photos":{"links":{"self":"/v1/authors/9/relationships/photos","related":"/v1/authors/9/photos"}}},"links":{"self":"/v1/authors/9"}},{"id":"10","type":"books","attributes":{"date_published":"2007-07-21","title":"Harry Potter and the Deathly Hallows","created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"chapters":{"links":{"self":"/v1/authors/10/relationships/chapters","related":"/v1/authors/10/chapters"}},"firstChapter":{"links":{"self":"/v1/authors/10/relationships/firstChapter","related":"/v1/authors/10/firstChapter"}},"series":{"links":{"self":"/v1/authors/10/relationships/series","related":"/v1/authors/10/series"},"data":{"id":"2","type":"series"}},"author":{"links":{"self":"/v1/authors/10/relationships/author","related":"/v1/authors/10/author"},"data":{"id":"2","type":"authors"}},"stores":{"links":{"self":"/v1/authors/10/relationships/stores","related":"/v1/authors/10/stores"}},"photos":{"links":{"self":"/v1/authors/10/relationships/photos","related":"/v1/authors/10/photos"}}},"links":{"self":"/v1/authors/10"}}]}
2 |
--------------------------------------------------------------------------------
/inst/examples/photos.json:
--------------------------------------------------------------------------------
1 | {"data":[{"id":"1","type":"photos","attributes":{"imageable_id":1,"imageable_type":"authors","title":"J. R. R. Tolkein","uri":"http://upload.wikimedia.org/wikipedia/commons/b/b4/Tolkien_1916.jpg","created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"imageable":{"links":{"self":"/v1/photos/1/relationships/imageable","related":"/v1/photos/1/imageable"}}},"links":{"self":"/v1/photos/1"}},{"id":"2","type":"photos","attributes":{"imageable_id":1,"imageable_type":"authors","title":"Family Postcard of J. R. R. Tolkein","uri":"http://upload.wikimedia.org/wikipedia/commons/5/5b/Mabel_Suffield_Christmas_Card.jpg","created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"imageable":{"links":{"self":"/v1/photos/2/relationships/imageable","related":"/v1/photos/2/imageable"}}},"links":{"self":"/v1/photos/2"}},{"id":"3","type":"photos","attributes":{"imageable_id":2,"imageable_type":"authors","title":"J. K. Rowling","uri":"http://upload.wikimedia.org/wikipedia/commons/5/5d/J._K._Rowling_2010.jpg","created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"imageable":{"links":{"self":"/v1/photos/3/relationships/imageable","related":"/v1/photos/3/imageable"}}},"links":{"self":"/v1/photos/3"}},{"id":"4","type":"photos","attributes":{"imageable_id":2,"imageable_type":"authors","title":"J. K. Rowling's Childhood Home","uri":"http://upload.wikimedia.org/wikipedia/commons/e/e7/Church_Cottage%2C_Tutshill.jpg","created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"imageable":{"links":{"self":"/v1/photos/4/relationships/imageable","related":"/v1/photos/4/imageable"}}},"links":{"self":"/v1/photos/4"}},{"id":"5","type":"photos","attributes":{"imageable_id":1,"imageable_type":"books","title":"The Fellowship of the Ring","uri":"http://upload.wikimedia.org/wikipedia/en/7/7e/FellowshipOfTheRing.JPG","created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"imageable":{"links":{"self":"/v1/photos/5/relationships/imageable","related":"/v1/photos/5/imageable"}}},"links":{"self":"/v1/photos/5"}},{"id":"6","type":"photos","attributes":{"imageable_id":2,"imageable_type":"books","title":"The Two Towers","uri":"http://upload.wikimedia.org/wikipedia/en/2/2f/The_Two_Towers_%28novel%29_-1st_edition_cover.JPG","created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"imageable":{"links":{"self":"/v1/photos/6/relationships/imageable","related":"/v1/photos/6/imageable"}}},"links":{"self":"/v1/photos/6"}},{"id":"7","type":"photos","attributes":{"imageable_id":3,"imageable_type":"books","title":"Return of the King","uri":"http://upload.wikimedia.org/wikipedia/en/8/89/ReturnOfTheKing.JPG","created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"imageable":{"links":{"self":"/v1/photos/7/relationships/imageable","related":"/v1/photos/7/imageable"}}},"links":{"self":"/v1/photos/7"}},{"id":"8","type":"photos","attributes":{"imageable_id":4,"imageable_type":"books","title":"Harry Potter and the Philosopher's Stone","uri":"http://upload.wikimedia.org/wikipedia/en/6/6b/Harry_Potter_and_the_Philosopher%27s_Stone_Book_Cover.jpg","created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"imageable":{"links":{"self":"/v1/photos/8/relationships/imageable","related":"/v1/photos/8/imageable"}}},"links":{"self":"/v1/photos/8"}},{"id":"9","type":"photos","attributes":{"imageable_id":5,"imageable_type":"books","title":"Harry Potter and the Chamber of Secrets","uri":"http://upload.wikimedia.org/wikipedia/en/5/5c/Harry_Potter_and_the_Chamber_of_Secrets.jpg","created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"imageable":{"links":{"self":"/v1/photos/9/relationships/imageable","related":"/v1/photos/9/imageable"}}},"links":{"self":"/v1/photos/9"}},{"id":"10","type":"photos","attributes":{"imageable_id":6,"imageable_type":"books","title":"Harry Potter and the Prisoner of Azkaban","uri":"http://upload.wikimedia.org/wikipedia/en/a/a0/Harry_Potter_and_the_Prisoner_of_Azkaban.jpg","created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"imageable":{"links":{"self":"/v1/photos/10/relationships/imageable","related":"/v1/photos/10/imageable"}}},"links":{"self":"/v1/photos/10"}},{"id":"11","type":"photos","attributes":{"imageable_id":7,"imageable_type":"books","title":"Harry Potter and the Goblet of Fire","uri":"http://upload.wikimedia.org/wikipedia/en/c/c7/Harry_Potter_and_the_Goblet_of_Fire.jpg","created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"imageable":{"links":{"self":"/v1/photos/11/relationships/imageable","related":"/v1/photos/11/imageable"}}},"links":{"self":"/v1/photos/11"}},{"id":"12","type":"photos","attributes":{"imageable_id":8,"imageable_type":"books","title":"Harry Potter and the Order of the Phoenix","uri":"http://upload.wikimedia.org/wikipedia/en/7/70/Harry_Potter_and_the_Order_of_the_Phoenix.jpg","created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"imageable":{"links":{"self":"/v1/photos/12/relationships/imageable","related":"/v1/photos/12/imageable"}}},"links":{"self":"/v1/photos/12"}},{"id":"13","type":"photos","attributes":{"imageable_id":9,"imageable_type":"books","title":"Harry Potter and the Half-Blood Prince","uri":"http://upload.wikimedia.org/wikipedia/en/f/f0/Harry_Potter_and_the_Half-Blood_Prince.jpg","created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"imageable":{"links":{"self":"/v1/photos/13/relationships/imageable","related":"/v1/photos/13/imageable"}}},"links":{"self":"/v1/photos/13"}},{"id":"14","type":"photos","attributes":{"imageable_id":10,"imageable_type":"books","title":"Harry Potter and the Deathly Hallows","uri":"http://upload.wikimedia.org/wikipedia/en/a/a9/Harry_Potter_and_the_Deathly_Hallows.jpg","created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"imageable":{"links":{"self":"/v1/photos/14/relationships/imageable","related":"/v1/photos/14/imageable"}}},"links":{"self":"/v1/photos/14"}},{"id":"15","type":"photos","attributes":{"imageable_id":11,"imageable_type":"books","title":"The Hobbit","uri":"http://upload.wikimedia.org/wikipedia/en/4/4a/TheHobbit_FirstEdition.jpg","created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"imageable":{"links":{"self":"/v1/photos/15/relationships/imageable","related":"/v1/photos/15/imageable"}}},"links":{"self":"/v1/photos/15"}},{"id":"16","type":"photos","attributes":{"imageable_id":1,"imageable_type":"series","title":"Lord of the Rings","uri":"http://img2.wikia.nocookie.net/__cb20130619012726/lotr/images/1/11/The_Lord_of_the_Rings_First_Copies.jpg","created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"imageable":{"links":{"self":"/v1/photos/16/relationships/imageable","related":"/v1/photos/16/imageable"}}},"links":{"self":"/v1/photos/16"}},{"id":"17","type":"photos","attributes":{"imageable_id":2,"imageable_type":"series","title":"Harry Potter","uri":"http://upload.wikimedia.org/wikipedia/commons/6/6e/Harry_Potter_wordmark.svg","created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"imageable":{"links":{"self":"/v1/photos/17/relationships/imageable","related":"/v1/photos/17/imageable"}}},"links":{"self":"/v1/photos/17"}}]}
2 |
--------------------------------------------------------------------------------
/inst/examples/books.json:
--------------------------------------------------------------------------------
1 | {"data":[{"id":"1","type":"books","attributes":{"date_published":"1954-07-29","title":"The Fellowship of the Ring","created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"chapters":{"links":{"self":"/v1/books/1/relationships/chapters","related":"/v1/books/1/chapters"}},"firstChapter":{"links":{"self":"/v1/books/1/relationships/firstChapter","related":"/v1/books/1/firstChapter"}},"series":{"links":{"self":"/v1/books/1/relationships/series","related":"/v1/books/1/series"},"data":{"id":"1","type":"series"}},"author":{"links":{"self":"/v1/books/1/relationships/author","related":"/v1/books/1/author"},"data":{"id":"1","type":"authors"}},"stores":{"links":{"self":"/v1/books/1/relationships/stores","related":"/v1/books/1/stores"}},"photos":{"links":{"self":"/v1/books/1/relationships/photos","related":"/v1/books/1/photos"}}},"links":{"self":"/v1/books/1"}},{"id":"2","type":"books","attributes":{"date_published":"1954-11-11","title":"The Two Towers","created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"chapters":{"links":{"self":"/v1/books/2/relationships/chapters","related":"/v1/books/2/chapters"}},"firstChapter":{"links":{"self":"/v1/books/2/relationships/firstChapter","related":"/v1/books/2/firstChapter"}},"series":{"links":{"self":"/v1/books/2/relationships/series","related":"/v1/books/2/series"},"data":{"id":"1","type":"series"}},"author":{"links":{"self":"/v1/books/2/relationships/author","related":"/v1/books/2/author"},"data":{"id":"1","type":"authors"}},"stores":{"links":{"self":"/v1/books/2/relationships/stores","related":"/v1/books/2/stores"}},"photos":{"links":{"self":"/v1/books/2/relationships/photos","related":"/v1/books/2/photos"}}},"links":{"self":"/v1/books/2"}},{"id":"3","type":"books","attributes":{"date_published":"1955-10-20","title":"Return of the King","created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"chapters":{"links":{"self":"/v1/books/3/relationships/chapters","related":"/v1/books/3/chapters"}},"firstChapter":{"links":{"self":"/v1/books/3/relationships/firstChapter","related":"/v1/books/3/firstChapter"}},"series":{"links":{"self":"/v1/books/3/relationships/series","related":"/v1/books/3/series"},"data":{"id":"1","type":"series"}},"author":{"links":{"self":"/v1/books/3/relationships/author","related":"/v1/books/3/author"},"data":{"id":"1","type":"authors"}},"stores":{"links":{"self":"/v1/books/3/relationships/stores","related":"/v1/books/3/stores"}},"photos":{"links":{"self":"/v1/books/3/relationships/photos","related":"/v1/books/3/photos"}}},"links":{"self":"/v1/books/3"}},{"id":"4","type":"books","attributes":{"date_published":"1997-06-26","title":"Harry Potter and the Philosopher's Stone","created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"chapters":{"links":{"self":"/v1/books/4/relationships/chapters","related":"/v1/books/4/chapters"}},"firstChapter":{"links":{"self":"/v1/books/4/relationships/firstChapter","related":"/v1/books/4/firstChapter"}},"series":{"links":{"self":"/v1/books/4/relationships/series","related":"/v1/books/4/series"},"data":{"id":"2","type":"series"}},"author":{"links":{"self":"/v1/books/4/relationships/author","related":"/v1/books/4/author"},"data":{"id":"2","type":"authors"}},"stores":{"links":{"self":"/v1/books/4/relationships/stores","related":"/v1/books/4/stores"}},"photos":{"links":{"self":"/v1/books/4/relationships/photos","related":"/v1/books/4/photos"}}},"links":{"self":"/v1/books/4"}},{"id":"5","type":"books","attributes":{"date_published":"1998-07-02","title":"Harry Potter and the Chamber of Secrets","created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"chapters":{"links":{"self":"/v1/books/5/relationships/chapters","related":"/v1/books/5/chapters"}},"firstChapter":{"links":{"self":"/v1/books/5/relationships/firstChapter","related":"/v1/books/5/firstChapter"}},"series":{"links":{"self":"/v1/books/5/relationships/series","related":"/v1/books/5/series"},"data":{"id":"2","type":"series"}},"author":{"links":{"self":"/v1/books/5/relationships/author","related":"/v1/books/5/author"},"data":{"id":"2","type":"authors"}},"stores":{"links":{"self":"/v1/books/5/relationships/stores","related":"/v1/books/5/stores"}},"photos":{"links":{"self":"/v1/books/5/relationships/photos","related":"/v1/books/5/photos"}}},"links":{"self":"/v1/books/5"}},{"id":"6","type":"books","attributes":{"date_published":"1999-07-08","title":"Harry Potter and the Prisoner of Azkaban","created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"chapters":{"links":{"self":"/v1/books/6/relationships/chapters","related":"/v1/books/6/chapters"}},"firstChapter":{"links":{"self":"/v1/books/6/relationships/firstChapter","related":"/v1/books/6/firstChapter"}},"series":{"links":{"self":"/v1/books/6/relationships/series","related":"/v1/books/6/series"},"data":{"id":"2","type":"series"}},"author":{"links":{"self":"/v1/books/6/relationships/author","related":"/v1/books/6/author"},"data":{"id":"2","type":"authors"}},"stores":{"links":{"self":"/v1/books/6/relationships/stores","related":"/v1/books/6/stores"}},"photos":{"links":{"self":"/v1/books/6/relationships/photos","related":"/v1/books/6/photos"}}},"links":{"self":"/v1/books/6"}},{"id":"7","type":"books","attributes":{"date_published":"2000-07-08","title":"Harry Potter and the Goblet of Fire","created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"chapters":{"links":{"self":"/v1/books/7/relationships/chapters","related":"/v1/books/7/chapters"}},"firstChapter":{"links":{"self":"/v1/books/7/relationships/firstChapter","related":"/v1/books/7/firstChapter"}},"series":{"links":{"self":"/v1/books/7/relationships/series","related":"/v1/books/7/series"},"data":{"id":"2","type":"series"}},"author":{"links":{"self":"/v1/books/7/relationships/author","related":"/v1/books/7/author"},"data":{"id":"2","type":"authors"}},"stores":{"links":{"self":"/v1/books/7/relationships/stores","related":"/v1/books/7/stores"}},"photos":{"links":{"self":"/v1/books/7/relationships/photos","related":"/v1/books/7/photos"}}},"links":{"self":"/v1/books/7"}},{"id":"8","type":"books","attributes":{"date_published":"2003-06-21","title":"Harry Potter and the Order of the Phoenix","created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"chapters":{"links":{"self":"/v1/books/8/relationships/chapters","related":"/v1/books/8/chapters"}},"firstChapter":{"links":{"self":"/v1/books/8/relationships/firstChapter","related":"/v1/books/8/firstChapter"}},"series":{"links":{"self":"/v1/books/8/relationships/series","related":"/v1/books/8/series"},"data":{"id":"2","type":"series"}},"author":{"links":{"self":"/v1/books/8/relationships/author","related":"/v1/books/8/author"},"data":{"id":"2","type":"authors"}},"stores":{"links":{"self":"/v1/books/8/relationships/stores","related":"/v1/books/8/stores"}},"photos":{"links":{"self":"/v1/books/8/relationships/photos","related":"/v1/books/8/photos"}}},"links":{"self":"/v1/books/8"}},{"id":"9","type":"books","attributes":{"date_published":"2005-07-16","title":"Harry Potter and the Half-Blood Prince","created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"chapters":{"links":{"self":"/v1/books/9/relationships/chapters","related":"/v1/books/9/chapters"}},"firstChapter":{"links":{"self":"/v1/books/9/relationships/firstChapter","related":"/v1/books/9/firstChapter"}},"series":{"links":{"self":"/v1/books/9/relationships/series","related":"/v1/books/9/series"},"data":{"id":"2","type":"series"}},"author":{"links":{"self":"/v1/books/9/relationships/author","related":"/v1/books/9/author"},"data":{"id":"2","type":"authors"}},"stores":{"links":{"self":"/v1/books/9/relationships/stores","related":"/v1/books/9/stores"}},"photos":{"links":{"self":"/v1/books/9/relationships/photos","related":"/v1/books/9/photos"}}},"links":{"self":"/v1/books/9"}},{"id":"10","type":"books","attributes":{"date_published":"2007-07-21","title":"Harry Potter and the Deathly Hallows","created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"chapters":{"links":{"self":"/v1/books/10/relationships/chapters","related":"/v1/books/10/chapters"}},"firstChapter":{"links":{"self":"/v1/books/10/relationships/firstChapter","related":"/v1/books/10/firstChapter"}},"series":{"links":{"self":"/v1/books/10/relationships/series","related":"/v1/books/10/series"},"data":{"id":"2","type":"series"}},"author":{"links":{"self":"/v1/books/10/relationships/author","related":"/v1/books/10/author"},"data":{"id":"2","type":"authors"}},"stores":{"links":{"self":"/v1/books/10/relationships/stores","related":"/v1/books/10/stores"}},"photos":{"links":{"self":"/v1/books/10/relationships/photos","related":"/v1/books/10/photos"}}},"links":{"self":"/v1/books/10"}},{"id":"11","type":"books","attributes":{"date_published":"1937-09-21","title":"The Hobbit","created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"chapters":{"links":{"self":"/v1/books/11/relationships/chapters","related":"/v1/books/11/chapters"}},"firstChapter":{"links":{"self":"/v1/books/11/relationships/firstChapter","related":"/v1/books/11/firstChapter"}},"series":{"links":{"self":"/v1/books/11/relationships/series","related":"/v1/books/11/series"},"data":null},"author":{"links":{"self":"/v1/books/11/relationships/author","related":"/v1/books/11/author"},"data":{"id":"1","type":"authors"}},"stores":{"links":{"self":"/v1/books/11/relationships/stores","related":"/v1/books/11/stores"}},"photos":{"links":{"self":"/v1/books/11/relationships/photos","related":"/v1/books/11/photos"}}},"links":{"self":"/v1/books/11"}}]}
2 |
--------------------------------------------------------------------------------
/inst/examples/chapters.json:
--------------------------------------------------------------------------------
1 | {"data":[{"id":"1","type":"chapters","attributes":{"title":"A Long-expected Party","ordering":1,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/1/relationships/book","related":"/v1/chapters/1/book"},"data":{"id":"1","type":"books"}}},"links":{"self":"/v1/chapters/1"}},{"id":"2","type":"chapters","attributes":{"title":"The Shadow of the Past","ordering":2,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/2/relationships/book","related":"/v1/chapters/2/book"},"data":{"id":"1","type":"books"}}},"links":{"self":"/v1/chapters/2"}},{"id":"3","type":"chapters","attributes":{"title":"Three is Company","ordering":3,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/3/relationships/book","related":"/v1/chapters/3/book"},"data":{"id":"1","type":"books"}}},"links":{"self":"/v1/chapters/3"}},{"id":"4","type":"chapters","attributes":{"title":"A Short Cut to Mushrooms","ordering":4,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/4/relationships/book","related":"/v1/chapters/4/book"},"data":{"id":"1","type":"books"}}},"links":{"self":"/v1/chapters/4"}},{"id":"5","type":"chapters","attributes":{"title":"A Conspiracy Unmasked","ordering":5,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/5/relationships/book","related":"/v1/chapters/5/book"},"data":{"id":"1","type":"books"}}},"links":{"self":"/v1/chapters/5"}},{"id":"6","type":"chapters","attributes":{"title":"The Old Forest","ordering":6,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/6/relationships/book","related":"/v1/chapters/6/book"},"data":{"id":"1","type":"books"}}},"links":{"self":"/v1/chapters/6"}},{"id":"7","type":"chapters","attributes":{"title":"In the House of Tom Bombadil","ordering":7,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/7/relationships/book","related":"/v1/chapters/7/book"},"data":{"id":"1","type":"books"}}},"links":{"self":"/v1/chapters/7"}},{"id":"8","type":"chapters","attributes":{"title":"Fog on the Barrow-downs","ordering":8,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/8/relationships/book","related":"/v1/chapters/8/book"},"data":{"id":"1","type":"books"}}},"links":{"self":"/v1/chapters/8"}},{"id":"9","type":"chapters","attributes":{"title":"At the Sign of the Prancing Pony","ordering":9,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/9/relationships/book","related":"/v1/chapters/9/book"},"data":{"id":"1","type":"books"}}},"links":{"self":"/v1/chapters/9"}},{"id":"10","type":"chapters","attributes":{"title":"Strider","ordering":10,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/10/relationships/book","related":"/v1/chapters/10/book"},"data":{"id":"1","type":"books"}}},"links":{"self":"/v1/chapters/10"}},{"id":"11","type":"chapters","attributes":{"title":"A Knife in the Dark","ordering":11,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/11/relationships/book","related":"/v1/chapters/11/book"},"data":{"id":"1","type":"books"}}},"links":{"self":"/v1/chapters/11"}},{"id":"12","type":"chapters","attributes":{"title":"Flight to the Ford","ordering":12,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/12/relationships/book","related":"/v1/chapters/12/book"},"data":{"id":"1","type":"books"}}},"links":{"self":"/v1/chapters/12"}},{"id":"13","type":"chapters","attributes":{"title":"Many Meetings","ordering":13,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/13/relationships/book","related":"/v1/chapters/13/book"},"data":{"id":"1","type":"books"}}},"links":{"self":"/v1/chapters/13"}},{"id":"14","type":"chapters","attributes":{"title":"The Council of Elrond","ordering":14,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/14/relationships/book","related":"/v1/chapters/14/book"},"data":{"id":"1","type":"books"}}},"links":{"self":"/v1/chapters/14"}},{"id":"15","type":"chapters","attributes":{"title":"The Ring goes South","ordering":15,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/15/relationships/book","related":"/v1/chapters/15/book"},"data":{"id":"1","type":"books"}}},"links":{"self":"/v1/chapters/15"}},{"id":"16","type":"chapters","attributes":{"title":"A Journey in the Dark","ordering":16,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/16/relationships/book","related":"/v1/chapters/16/book"},"data":{"id":"1","type":"books"}}},"links":{"self":"/v1/chapters/16"}},{"id":"17","type":"chapters","attributes":{"title":"The Bridge of Khazad-dûm","ordering":17,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/17/relationships/book","related":"/v1/chapters/17/book"},"data":{"id":"1","type":"books"}}},"links":{"self":"/v1/chapters/17"}},{"id":"18","type":"chapters","attributes":{"title":"Lothlórien","ordering":18,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/18/relationships/book","related":"/v1/chapters/18/book"},"data":{"id":"1","type":"books"}}},"links":{"self":"/v1/chapters/18"}},{"id":"19","type":"chapters","attributes":{"title":"The Mirror of Galadriel","ordering":19,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/19/relationships/book","related":"/v1/chapters/19/book"},"data":{"id":"1","type":"books"}}},"links":{"self":"/v1/chapters/19"}},{"id":"20","type":"chapters","attributes":{"title":"Farewell to Lórien","ordering":20,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/20/relationships/book","related":"/v1/chapters/20/book"},"data":{"id":"1","type":"books"}}},"links":{"self":"/v1/chapters/20"}},{"id":"21","type":"chapters","attributes":{"title":"The Great River","ordering":21,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/21/relationships/book","related":"/v1/chapters/21/book"},"data":{"id":"1","type":"books"}}},"links":{"self":"/v1/chapters/21"}},{"id":"22","type":"chapters","attributes":{"title":"The Breaking of the Fellowship","ordering":22,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/22/relationships/book","related":"/v1/chapters/22/book"},"data":{"id":"1","type":"books"}}},"links":{"self":"/v1/chapters/22"}},{"id":"23","type":"chapters","attributes":{"title":"The Departure of Boromir","ordering":1,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/23/relationships/book","related":"/v1/chapters/23/book"},"data":{"id":"2","type":"books"}}},"links":{"self":"/v1/chapters/23"}},{"id":"24","type":"chapters","attributes":{"title":"The Riders of Rohan","ordering":2,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/24/relationships/book","related":"/v1/chapters/24/book"},"data":{"id":"2","type":"books"}}},"links":{"self":"/v1/chapters/24"}},{"id":"25","type":"chapters","attributes":{"title":"The Uruk-hai","ordering":3,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/25/relationships/book","related":"/v1/chapters/25/book"},"data":{"id":"2","type":"books"}}},"links":{"self":"/v1/chapters/25"}},{"id":"26","type":"chapters","attributes":{"title":"Treebeard","ordering":4,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/26/relationships/book","related":"/v1/chapters/26/book"},"data":{"id":"2","type":"books"}}},"links":{"self":"/v1/chapters/26"}},{"id":"27","type":"chapters","attributes":{"title":"The White Rider","ordering":5,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/27/relationships/book","related":"/v1/chapters/27/book"},"data":{"id":"2","type":"books"}}},"links":{"self":"/v1/chapters/27"}},{"id":"28","type":"chapters","attributes":{"title":"The King of the Golden Hall","ordering":6,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/28/relationships/book","related":"/v1/chapters/28/book"},"data":{"id":"2","type":"books"}}},"links":{"self":"/v1/chapters/28"}},{"id":"29","type":"chapters","attributes":{"title":"Helm's Deep","ordering":7,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/29/relationships/book","related":"/v1/chapters/29/book"},"data":{"id":"2","type":"books"}}},"links":{"self":"/v1/chapters/29"}},{"id":"30","type":"chapters","attributes":{"title":"The Road to Isengard","ordering":8,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/30/relationships/book","related":"/v1/chapters/30/book"},"data":{"id":"2","type":"books"}}},"links":{"self":"/v1/chapters/30"}},{"id":"31","type":"chapters","attributes":{"title":"Flotsam and Jetsam","ordering":9,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/31/relationships/book","related":"/v1/chapters/31/book"},"data":{"id":"2","type":"books"}}},"links":{"self":"/v1/chapters/31"}},{"id":"32","type":"chapters","attributes":{"title":"The Voice of Saruman","ordering":10,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/32/relationships/book","related":"/v1/chapters/32/book"},"data":{"id":"2","type":"books"}}},"links":{"self":"/v1/chapters/32"}},{"id":"33","type":"chapters","attributes":{"title":"The Palantír","ordering":11,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/33/relationships/book","related":"/v1/chapters/33/book"},"data":{"id":"2","type":"books"}}},"links":{"self":"/v1/chapters/33"}},{"id":"34","type":"chapters","attributes":{"title":"The Taming of Smeagol","ordering":12,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/34/relationships/book","related":"/v1/chapters/34/book"},"data":{"id":"2","type":"books"}}},"links":{"self":"/v1/chapters/34"}},{"id":"35","type":"chapters","attributes":{"title":"The Passage of the Marshes","ordering":13,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/35/relationships/book","related":"/v1/chapters/35/book"},"data":{"id":"2","type":"books"}}},"links":{"self":"/v1/chapters/35"}},{"id":"36","type":"chapters","attributes":{"title":"The Black Gate is Closed","ordering":14,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/36/relationships/book","related":"/v1/chapters/36/book"},"data":{"id":"2","type":"books"}}},"links":{"self":"/v1/chapters/36"}},{"id":"37","type":"chapters","attributes":{"title":"Of Herbs and Stewed Rabbit","ordering":15,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/37/relationships/book","related":"/v1/chapters/37/book"},"data":{"id":"2","type":"books"}}},"links":{"self":"/v1/chapters/37"}},{"id":"38","type":"chapters","attributes":{"title":"The Window on the West","ordering":16,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/38/relationships/book","related":"/v1/chapters/38/book"},"data":{"id":"2","type":"books"}}},"links":{"self":"/v1/chapters/38"}},{"id":"39","type":"chapters","attributes":{"title":"The Forbidden Pool","ordering":17,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/39/relationships/book","related":"/v1/chapters/39/book"},"data":{"id":"2","type":"books"}}},"links":{"self":"/v1/chapters/39"}},{"id":"40","type":"chapters","attributes":{"title":"Journey to the Cross-roads","ordering":18,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/40/relationships/book","related":"/v1/chapters/40/book"},"data":{"id":"2","type":"books"}}},"links":{"self":"/v1/chapters/40"}},{"id":"41","type":"chapters","attributes":{"title":"The Stairs of Cirith Ungol","ordering":19,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/41/relationships/book","related":"/v1/chapters/41/book"},"data":{"id":"2","type":"books"}}},"links":{"self":"/v1/chapters/41"}},{"id":"42","type":"chapters","attributes":{"title":"Shelob's Lair","ordering":20,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/42/relationships/book","related":"/v1/chapters/42/book"},"data":{"id":"2","type":"books"}}},"links":{"self":"/v1/chapters/42"}},{"id":"43","type":"chapters","attributes":{"title":"The Choices of Master Samwise","ordering":21,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/43/relationships/book","related":"/v1/chapters/43/book"},"data":{"id":"2","type":"books"}}},"links":{"self":"/v1/chapters/43"}},{"id":"44","type":"chapters","attributes":{"title":"Minas Tirith","ordering":1,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/44/relationships/book","related":"/v1/chapters/44/book"},"data":{"id":"3","type":"books"}}},"links":{"self":"/v1/chapters/44"}},{"id":"45","type":"chapters","attributes":{"title":"The Passing of the Grey Company","ordering":2,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/45/relationships/book","related":"/v1/chapters/45/book"},"data":{"id":"3","type":"books"}}},"links":{"self":"/v1/chapters/45"}},{"id":"46","type":"chapters","attributes":{"title":"The Muster of Rohan","ordering":3,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/46/relationships/book","related":"/v1/chapters/46/book"},"data":{"id":"3","type":"books"}}},"links":{"self":"/v1/chapters/46"}},{"id":"47","type":"chapters","attributes":{"title":"The Siege of Gondor","ordering":4,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/47/relationships/book","related":"/v1/chapters/47/book"},"data":{"id":"3","type":"books"}}},"links":{"self":"/v1/chapters/47"}},{"id":"48","type":"chapters","attributes":{"title":"The Ride of the Rohirrim","ordering":5,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/48/relationships/book","related":"/v1/chapters/48/book"},"data":{"id":"3","type":"books"}}},"links":{"self":"/v1/chapters/48"}},{"id":"49","type":"chapters","attributes":{"title":"The Battle of the Pelennor Fields","ordering":6,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/49/relationships/book","related":"/v1/chapters/49/book"},"data":{"id":"3","type":"books"}}},"links":{"self":"/v1/chapters/49"}},{"id":"50","type":"chapters","attributes":{"title":"The Pyre of Denethor","ordering":7,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/50/relationships/book","related":"/v1/chapters/50/book"},"data":{"id":"3","type":"books"}}},"links":{"self":"/v1/chapters/50"}},{"id":"51","type":"chapters","attributes":{"title":"The Houses of Healing","ordering":8,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/51/relationships/book","related":"/v1/chapters/51/book"},"data":{"id":"3","type":"books"}}},"links":{"self":"/v1/chapters/51"}},{"id":"52","type":"chapters","attributes":{"title":"The Last Debate","ordering":9,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/52/relationships/book","related":"/v1/chapters/52/book"},"data":{"id":"3","type":"books"}}},"links":{"self":"/v1/chapters/52"}},{"id":"53","type":"chapters","attributes":{"title":"The Black Gate Opens","ordering":10,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/53/relationships/book","related":"/v1/chapters/53/book"},"data":{"id":"3","type":"books"}}},"links":{"self":"/v1/chapters/53"}},{"id":"54","type":"chapters","attributes":{"title":"The Tower of Cirith Ungol","ordering":11,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/54/relationships/book","related":"/v1/chapters/54/book"},"data":{"id":"3","type":"books"}}},"links":{"self":"/v1/chapters/54"}},{"id":"55","type":"chapters","attributes":{"title":"The Land of Shadow","ordering":12,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/55/relationships/book","related":"/v1/chapters/55/book"},"data":{"id":"3","type":"books"}}},"links":{"self":"/v1/chapters/55"}},{"id":"56","type":"chapters","attributes":{"title":"Mount Doom","ordering":13,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/56/relationships/book","related":"/v1/chapters/56/book"},"data":{"id":"3","type":"books"}}},"links":{"self":"/v1/chapters/56"}},{"id":"57","type":"chapters","attributes":{"title":"The Field of Cormallen","ordering":14,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/57/relationships/book","related":"/v1/chapters/57/book"},"data":{"id":"3","type":"books"}}},"links":{"self":"/v1/chapters/57"}},{"id":"58","type":"chapters","attributes":{"title":"The Steward and the King","ordering":15,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/58/relationships/book","related":"/v1/chapters/58/book"},"data":{"id":"3","type":"books"}}},"links":{"self":"/v1/chapters/58"}},{"id":"59","type":"chapters","attributes":{"title":"Many Partings","ordering":16,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/59/relationships/book","related":"/v1/chapters/59/book"},"data":{"id":"3","type":"books"}}},"links":{"self":"/v1/chapters/59"}},{"id":"60","type":"chapters","attributes":{"title":"Homeward Bound","ordering":17,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/60/relationships/book","related":"/v1/chapters/60/book"},"data":{"id":"3","type":"books"}}},"links":{"self":"/v1/chapters/60"}},{"id":"61","type":"chapters","attributes":{"title":"The Scouring of the Shire","ordering":18,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/61/relationships/book","related":"/v1/chapters/61/book"},"data":{"id":"3","type":"books"}}},"links":{"self":"/v1/chapters/61"}},{"id":"62","type":"chapters","attributes":{"title":"The Grey Havens","ordering":19,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/62/relationships/book","related":"/v1/chapters/62/book"},"data":{"id":"3","type":"books"}}},"links":{"self":"/v1/chapters/62"}},{"id":"63","type":"chapters","attributes":{"title":"The Boy Who Lived","ordering":1,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/63/relationships/book","related":"/v1/chapters/63/book"},"data":{"id":"4","type":"books"}}},"links":{"self":"/v1/chapters/63"}},{"id":"64","type":"chapters","attributes":{"title":"The Vanishing Glass","ordering":2,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/64/relationships/book","related":"/v1/chapters/64/book"},"data":{"id":"4","type":"books"}}},"links":{"self":"/v1/chapters/64"}},{"id":"65","type":"chapters","attributes":{"title":"The Letters from No One","ordering":3,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/65/relationships/book","related":"/v1/chapters/65/book"},"data":{"id":"4","type":"books"}}},"links":{"self":"/v1/chapters/65"}},{"id":"66","type":"chapters","attributes":{"title":"The Keeper of the Keys","ordering":4,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/66/relationships/book","related":"/v1/chapters/66/book"},"data":{"id":"4","type":"books"}}},"links":{"self":"/v1/chapters/66"}},{"id":"67","type":"chapters","attributes":{"title":"Diagon Alley","ordering":5,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/67/relationships/book","related":"/v1/chapters/67/book"},"data":{"id":"4","type":"books"}}},"links":{"self":"/v1/chapters/67"}},{"id":"68","type":"chapters","attributes":{"title":"The Journey from Platform Nine and Three Quarters","ordering":6,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/68/relationships/book","related":"/v1/chapters/68/book"},"data":{"id":"4","type":"books"}}},"links":{"self":"/v1/chapters/68"}},{"id":"69","type":"chapters","attributes":{"title":"The Sorting Hat","ordering":7,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/69/relationships/book","related":"/v1/chapters/69/book"},"data":{"id":"4","type":"books"}}},"links":{"self":"/v1/chapters/69"}},{"id":"70","type":"chapters","attributes":{"title":"The Potions Teacher","ordering":8,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/70/relationships/book","related":"/v1/chapters/70/book"},"data":{"id":"4","type":"books"}}},"links":{"self":"/v1/chapters/70"}},{"id":"71","type":"chapters","attributes":{"title":"The Midnight Duel","ordering":9,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/71/relationships/book","related":"/v1/chapters/71/book"},"data":{"id":"4","type":"books"}}},"links":{"self":"/v1/chapters/71"}},{"id":"72","type":"chapters","attributes":{"title":"Hallowe'en","ordering":10,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/72/relationships/book","related":"/v1/chapters/72/book"},"data":{"id":"4","type":"books"}}},"links":{"self":"/v1/chapters/72"}},{"id":"73","type":"chapters","attributes":{"title":"Quidditch","ordering":11,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/73/relationships/book","related":"/v1/chapters/73/book"},"data":{"id":"4","type":"books"}}},"links":{"self":"/v1/chapters/73"}},{"id":"74","type":"chapters","attributes":{"title":"The Mirror of Erised","ordering":12,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/74/relationships/book","related":"/v1/chapters/74/book"},"data":{"id":"4","type":"books"}}},"links":{"self":"/v1/chapters/74"}},{"id":"75","type":"chapters","attributes":{"title":"Nicolas","ordering":13,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/75/relationships/book","related":"/v1/chapters/75/book"},"data":{"id":"4","type":"books"}}},"links":{"self":"/v1/chapters/75"}},{"id":"76","type":"chapters","attributes":{"title":"Norbert the Norwegian Ridgeback","ordering":14,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/76/relationships/book","related":"/v1/chapters/76/book"},"data":{"id":"4","type":"books"}}},"links":{"self":"/v1/chapters/76"}},{"id":"77","type":"chapters","attributes":{"title":"The Forbidden Forest","ordering":15,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/77/relationships/book","related":"/v1/chapters/77/book"},"data":{"id":"4","type":"books"}}},"links":{"self":"/v1/chapters/77"}},{"id":"78","type":"chapters","attributes":{"title":"Through the Trapdoor","ordering":16,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/78/relationships/book","related":"/v1/chapters/78/book"},"data":{"id":"4","type":"books"}}},"links":{"self":"/v1/chapters/78"}},{"id":"79","type":"chapters","attributes":{"title":"The Man with Two Faces","ordering":17,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/79/relationships/book","related":"/v1/chapters/79/book"},"data":{"id":"4","type":"books"}}},"links":{"self":"/v1/chapters/79"}},{"id":"80","type":"chapters","attributes":{"title":"The Worst Birthday","ordering":1,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/80/relationships/book","related":"/v1/chapters/80/book"},"data":{"id":"5","type":"books"}}},"links":{"self":"/v1/chapters/80"}},{"id":"81","type":"chapters","attributes":{"title":"Dobby's Warning","ordering":2,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/81/relationships/book","related":"/v1/chapters/81/book"},"data":{"id":"5","type":"books"}}},"links":{"self":"/v1/chapters/81"}},{"id":"82","type":"chapters","attributes":{"title":"The Burrow","ordering":3,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/82/relationships/book","related":"/v1/chapters/82/book"},"data":{"id":"5","type":"books"}}},"links":{"self":"/v1/chapters/82"}},{"id":"83","type":"chapters","attributes":{"title":"At Flourish and Blotts","ordering":4,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/83/relationships/book","related":"/v1/chapters/83/book"},"data":{"id":"5","type":"books"}}},"links":{"self":"/v1/chapters/83"}},{"id":"84","type":"chapters","attributes":{"title":"The Whomping Willow","ordering":5,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/84/relationships/book","related":"/v1/chapters/84/book"},"data":{"id":"5","type":"books"}}},"links":{"self":"/v1/chapters/84"}},{"id":"85","type":"chapters","attributes":{"title":"Gilderoy Lockhart","ordering":6,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/85/relationships/book","related":"/v1/chapters/85/book"},"data":{"id":"5","type":"books"}}},"links":{"self":"/v1/chapters/85"}},{"id":"86","type":"chapters","attributes":{"title":"Mudbloods and Murmurs","ordering":7,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/86/relationships/book","related":"/v1/chapters/86/book"},"data":{"id":"5","type":"books"}}},"links":{"self":"/v1/chapters/86"}},{"id":"87","type":"chapters","attributes":{"title":"The Deathday Party","ordering":8,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/87/relationships/book","related":"/v1/chapters/87/book"},"data":{"id":"5","type":"books"}}},"links":{"self":"/v1/chapters/87"}},{"id":"88","type":"chapters","attributes":{"title":"The Writing on the Wall","ordering":9,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/88/relationships/book","related":"/v1/chapters/88/book"},"data":{"id":"5","type":"books"}}},"links":{"self":"/v1/chapters/88"}},{"id":"89","type":"chapters","attributes":{"title":"The Rogue Bludger","ordering":10,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/89/relationships/book","related":"/v1/chapters/89/book"},"data":{"id":"5","type":"books"}}},"links":{"self":"/v1/chapters/89"}},{"id":"90","type":"chapters","attributes":{"title":"The Duelling Club","ordering":11,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/90/relationships/book","related":"/v1/chapters/90/book"},"data":{"id":"5","type":"books"}}},"links":{"self":"/v1/chapters/90"}},{"id":"91","type":"chapters","attributes":{"title":"The Polyjuice Potion","ordering":12,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/91/relationships/book","related":"/v1/chapters/91/book"},"data":{"id":"5","type":"books"}}},"links":{"self":"/v1/chapters/91"}},{"id":"92","type":"chapters","attributes":{"title":"The Very Secret Diary","ordering":13,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/92/relationships/book","related":"/v1/chapters/92/book"},"data":{"id":"5","type":"books"}}},"links":{"self":"/v1/chapters/92"}},{"id":"93","type":"chapters","attributes":{"title":"Cornelius Fudge","ordering":14,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/93/relationships/book","related":"/v1/chapters/93/book"},"data":{"id":"5","type":"books"}}},"links":{"self":"/v1/chapters/93"}},{"id":"94","type":"chapters","attributes":{"title":"Aragog","ordering":15,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/94/relationships/book","related":"/v1/chapters/94/book"},"data":{"id":"5","type":"books"}}},"links":{"self":"/v1/chapters/94"}},{"id":"95","type":"chapters","attributes":{"title":"The Chamber of Secrets","ordering":16,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/95/relationships/book","related":"/v1/chapters/95/book"},"data":{"id":"5","type":"books"}}},"links":{"self":"/v1/chapters/95"}},{"id":"96","type":"chapters","attributes":{"title":"The Heir of Slytherin","ordering":17,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/96/relationships/book","related":"/v1/chapters/96/book"},"data":{"id":"5","type":"books"}}},"links":{"self":"/v1/chapters/96"}},{"id":"97","type":"chapters","attributes":{"title":"Dobby's Reward","ordering":18,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/97/relationships/book","related":"/v1/chapters/97/book"},"data":{"id":"5","type":"books"}}},"links":{"self":"/v1/chapters/97"}},{"id":"98","type":"chapters","attributes":{"title":"Owl Post","ordering":1,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/98/relationships/book","related":"/v1/chapters/98/book"},"data":{"id":"6","type":"books"}}},"links":{"self":"/v1/chapters/98"}},{"id":"99","type":"chapters","attributes":{"title":"Aunt Marge's Big Mistake","ordering":2,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/99/relationships/book","related":"/v1/chapters/99/book"},"data":{"id":"6","type":"books"}}},"links":{"self":"/v1/chapters/99"}},{"id":"100","type":"chapters","attributes":{"title":"The Knight Bus","ordering":3,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/100/relationships/book","related":"/v1/chapters/100/book"},"data":{"id":"6","type":"books"}}},"links":{"self":"/v1/chapters/100"}},{"id":"101","type":"chapters","attributes":{"title":"The Leaky Cauldron","ordering":4,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/101/relationships/book","related":"/v1/chapters/101/book"},"data":{"id":"6","type":"books"}}},"links":{"self":"/v1/chapters/101"}},{"id":"102","type":"chapters","attributes":{"title":"The Dementor","ordering":5,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/102/relationships/book","related":"/v1/chapters/102/book"},"data":{"id":"6","type":"books"}}},"links":{"self":"/v1/chapters/102"}},{"id":"103","type":"chapters","attributes":{"title":"Talons and Tea Leaves","ordering":6,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/103/relationships/book","related":"/v1/chapters/103/book"},"data":{"id":"6","type":"books"}}},"links":{"self":"/v1/chapters/103"}},{"id":"104","type":"chapters","attributes":{"title":"The Boggart in the Wardrobe","ordering":7,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/104/relationships/book","related":"/v1/chapters/104/book"},"data":{"id":"6","type":"books"}}},"links":{"self":"/v1/chapters/104"}},{"id":"105","type":"chapters","attributes":{"title":"Flight of the Fat Lady","ordering":8,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/105/relationships/book","related":"/v1/chapters/105/book"},"data":{"id":"6","type":"books"}}},"links":{"self":"/v1/chapters/105"}},{"id":"106","type":"chapters","attributes":{"title":"Grim Defeat","ordering":9,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/106/relationships/book","related":"/v1/chapters/106/book"},"data":{"id":"6","type":"books"}}},"links":{"self":"/v1/chapters/106"}},{"id":"107","type":"chapters","attributes":{"title":"The Marauder's Map","ordering":10,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/107/relationships/book","related":"/v1/chapters/107/book"},"data":{"id":"6","type":"books"}}},"links":{"self":"/v1/chapters/107"}},{"id":"108","type":"chapters","attributes":{"title":"The Firebolt","ordering":11,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/108/relationships/book","related":"/v1/chapters/108/book"},"data":{"id":"6","type":"books"}}},"links":{"self":"/v1/chapters/108"}},{"id":"109","type":"chapters","attributes":{"title":"The Patronus","ordering":12,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/109/relationships/book","related":"/v1/chapters/109/book"},"data":{"id":"6","type":"books"}}},"links":{"self":"/v1/chapters/109"}},{"id":"110","type":"chapters","attributes":{"title":"Gryffindor vs Ravenclaw","ordering":13,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/110/relationships/book","related":"/v1/chapters/110/book"},"data":{"id":"6","type":"books"}}},"links":{"self":"/v1/chapters/110"}},{"id":"111","type":"chapters","attributes":{"title":"Snape's Grudge","ordering":14,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/111/relationships/book","related":"/v1/chapters/111/book"},"data":{"id":"6","type":"books"}}},"links":{"self":"/v1/chapters/111"}},{"id":"112","type":"chapters","attributes":{"title":"The Quidditch Final","ordering":15,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/112/relationships/book","related":"/v1/chapters/112/book"},"data":{"id":"6","type":"books"}}},"links":{"self":"/v1/chapters/112"}},{"id":"113","type":"chapters","attributes":{"title":"Professor Trelawney's Prediction","ordering":16,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/113/relationships/book","related":"/v1/chapters/113/book"},"data":{"id":"6","type":"books"}}},"links":{"self":"/v1/chapters/113"}},{"id":"114","type":"chapters","attributes":{"title":"Cat, Rat and Dog","ordering":17,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/114/relationships/book","related":"/v1/chapters/114/book"},"data":{"id":"6","type":"books"}}},"links":{"self":"/v1/chapters/114"}},{"id":"115","type":"chapters","attributes":{"title":"Moony, Wormtail, Padfoot and Prongs","ordering":18,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/115/relationships/book","related":"/v1/chapters/115/book"},"data":{"id":"6","type":"books"}}},"links":{"self":"/v1/chapters/115"}},{"id":"116","type":"chapters","attributes":{"title":"The Servant of Lord Voldemort","ordering":19,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/116/relationships/book","related":"/v1/chapters/116/book"},"data":{"id":"6","type":"books"}}},"links":{"self":"/v1/chapters/116"}},{"id":"117","type":"chapters","attributes":{"title":"The Dementors' Kiss","ordering":20,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/117/relationships/book","related":"/v1/chapters/117/book"},"data":{"id":"6","type":"books"}}},"links":{"self":"/v1/chapters/117"}},{"id":"118","type":"chapters","attributes":{"title":"Hermione's Secret","ordering":21,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/118/relationships/book","related":"/v1/chapters/118/book"},"data":{"id":"6","type":"books"}}},"links":{"self":"/v1/chapters/118"}},{"id":"119","type":"chapters","attributes":{"title":"Owl Post Again","ordering":22,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/119/relationships/book","related":"/v1/chapters/119/book"},"data":{"id":"6","type":"books"}}},"links":{"self":"/v1/chapters/119"}},{"id":"120","type":"chapters","attributes":{"title":"The Riddle House","ordering":1,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/120/relationships/book","related":"/v1/chapters/120/book"},"data":{"id":"7","type":"books"}}},"links":{"self":"/v1/chapters/120"}},{"id":"121","type":"chapters","attributes":{"title":"The Scar","ordering":2,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/121/relationships/book","related":"/v1/chapters/121/book"},"data":{"id":"7","type":"books"}}},"links":{"self":"/v1/chapters/121"}},{"id":"122","type":"chapters","attributes":{"title":"The Invitation","ordering":3,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/122/relationships/book","related":"/v1/chapters/122/book"},"data":{"id":"7","type":"books"}}},"links":{"self":"/v1/chapters/122"}},{"id":"123","type":"chapters","attributes":{"title":"Back to the Burrow","ordering":4,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/123/relationships/book","related":"/v1/chapters/123/book"},"data":{"id":"7","type":"books"}}},"links":{"self":"/v1/chapters/123"}},{"id":"124","type":"chapters","attributes":{"title":"Weasleys' Wizard Wheezes","ordering":5,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/124/relationships/book","related":"/v1/chapters/124/book"},"data":{"id":"7","type":"books"}}},"links":{"self":"/v1/chapters/124"}},{"id":"125","type":"chapters","attributes":{"title":"The Portkey","ordering":6,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/125/relationships/book","related":"/v1/chapters/125/book"},"data":{"id":"7","type":"books"}}},"links":{"self":"/v1/chapters/125"}},{"id":"126","type":"chapters","attributes":{"title":"Bagman and Crouch","ordering":7,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/126/relationships/book","related":"/v1/chapters/126/book"},"data":{"id":"7","type":"books"}}},"links":{"self":"/v1/chapters/126"}},{"id":"127","type":"chapters","attributes":{"title":"The Quidditch World Cup","ordering":8,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/127/relationships/book","related":"/v1/chapters/127/book"},"data":{"id":"7","type":"books"}}},"links":{"self":"/v1/chapters/127"}},{"id":"128","type":"chapters","attributes":{"title":"The Dark Mark","ordering":9,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/128/relationships/book","related":"/v1/chapters/128/book"},"data":{"id":"7","type":"books"}}},"links":{"self":"/v1/chapters/128"}},{"id":"129","type":"chapters","attributes":{"title":"Mayhem at the Ministry","ordering":10,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/129/relationships/book","related":"/v1/chapters/129/book"},"data":{"id":"7","type":"books"}}},"links":{"self":"/v1/chapters/129"}},{"id":"130","type":"chapters","attributes":{"title":"Aboard the Hogwarts Express","ordering":11,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/130/relationships/book","related":"/v1/chapters/130/book"},"data":{"id":"7","type":"books"}}},"links":{"self":"/v1/chapters/130"}},{"id":"131","type":"chapters","attributes":{"title":"The Triwizard Tournament","ordering":12,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/131/relationships/book","related":"/v1/chapters/131/book"},"data":{"id":"7","type":"books"}}},"links":{"self":"/v1/chapters/131"}},{"id":"132","type":"chapters","attributes":{"title":"Mad-Eye Moody","ordering":13,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/132/relationships/book","related":"/v1/chapters/132/book"},"data":{"id":"7","type":"books"}}},"links":{"self":"/v1/chapters/132"}},{"id":"133","type":"chapters","attributes":{"title":"The Unforgivable Curses","ordering":14,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/133/relationships/book","related":"/v1/chapters/133/book"},"data":{"id":"7","type":"books"}}},"links":{"self":"/v1/chapters/133"}},{"id":"134","type":"chapters","attributes":{"title":"Beauxbatons and Durmstrang","ordering":15,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/134/relationships/book","related":"/v1/chapters/134/book"},"data":{"id":"7","type":"books"}}},"links":{"self":"/v1/chapters/134"}},{"id":"135","type":"chapters","attributes":{"title":"The Goblet of Fire","ordering":16,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/135/relationships/book","related":"/v1/chapters/135/book"},"data":{"id":"7","type":"books"}}},"links":{"self":"/v1/chapters/135"}},{"id":"136","type":"chapters","attributes":{"title":"The Four Champions","ordering":17,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/136/relationships/book","related":"/v1/chapters/136/book"},"data":{"id":"7","type":"books"}}},"links":{"self":"/v1/chapters/136"}},{"id":"137","type":"chapters","attributes":{"title":"The Weighing of the Wands","ordering":18,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/137/relationships/book","related":"/v1/chapters/137/book"},"data":{"id":"7","type":"books"}}},"links":{"self":"/v1/chapters/137"}},{"id":"138","type":"chapters","attributes":{"title":"The Hungarian Horntail","ordering":19,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/138/relationships/book","related":"/v1/chapters/138/book"},"data":{"id":"7","type":"books"}}},"links":{"self":"/v1/chapters/138"}},{"id":"139","type":"chapters","attributes":{"title":"The First Task","ordering":20,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/139/relationships/book","related":"/v1/chapters/139/book"},"data":{"id":"7","type":"books"}}},"links":{"self":"/v1/chapters/139"}},{"id":"140","type":"chapters","attributes":{"title":"The House-Elf Liberation Front","ordering":21,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/140/relationships/book","related":"/v1/chapters/140/book"},"data":{"id":"7","type":"books"}}},"links":{"self":"/v1/chapters/140"}},{"id":"141","type":"chapters","attributes":{"title":"The Unexpected Task","ordering":22,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/141/relationships/book","related":"/v1/chapters/141/book"},"data":{"id":"7","type":"books"}}},"links":{"self":"/v1/chapters/141"}},{"id":"142","type":"chapters","attributes":{"title":"The Yule Ball","ordering":23,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/142/relationships/book","related":"/v1/chapters/142/book"},"data":{"id":"7","type":"books"}}},"links":{"self":"/v1/chapters/142"}},{"id":"143","type":"chapters","attributes":{"title":"Rita Skeeter's Scoop","ordering":24,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/143/relationships/book","related":"/v1/chapters/143/book"},"data":{"id":"7","type":"books"}}},"links":{"self":"/v1/chapters/143"}},{"id":"144","type":"chapters","attributes":{"title":"The Egg and the Eye","ordering":25,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/144/relationships/book","related":"/v1/chapters/144/book"},"data":{"id":"7","type":"books"}}},"links":{"self":"/v1/chapters/144"}},{"id":"145","type":"chapters","attributes":{"title":"The Second Task","ordering":26,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/145/relationships/book","related":"/v1/chapters/145/book"},"data":{"id":"7","type":"books"}}},"links":{"self":"/v1/chapters/145"}},{"id":"146","type":"chapters","attributes":{"title":"Padfoot Returns","ordering":27,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/146/relationships/book","related":"/v1/chapters/146/book"},"data":{"id":"7","type":"books"}}},"links":{"self":"/v1/chapters/146"}},{"id":"147","type":"chapters","attributes":{"title":"The Madness of Mr Crouch","ordering":28,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/147/relationships/book","related":"/v1/chapters/147/book"},"data":{"id":"7","type":"books"}}},"links":{"self":"/v1/chapters/147"}},{"id":"148","type":"chapters","attributes":{"title":"The Dream","ordering":29,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/148/relationships/book","related":"/v1/chapters/148/book"},"data":{"id":"7","type":"books"}}},"links":{"self":"/v1/chapters/148"}},{"id":"149","type":"chapters","attributes":{"title":"The Pensieve","ordering":30,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/149/relationships/book","related":"/v1/chapters/149/book"},"data":{"id":"7","type":"books"}}},"links":{"self":"/v1/chapters/149"}},{"id":"150","type":"chapters","attributes":{"title":"The Third Task","ordering":31,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/150/relationships/book","related":"/v1/chapters/150/book"},"data":{"id":"7","type":"books"}}},"links":{"self":"/v1/chapters/150"}},{"id":"151","type":"chapters","attributes":{"title":"Flesh, Blood and Bone","ordering":32,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/151/relationships/book","related":"/v1/chapters/151/book"},"data":{"id":"7","type":"books"}}},"links":{"self":"/v1/chapters/151"}},{"id":"152","type":"chapters","attributes":{"title":"The Death Eaters","ordering":33,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/152/relationships/book","related":"/v1/chapters/152/book"},"data":{"id":"7","type":"books"}}},"links":{"self":"/v1/chapters/152"}},{"id":"153","type":"chapters","attributes":{"title":"Priori Incantatem","ordering":34,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/153/relationships/book","related":"/v1/chapters/153/book"},"data":{"id":"7","type":"books"}}},"links":{"self":"/v1/chapters/153"}},{"id":"154","type":"chapters","attributes":{"title":"Veritaserum","ordering":35,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/154/relationships/book","related":"/v1/chapters/154/book"},"data":{"id":"7","type":"books"}}},"links":{"self":"/v1/chapters/154"}},{"id":"155","type":"chapters","attributes":{"title":"The Parting of the Ways","ordering":36,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/155/relationships/book","related":"/v1/chapters/155/book"},"data":{"id":"7","type":"books"}}},"links":{"self":"/v1/chapters/155"}},{"id":"156","type":"chapters","attributes":{"title":"The Beginning","ordering":37,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/156/relationships/book","related":"/v1/chapters/156/book"},"data":{"id":"7","type":"books"}}},"links":{"self":"/v1/chapters/156"}},{"id":"157","type":"chapters","attributes":{"title":"Dudley Demented","ordering":1,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/157/relationships/book","related":"/v1/chapters/157/book"},"data":{"id":"8","type":"books"}}},"links":{"self":"/v1/chapters/157"}},{"id":"158","type":"chapters","attributes":{"title":"A Peck of Owls","ordering":2,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/158/relationships/book","related":"/v1/chapters/158/book"},"data":{"id":"8","type":"books"}}},"links":{"self":"/v1/chapters/158"}},{"id":"159","type":"chapters","attributes":{"title":"The Advance Guard","ordering":3,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/159/relationships/book","related":"/v1/chapters/159/book"},"data":{"id":"8","type":"books"}}},"links":{"self":"/v1/chapters/159"}},{"id":"160","type":"chapters","attributes":{"title":"Number Twelve, Grimmauld Place","ordering":4,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/160/relationships/book","related":"/v1/chapters/160/book"},"data":{"id":"8","type":"books"}}},"links":{"self":"/v1/chapters/160"}},{"id":"161","type":"chapters","attributes":{"title":"The Order of the Phoenix","ordering":5,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/161/relationships/book","related":"/v1/chapters/161/book"},"data":{"id":"8","type":"books"}}},"links":{"self":"/v1/chapters/161"}},{"id":"162","type":"chapters","attributes":{"title":"The Noble and Most Ancient House of Black","ordering":6,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/162/relationships/book","related":"/v1/chapters/162/book"},"data":{"id":"8","type":"books"}}},"links":{"self":"/v1/chapters/162"}},{"id":"163","type":"chapters","attributes":{"title":"Ministry of Magic","ordering":7,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/163/relationships/book","related":"/v1/chapters/163/book"},"data":{"id":"8","type":"books"}}},"links":{"self":"/v1/chapters/163"}},{"id":"164","type":"chapters","attributes":{"title":"The Hearing","ordering":8,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/164/relationships/book","related":"/v1/chapters/164/book"},"data":{"id":"8","type":"books"}}},"links":{"self":"/v1/chapters/164"}},{"id":"165","type":"chapters","attributes":{"title":"The Woes of Mrs Weasley","ordering":9,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/165/relationships/book","related":"/v1/chapters/165/book"},"data":{"id":"8","type":"books"}}},"links":{"self":"/v1/chapters/165"}},{"id":"166","type":"chapters","attributes":{"title":"Luna Lovegood","ordering":10,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/166/relationships/book","related":"/v1/chapters/166/book"},"data":{"id":"8","type":"books"}}},"links":{"self":"/v1/chapters/166"}},{"id":"167","type":"chapters","attributes":{"title":"The Sorting Hat's New Song","ordering":11,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/167/relationships/book","related":"/v1/chapters/167/book"},"data":{"id":"8","type":"books"}}},"links":{"self":"/v1/chapters/167"}},{"id":"168","type":"chapters","attributes":{"title":"Professor Umbridge","ordering":12,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/168/relationships/book","related":"/v1/chapters/168/book"},"data":{"id":"8","type":"books"}}},"links":{"self":"/v1/chapters/168"}},{"id":"169","type":"chapters","attributes":{"title":"Detention with Dolores","ordering":13,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/169/relationships/book","related":"/v1/chapters/169/book"},"data":{"id":"8","type":"books"}}},"links":{"self":"/v1/chapters/169"}},{"id":"170","type":"chapters","attributes":{"title":"Percy and Padfoot","ordering":14,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/170/relationships/book","related":"/v1/chapters/170/book"},"data":{"id":"8","type":"books"}}},"links":{"self":"/v1/chapters/170"}},{"id":"171","type":"chapters","attributes":{"title":"The Hogwarts High Inquisitor","ordering":15,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/171/relationships/book","related":"/v1/chapters/171/book"},"data":{"id":"8","type":"books"}}},"links":{"self":"/v1/chapters/171"}},{"id":"172","type":"chapters","attributes":{"title":"In the Hog's Head","ordering":16,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/172/relationships/book","related":"/v1/chapters/172/book"},"data":{"id":"8","type":"books"}}},"links":{"self":"/v1/chapters/172"}},{"id":"173","type":"chapters","attributes":{"title":"Educational Decree Number Twenty-four","ordering":17,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/173/relationships/book","related":"/v1/chapters/173/book"},"data":{"id":"8","type":"books"}}},"links":{"self":"/v1/chapters/173"}},{"id":"174","type":"chapters","attributes":{"title":"Dumbledore's Army","ordering":18,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/174/relationships/book","related":"/v1/chapters/174/book"},"data":{"id":"8","type":"books"}}},"links":{"self":"/v1/chapters/174"}},{"id":"175","type":"chapters","attributes":{"title":"The Lion and the Serpent","ordering":19,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/175/relationships/book","related":"/v1/chapters/175/book"},"data":{"id":"8","type":"books"}}},"links":{"self":"/v1/chapters/175"}},{"id":"176","type":"chapters","attributes":{"title":"Hagrid's Tale","ordering":20,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/176/relationships/book","related":"/v1/chapters/176/book"},"data":{"id":"8","type":"books"}}},"links":{"self":"/v1/chapters/176"}},{"id":"177","type":"chapters","attributes":{"title":"The Eye of the Snake","ordering":21,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/177/relationships/book","related":"/v1/chapters/177/book"},"data":{"id":"8","type":"books"}}},"links":{"self":"/v1/chapters/177"}},{"id":"178","type":"chapters","attributes":{"title":"St Mungo's Hospital for Magical Maladies and Injuries","ordering":22,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/178/relationships/book","related":"/v1/chapters/178/book"},"data":{"id":"8","type":"books"}}},"links":{"self":"/v1/chapters/178"}},{"id":"179","type":"chapters","attributes":{"title":"Christmas on the Closed Ward","ordering":23,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/179/relationships/book","related":"/v1/chapters/179/book"},"data":{"id":"8","type":"books"}}},"links":{"self":"/v1/chapters/179"}},{"id":"180","type":"chapters","attributes":{"title":"Occlumency","ordering":24,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/180/relationships/book","related":"/v1/chapters/180/book"},"data":{"id":"8","type":"books"}}},"links":{"self":"/v1/chapters/180"}},{"id":"181","type":"chapters","attributes":{"title":"The Beetle at Bay","ordering":25,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/181/relationships/book","related":"/v1/chapters/181/book"},"data":{"id":"8","type":"books"}}},"links":{"self":"/v1/chapters/181"}},{"id":"182","type":"chapters","attributes":{"title":"Seen and Unforeseen","ordering":26,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/182/relationships/book","related":"/v1/chapters/182/book"},"data":{"id":"8","type":"books"}}},"links":{"self":"/v1/chapters/182"}},{"id":"183","type":"chapters","attributes":{"title":"The Centaur and the Sneak","ordering":27,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/183/relationships/book","related":"/v1/chapters/183/book"},"data":{"id":"8","type":"books"}}},"links":{"self":"/v1/chapters/183"}},{"id":"184","type":"chapters","attributes":{"title":"Snape's Worst Memory","ordering":28,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/184/relationships/book","related":"/v1/chapters/184/book"},"data":{"id":"8","type":"books"}}},"links":{"self":"/v1/chapters/184"}},{"id":"185","type":"chapters","attributes":{"title":"Careers Advice","ordering":29,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/185/relationships/book","related":"/v1/chapters/185/book"},"data":{"id":"8","type":"books"}}},"links":{"self":"/v1/chapters/185"}},{"id":"186","type":"chapters","attributes":{"title":"Grawp","ordering":30,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/186/relationships/book","related":"/v1/chapters/186/book"},"data":{"id":"8","type":"books"}}},"links":{"self":"/v1/chapters/186"}},{"id":"187","type":"chapters","attributes":{"title":"OWLs","ordering":31,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/187/relationships/book","related":"/v1/chapters/187/book"},"data":{"id":"8","type":"books"}}},"links":{"self":"/v1/chapters/187"}},{"id":"188","type":"chapters","attributes":{"title":"Out of the Fire","ordering":32,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/188/relationships/book","related":"/v1/chapters/188/book"},"data":{"id":"8","type":"books"}}},"links":{"self":"/v1/chapters/188"}},{"id":"189","type":"chapters","attributes":{"title":"Fight and Flight","ordering":33,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/189/relationships/book","related":"/v1/chapters/189/book"},"data":{"id":"8","type":"books"}}},"links":{"self":"/v1/chapters/189"}},{"id":"190","type":"chapters","attributes":{"title":"The Department of Mysteries","ordering":34,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/190/relationships/book","related":"/v1/chapters/190/book"},"data":{"id":"8","type":"books"}}},"links":{"self":"/v1/chapters/190"}},{"id":"191","type":"chapters","attributes":{"title":"Beyond the Veil","ordering":35,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/191/relationships/book","related":"/v1/chapters/191/book"},"data":{"id":"8","type":"books"}}},"links":{"self":"/v1/chapters/191"}},{"id":"192","type":"chapters","attributes":{"title":"The Only One He Ever Feared","ordering":36,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/192/relationships/book","related":"/v1/chapters/192/book"},"data":{"id":"8","type":"books"}}},"links":{"self":"/v1/chapters/192"}},{"id":"193","type":"chapters","attributes":{"title":"The Lost Prophecy","ordering":37,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/193/relationships/book","related":"/v1/chapters/193/book"},"data":{"id":"8","type":"books"}}},"links":{"self":"/v1/chapters/193"}},{"id":"194","type":"chapters","attributes":{"title":"The Second War Begins","ordering":38,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/194/relationships/book","related":"/v1/chapters/194/book"},"data":{"id":"8","type":"books"}}},"links":{"self":"/v1/chapters/194"}},{"id":"195","type":"chapters","attributes":{"title":"The Other Minister","ordering":1,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/195/relationships/book","related":"/v1/chapters/195/book"},"data":{"id":"9","type":"books"}}},"links":{"self":"/v1/chapters/195"}},{"id":"196","type":"chapters","attributes":{"title":"Spinner's End","ordering":2,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/196/relationships/book","related":"/v1/chapters/196/book"},"data":{"id":"9","type":"books"}}},"links":{"self":"/v1/chapters/196"}},{"id":"197","type":"chapters","attributes":{"title":"Will and Won't","ordering":3,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/197/relationships/book","related":"/v1/chapters/197/book"},"data":{"id":"9","type":"books"}}},"links":{"self":"/v1/chapters/197"}},{"id":"198","type":"chapters","attributes":{"title":"Horace Slughorn","ordering":4,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/198/relationships/book","related":"/v1/chapters/198/book"},"data":{"id":"9","type":"books"}}},"links":{"self":"/v1/chapters/198"}},{"id":"199","type":"chapters","attributes":{"title":"An Excess of Phlegm","ordering":5,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/199/relationships/book","related":"/v1/chapters/199/book"},"data":{"id":"9","type":"books"}}},"links":{"self":"/v1/chapters/199"}},{"id":"200","type":"chapters","attributes":{"title":"Draco's Detour","ordering":6,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/200/relationships/book","related":"/v1/chapters/200/book"},"data":{"id":"9","type":"books"}}},"links":{"self":"/v1/chapters/200"}},{"id":"201","type":"chapters","attributes":{"title":"The Slug Club","ordering":7,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/201/relationships/book","related":"/v1/chapters/201/book"},"data":{"id":"9","type":"books"}}},"links":{"self":"/v1/chapters/201"}},{"id":"202","type":"chapters","attributes":{"title":"Snape Victorious","ordering":8,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/202/relationships/book","related":"/v1/chapters/202/book"},"data":{"id":"9","type":"books"}}},"links":{"self":"/v1/chapters/202"}},{"id":"203","type":"chapters","attributes":{"title":"The Half-Blood Prince","ordering":9,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/203/relationships/book","related":"/v1/chapters/203/book"},"data":{"id":"9","type":"books"}}},"links":{"self":"/v1/chapters/203"}},{"id":"204","type":"chapters","attributes":{"title":"The House of Gaunt","ordering":10,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/204/relationships/book","related":"/v1/chapters/204/book"},"data":{"id":"9","type":"books"}}},"links":{"self":"/v1/chapters/204"}},{"id":"205","type":"chapters","attributes":{"title":"Hermione's Helping Hand","ordering":11,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/205/relationships/book","related":"/v1/chapters/205/book"},"data":{"id":"9","type":"books"}}},"links":{"self":"/v1/chapters/205"}},{"id":"206","type":"chapters","attributes":{"title":"Silver and Opals","ordering":12,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/206/relationships/book","related":"/v1/chapters/206/book"},"data":{"id":"9","type":"books"}}},"links":{"self":"/v1/chapters/206"}},{"id":"207","type":"chapters","attributes":{"title":"The Secret Riddle","ordering":13,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/207/relationships/book","related":"/v1/chapters/207/book"},"data":{"id":"9","type":"books"}}},"links":{"self":"/v1/chapters/207"}},{"id":"208","type":"chapters","attributes":{"title":"Felix Felicis","ordering":14,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/208/relationships/book","related":"/v1/chapters/208/book"},"data":{"id":"9","type":"books"}}},"links":{"self":"/v1/chapters/208"}},{"id":"209","type":"chapters","attributes":{"title":"The Unbreakable Vow","ordering":15,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/209/relationships/book","related":"/v1/chapters/209/book"},"data":{"id":"9","type":"books"}}},"links":{"self":"/v1/chapters/209"}},{"id":"210","type":"chapters","attributes":{"title":"A Very Frosty Christmas","ordering":16,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/210/relationships/book","related":"/v1/chapters/210/book"},"data":{"id":"9","type":"books"}}},"links":{"self":"/v1/chapters/210"}},{"id":"211","type":"chapters","attributes":{"title":"A Sluggish Memory","ordering":17,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/211/relationships/book","related":"/v1/chapters/211/book"},"data":{"id":"9","type":"books"}}},"links":{"self":"/v1/chapters/211"}},{"id":"212","type":"chapters","attributes":{"title":"Birthday Surprises","ordering":18,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/212/relationships/book","related":"/v1/chapters/212/book"},"data":{"id":"9","type":"books"}}},"links":{"self":"/v1/chapters/212"}},{"id":"213","type":"chapters","attributes":{"title":"Elf Tails","ordering":19,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/213/relationships/book","related":"/v1/chapters/213/book"},"data":{"id":"9","type":"books"}}},"links":{"self":"/v1/chapters/213"}},{"id":"214","type":"chapters","attributes":{"title":"Lord Voldemort's Request","ordering":20,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/214/relationships/book","related":"/v1/chapters/214/book"},"data":{"id":"9","type":"books"}}},"links":{"self":"/v1/chapters/214"}},{"id":"215","type":"chapters","attributes":{"title":"The Unknowable Room","ordering":21,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/215/relationships/book","related":"/v1/chapters/215/book"},"data":{"id":"9","type":"books"}}},"links":{"self":"/v1/chapters/215"}},{"id":"216","type":"chapters","attributes":{"title":"After the Burial","ordering":22,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/216/relationships/book","related":"/v1/chapters/216/book"},"data":{"id":"9","type":"books"}}},"links":{"self":"/v1/chapters/216"}},{"id":"217","type":"chapters","attributes":{"title":"Horcruxes","ordering":23,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/217/relationships/book","related":"/v1/chapters/217/book"},"data":{"id":"9","type":"books"}}},"links":{"self":"/v1/chapters/217"}},{"id":"218","type":"chapters","attributes":{"title":"Sectumsempra","ordering":24,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/218/relationships/book","related":"/v1/chapters/218/book"},"data":{"id":"9","type":"books"}}},"links":{"self":"/v1/chapters/218"}},{"id":"219","type":"chapters","attributes":{"title":"The Seer Overheard","ordering":25,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/219/relationships/book","related":"/v1/chapters/219/book"},"data":{"id":"9","type":"books"}}},"links":{"self":"/v1/chapters/219"}},{"id":"220","type":"chapters","attributes":{"title":"The Cave","ordering":26,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/220/relationships/book","related":"/v1/chapters/220/book"},"data":{"id":"9","type":"books"}}},"links":{"self":"/v1/chapters/220"}},{"id":"221","type":"chapters","attributes":{"title":"The Lightning-Struck Tower","ordering":27,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/221/relationships/book","related":"/v1/chapters/221/book"},"data":{"id":"9","type":"books"}}},"links":{"self":"/v1/chapters/221"}},{"id":"222","type":"chapters","attributes":{"title":"The Flight of the Prince","ordering":28,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/222/relationships/book","related":"/v1/chapters/222/book"},"data":{"id":"9","type":"books"}}},"links":{"self":"/v1/chapters/222"}},{"id":"223","type":"chapters","attributes":{"title":"The Phoenix Lament","ordering":29,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/223/relationships/book","related":"/v1/chapters/223/book"},"data":{"id":"9","type":"books"}}},"links":{"self":"/v1/chapters/223"}},{"id":"224","type":"chapters","attributes":{"title":"The White Tomb","ordering":30,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/224/relationships/book","related":"/v1/chapters/224/book"},"data":{"id":"9","type":"books"}}},"links":{"self":"/v1/chapters/224"}},{"id":"225","type":"chapters","attributes":{"title":"The Dark Lord Ascending","ordering":1,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/225/relationships/book","related":"/v1/chapters/225/book"},"data":{"id":"10","type":"books"}}},"links":{"self":"/v1/chapters/225"}},{"id":"226","type":"chapters","attributes":{"title":"In Memoriam","ordering":2,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/226/relationships/book","related":"/v1/chapters/226/book"},"data":{"id":"10","type":"books"}}},"links":{"self":"/v1/chapters/226"}},{"id":"227","type":"chapters","attributes":{"title":"The Dursleys Departing","ordering":3,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/227/relationships/book","related":"/v1/chapters/227/book"},"data":{"id":"10","type":"books"}}},"links":{"self":"/v1/chapters/227"}},{"id":"228","type":"chapters","attributes":{"title":"The Seven Potters","ordering":4,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/228/relationships/book","related":"/v1/chapters/228/book"},"data":{"id":"10","type":"books"}}},"links":{"self":"/v1/chapters/228"}},{"id":"229","type":"chapters","attributes":{"title":"Fallen Warrior","ordering":5,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/229/relationships/book","related":"/v1/chapters/229/book"},"data":{"id":"10","type":"books"}}},"links":{"self":"/v1/chapters/229"}},{"id":"230","type":"chapters","attributes":{"title":"The Ghoul in Pyjamas","ordering":6,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/230/relationships/book","related":"/v1/chapters/230/book"},"data":{"id":"10","type":"books"}}},"links":{"self":"/v1/chapters/230"}},{"id":"231","type":"chapters","attributes":{"title":"The Will of Albus Dumbledore","ordering":7,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/231/relationships/book","related":"/v1/chapters/231/book"},"data":{"id":"10","type":"books"}}},"links":{"self":"/v1/chapters/231"}},{"id":"232","type":"chapters","attributes":{"title":"The Wedding","ordering":8,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/232/relationships/book","related":"/v1/chapters/232/book"},"data":{"id":"10","type":"books"}}},"links":{"self":"/v1/chapters/232"}},{"id":"233","type":"chapters","attributes":{"title":"A Place to Hide","ordering":9,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/233/relationships/book","related":"/v1/chapters/233/book"},"data":{"id":"10","type":"books"}}},"links":{"self":"/v1/chapters/233"}},{"id":"234","type":"chapters","attributes":{"title":"Kreacher's Tale","ordering":10,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/234/relationships/book","related":"/v1/chapters/234/book"},"data":{"id":"10","type":"books"}}},"links":{"self":"/v1/chapters/234"}},{"id":"235","type":"chapters","attributes":{"title":"The Bribe","ordering":11,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/235/relationships/book","related":"/v1/chapters/235/book"},"data":{"id":"10","type":"books"}}},"links":{"self":"/v1/chapters/235"}},{"id":"236","type":"chapters","attributes":{"title":"Magic is Might","ordering":12,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/236/relationships/book","related":"/v1/chapters/236/book"},"data":{"id":"10","type":"books"}}},"links":{"self":"/v1/chapters/236"}},{"id":"237","type":"chapters","attributes":{"title":"The Muggle-Born Registration Commission","ordering":13,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/237/relationships/book","related":"/v1/chapters/237/book"},"data":{"id":"10","type":"books"}}},"links":{"self":"/v1/chapters/237"}},{"id":"238","type":"chapters","attributes":{"title":"The Thief","ordering":14,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/238/relationships/book","related":"/v1/chapters/238/book"},"data":{"id":"10","type":"books"}}},"links":{"self":"/v1/chapters/238"}},{"id":"239","type":"chapters","attributes":{"title":"The Goblin's Revenge","ordering":15,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/239/relationships/book","related":"/v1/chapters/239/book"},"data":{"id":"10","type":"books"}}},"links":{"self":"/v1/chapters/239"}},{"id":"240","type":"chapters","attributes":{"title":"Godric's Hollow","ordering":16,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/240/relationships/book","related":"/v1/chapters/240/book"},"data":{"id":"10","type":"books"}}},"links":{"self":"/v1/chapters/240"}},{"id":"241","type":"chapters","attributes":{"title":"Bathilda's Secret","ordering":17,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/241/relationships/book","related":"/v1/chapters/241/book"},"data":{"id":"10","type":"books"}}},"links":{"self":"/v1/chapters/241"}},{"id":"242","type":"chapters","attributes":{"title":"The Life and Lies of Albus Dumbledore","ordering":18,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/242/relationships/book","related":"/v1/chapters/242/book"},"data":{"id":"10","type":"books"}}},"links":{"self":"/v1/chapters/242"}},{"id":"243","type":"chapters","attributes":{"title":"The Silver Doe","ordering":19,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/243/relationships/book","related":"/v1/chapters/243/book"},"data":{"id":"10","type":"books"}}},"links":{"self":"/v1/chapters/243"}},{"id":"244","type":"chapters","attributes":{"title":"Xenophilius Lovegood","ordering":20,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/244/relationships/book","related":"/v1/chapters/244/book"},"data":{"id":"10","type":"books"}}},"links":{"self":"/v1/chapters/244"}},{"id":"245","type":"chapters","attributes":{"title":"The Tale of the Three Brothers","ordering":21,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/245/relationships/book","related":"/v1/chapters/245/book"},"data":{"id":"10","type":"books"}}},"links":{"self":"/v1/chapters/245"}},{"id":"246","type":"chapters","attributes":{"title":"The Deathly Hallows","ordering":22,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/246/relationships/book","related":"/v1/chapters/246/book"},"data":{"id":"10","type":"books"}}},"links":{"self":"/v1/chapters/246"}},{"id":"247","type":"chapters","attributes":{"title":"Malfoy Manor","ordering":23,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/247/relationships/book","related":"/v1/chapters/247/book"},"data":{"id":"10","type":"books"}}},"links":{"self":"/v1/chapters/247"}},{"id":"248","type":"chapters","attributes":{"title":"The Wandmaker","ordering":24,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/248/relationships/book","related":"/v1/chapters/248/book"},"data":{"id":"10","type":"books"}}},"links":{"self":"/v1/chapters/248"}},{"id":"249","type":"chapters","attributes":{"title":"Shell Cottage","ordering":25,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/249/relationships/book","related":"/v1/chapters/249/book"},"data":{"id":"10","type":"books"}}},"links":{"self":"/v1/chapters/249"}},{"id":"250","type":"chapters","attributes":{"title":"Gringotts","ordering":26,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/250/relationships/book","related":"/v1/chapters/250/book"},"data":{"id":"10","type":"books"}}},"links":{"self":"/v1/chapters/250"}},{"id":"251","type":"chapters","attributes":{"title":"The Final Hiding Place","ordering":27,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/251/relationships/book","related":"/v1/chapters/251/book"},"data":{"id":"10","type":"books"}}},"links":{"self":"/v1/chapters/251"}},{"id":"252","type":"chapters","attributes":{"title":"The Missing Mirror","ordering":28,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/252/relationships/book","related":"/v1/chapters/252/book"},"data":{"id":"10","type":"books"}}},"links":{"self":"/v1/chapters/252"}},{"id":"253","type":"chapters","attributes":{"title":"The Lost Diadem","ordering":29,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/253/relationships/book","related":"/v1/chapters/253/book"},"data":{"id":"10","type":"books"}}},"links":{"self":"/v1/chapters/253"}},{"id":"254","type":"chapters","attributes":{"title":"The Sacking of Severus Snape","ordering":30,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/254/relationships/book","related":"/v1/chapters/254/book"},"data":{"id":"10","type":"books"}}},"links":{"self":"/v1/chapters/254"}},{"id":"255","type":"chapters","attributes":{"title":"The Battle of Hogwarts","ordering":31,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/255/relationships/book","related":"/v1/chapters/255/book"},"data":{"id":"10","type":"books"}}},"links":{"self":"/v1/chapters/255"}},{"id":"256","type":"chapters","attributes":{"title":"The Elder Wand","ordering":32,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/256/relationships/book","related":"/v1/chapters/256/book"},"data":{"id":"10","type":"books"}}},"links":{"self":"/v1/chapters/256"}},{"id":"257","type":"chapters","attributes":{"title":"The Prince's Tale","ordering":33,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/257/relationships/book","related":"/v1/chapters/257/book"},"data":{"id":"10","type":"books"}}},"links":{"self":"/v1/chapters/257"}},{"id":"258","type":"chapters","attributes":{"title":"The Forest Again","ordering":34,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/258/relationships/book","related":"/v1/chapters/258/book"},"data":{"id":"10","type":"books"}}},"links":{"self":"/v1/chapters/258"}},{"id":"259","type":"chapters","attributes":{"title":"King's Cross","ordering":35,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/259/relationships/book","related":"/v1/chapters/259/book"},"data":{"id":"10","type":"books"}}},"links":{"self":"/v1/chapters/259"}},{"id":"260","type":"chapters","attributes":{"title":"The Flaw in the Plan","ordering":36,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/260/relationships/book","related":"/v1/chapters/260/book"},"data":{"id":"10","type":"books"}}},"links":{"self":"/v1/chapters/260"}},{"id":"271","type":"chapters","attributes":{"title":"An Unexpected Party","ordering":1,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/271/relationships/book","related":"/v1/chapters/271/book"},"data":{"id":"11","type":"books"}}},"links":{"self":"/v1/chapters/271"}},{"id":"272","type":"chapters","attributes":{"title":"Roast Mutton","ordering":2,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/272/relationships/book","related":"/v1/chapters/272/book"},"data":{"id":"11","type":"books"}}},"links":{"self":"/v1/chapters/272"}},{"id":"273","type":"chapters","attributes":{"title":"A Short Rest","ordering":3,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/273/relationships/book","related":"/v1/chapters/273/book"},"data":{"id":"11","type":"books"}}},"links":{"self":"/v1/chapters/273"}},{"id":"274","type":"chapters","attributes":{"title":"Over Hill And Under Hill","ordering":4,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/274/relationships/book","related":"/v1/chapters/274/book"},"data":{"id":"11","type":"books"}}},"links":{"self":"/v1/chapters/274"}},{"id":"275","type":"chapters","attributes":{"title":"Riddles In The Dark","ordering":5,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/275/relationships/book","related":"/v1/chapters/275/book"},"data":{"id":"11","type":"books"}}},"links":{"self":"/v1/chapters/275"}},{"id":"276","type":"chapters","attributes":{"title":"Out Of The Frying-Pan Into The Fire","ordering":6,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/276/relationships/book","related":"/v1/chapters/276/book"},"data":{"id":"11","type":"books"}}},"links":{"self":"/v1/chapters/276"}},{"id":"277","type":"chapters","attributes":{"title":"Queer Lodgings","ordering":7,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/277/relationships/book","related":"/v1/chapters/277/book"},"data":{"id":"11","type":"books"}}},"links":{"self":"/v1/chapters/277"}},{"id":"278","type":"chapters","attributes":{"title":"Flies And Spiders","ordering":8,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/278/relationships/book","related":"/v1/chapters/278/book"},"data":{"id":"11","type":"books"}}},"links":{"self":"/v1/chapters/278"}},{"id":"279","type":"chapters","attributes":{"title":"Barrels Out Of Bond","ordering":9,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/279/relationships/book","related":"/v1/chapters/279/book"},"data":{"id":"11","type":"books"}}},"links":{"self":"/v1/chapters/279"}},{"id":"280","type":"chapters","attributes":{"title":"A Warm Welcome","ordering":10,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/280/relationships/book","related":"/v1/chapters/280/book"},"data":{"id":"11","type":"books"}}},"links":{"self":"/v1/chapters/280"}},{"id":"281","type":"chapters","attributes":{"title":"On The Doorstep","ordering":11,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/281/relationships/book","related":"/v1/chapters/281/book"},"data":{"id":"11","type":"books"}}},"links":{"self":"/v1/chapters/281"}},{"id":"282","type":"chapters","attributes":{"title":"Inside Information","ordering":12,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/282/relationships/book","related":"/v1/chapters/282/book"},"data":{"id":"11","type":"books"}}},"links":{"self":"/v1/chapters/282"}},{"id":"283","type":"chapters","attributes":{"title":"Not At Home","ordering":13,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/283/relationships/book","related":"/v1/chapters/283/book"},"data":{"id":"11","type":"books"}}},"links":{"self":"/v1/chapters/283"}},{"id":"284","type":"chapters","attributes":{"title":"Fire And Water","ordering":14,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/284/relationships/book","related":"/v1/chapters/284/book"},"data":{"id":"11","type":"books"}}},"links":{"self":"/v1/chapters/284"}},{"id":"285","type":"chapters","attributes":{"title":"The Gathering Of The Clouds","ordering":15,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/285/relationships/book","related":"/v1/chapters/285/book"},"data":{"id":"11","type":"books"}}},"links":{"self":"/v1/chapters/285"}},{"id":"286","type":"chapters","attributes":{"title":"A Thief In The Night","ordering":16,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/286/relationships/book","related":"/v1/chapters/286/book"},"data":{"id":"11","type":"books"}}},"links":{"self":"/v1/chapters/286"}},{"id":"287","type":"chapters","attributes":{"title":"The Clouds Burst","ordering":17,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/287/relationships/book","related":"/v1/chapters/287/book"},"data":{"id":"11","type":"books"}}},"links":{"self":"/v1/chapters/287"}},{"id":"288","type":"chapters","attributes":{"title":"The Return Journey","ordering":18,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/288/relationships/book","related":"/v1/chapters/288/book"},"data":{"id":"11","type":"books"}}},"links":{"self":"/v1/chapters/288"}},{"id":"289","type":"chapters","attributes":{"title":"The Last Stage","ordering":19,"created_at":"2017-01-07 18:16:44","updated_at":"2017-01-07 18:16:44"},"relationships":{"book":{"links":{"self":"/v1/chapters/289/relationships/book","related":"/v1/chapters/289/book"},"data":{"id":"11","type":"books"}}},"links":{"self":"/v1/chapters/289"}}]}
2 |
--------------------------------------------------------------------------------