-
Notifications
You must be signed in to change notification settings - Fork 0
Home
oyvindfanebust edited this page Sep 22, 2014
·
7 revisions
hyperfriendly+json is a simple and extensible hypermedia format adding links to JSON object.
This resource has a single property hello and a single self link.
{
"_links": {
"self": { "href": "http://api.example.org/hello" }
},
"hello": "hyperfriendly+json"
}If you want, you can add several links to the same rel. Here is a resource that links to multiple authors.
{
"_links": {
"author": [
{ "href": "http://api.example.org/oyvind" },
{ "href": "http://api.example.org/nils" }
]
}
}Links can contain link profiles that add semantics to the link. This link implements the method hint profile.
{
"_links": {
"create_foo": {
"href": "http://api.example.org/oyvind",
"linkProfiles": [ "http://profiles.hyperfriendly.net/method-hint" ],
"method": "POST"
}
}
}Resources can also implement profiles by adding a rel profile with a link to one or more profiles. The following is an error resource.
{ "_links" : { "profile": "http://profiles.hyperfriendly.net/error" }, "_errors": [ { "_links": { "self": { "href": "http://api.example.org/some-error" } }, "title": "Some error", "message": "Some error has occurred" } ] }
- Home
- Link profiles
- Templated link
- Method hint
- JSON Schema
- Resource profiles
- Collection
- Error
- Feed