= Grails RESTful Notes API Guide
Andy Wilkinson; Jenn Strater
:doctype: book
:icons: font
:source-highlighter: highlightjs
:toc: left
:toclevels: 4
:sectlinks:
:operation-curl-request-title: Example request
:operation-http-response-title: Example response

[[overview]]
= Overview

[[overview-http-verbs]]
== HTTP verbs

Grails RESTful notes tries to adhere as closely as possible to standard HTTP and REST conventions in its
use of HTTP verbs.

|===
| Verb | Usage

| `GET`
| Used to retrieve a resource

| `POST`
| Used to create a new resource

| `PATCH`
| Used to update an existing resource, including partial updates

| `DELETE`
| Used to delete an existing resource
|===

[[overview-http-status-codes]]
== HTTP status codes

Grails RESTful notes tries to adhere as closely as possible to standard HTTP and REST conventions in its
use of HTTP status codes.

|===
| Status code | Usage

| `200 OK`
| The request completed successfully

| `201 Created`
| A new resource has been created successfully. The resource's URI is available from the response's
`Location` header

| `204 No Content`
| An update to an existing resource has been applied successfully

| `400 Bad Request`
| The request was malformed. The response body will include an error providing further information

| `404 Not Found`
| The requested resource did not exist
|===

[[resources]]
= Resources



[[resources-notes]]
== Notes

The Notes resources is used to create and list notes



[[resources-notes-list]]
=== Listing notes

A `GET` request will list all of the service's notes.

operation::notes-list-example[snippets='response-fields,curl-request,http-response']



[[resources-notes-create]]
=== Creating a note

A `POST` request is used to create a note

operation::notes-create-example[snippets='request-fields,curl-request,http-response']



[[resources-note-retrieve]]
=== Retrieve a note

A `GET` request will retrieve the details of a note

operation::note-get-example[snippets='response-fields,curl-request,http-response']
