- Emplea HAL para la descripción de contenidos: https://dzone.com/articles/introduction-hypertext-0
- Tiene Basic HTTP Auth y Cookie Authentication
- Por defecto, permite operaciones: GET (lectura), POST (creación), PATCH (actualizar), y DELETE (borrar).
- Instalar módulos del core: HAL, HTTP Basic Authentication, RESTful Web Services, Serialization
- Instalar módulos contribuidos (opcional): REST UI. Este módulo provee una UI para habilitar y desabilitar recursos, adminsitrar los formatos de serialización y Auth providers.
- Crear un rol: por ej.
API user
- Setear permisos para el rol:
- Anonymous: GET
- Authenticated User: GET, DELETE, POST, PATCH
- Crear usuario: por ej.
API_consumer/API_consumer
- Setear permisos sobre el contenido que se desea manejar: ej. Basic Page.
- Demo time
hypermedia driven: The rationale behind this principle is that all possible operations with the resource can be discovered without the need of any out-of-band documentation and if some URI changes, there is no need to change the client as it is server's responsibility to generate URIs and insert them into representations.
Hypertext Application Language (HAL) is one possible recipe how to do design representations with links. In particular, it describes how to design JSON representations.
There is a convenient way to tell whether an API is RESTful or not. A so-called Richardson Maturity Model (RMM) was introduced by Leonard Richardson in his 2008 QCon talk and later popularized by Martin Fowler. The model introduces four levels of API maturity starting from Level 0, so that at level two each resource is not only identified by its own URI, but all operations with resources are done using HTTP methods like GET, PUT etc.
{
"_links":{
"self":{
"href":"/book/123"
},
"curries":[
{
"name":"ns",
"href":"http://booklistapi.com/rels/{rel}",
"templated":true
}
],
"ns:authors":[
{
"href":"/author/4554",
"title":"Leonard Richardson"
},
{
"href":"/author/5758",
"title":"Mike Amundsen"
},
{
"href":"/author/6853",
"title":"Sam Ruby"
}
]
},
"Title":"RESTful Web APIs",
"Price":"$31.92",
"Paperback":"408 pages",
"Language":"English"
}