WHL Documents
A WHL Document has the
media type "application/vnd.whl.{ressource-name}.json+{version}".
an example of a shops ressource would be
application/vnd.whl.shops.json+v1
The Resource Object could look like this:
GET /shops/filter-country/US HTTP/1.1
Host: accounts-api.widex.com
Accept: application/vnd.whl.shops.json+v1
HTTP/1.1 200 OK
Content-Type: application/vnd.whl.shops.json+v1
{
shops: [
{
id: "758E2CE6-91E9-E411-8103-C4346BADA21C",
priority: 0,
title: "HEAR-WELL CENTER - LONG BEACH",
latitude: 338226907,
longitude: -1181895396,
addressLine1: "3605 LONG BEACH BLVD, SUITE 110",
postalCode: "90807",
city: "LONG BEACH",
state: "CA",
country: "US",
_links: [
{
rel: "http://accounts-api.widex.com/api/global/shop/definition",
href: "http://accounts-api.widex.com/api/global/shops/758E2CE6-91E9-E411-8103-C4346BADA21C",
type: "application/vnd.whl.shop.json+v1"
method: "GET"
}
]
}],
_links: [
{
rel: "self",
href: "http://accounts-api.widex.com/api/global/shops/filter-country/US",
type: "application/vnd.whl.shops.json+v1"
method: "GET"
},
{
rel: "next",
href: "http://accounts-api.widex.com/api/global/shops/filter-country/{country}",
method: "GET",
parameters: {
limit: "10"
}
},
{
name: "shops-filter-country",
rel: "/api/global/shops/definition#filter-country",
href: "/api/global/shops/filter-country/{country}",
method: "GET"
},
{
name: "shops-filter-city",
rel: "/api/global/shops/definition#filter-city",
href: "/api/global/shops/filter-city/{city}",
method: "GET"
},
{
name: "shops-filter-postalcode",
rel: "/api/global/shops/defintition#filter-postalcode",
href: "/api/global/shops/filter-postalcode/{postalcode}",
method: "GET"
}
]
}
Here, we have a WHL shops document representing shops resource filtered by US with the
URI "/shops/filter-country/US". It has "shops-filter-country", "shops-filter-city", "shops-filter-postalcode" links, and its own state in the form of collection of shops.