This document describes the information that the API returns.
All response that the API returns will be in JSON format and will have the following base shape:
{
"self": <url>,
"meta": {...},
"links": {...},
"rel": <string>,
"spec": <url>,
}
An entity represents an item on the database, this could be a brand, a model, a size, a user, etc. It refers to an individual thing.
Entities have the same base attributes described above but have these defined values:
{
"rel": "entity",
"meta": {
"collection": <url>
},
"body": {...}
}
entity
, this is how you should detect that you've received an entity and should look for the body
attribute to read this entity's detailed attributes.collection
that will contain the URL to the canonical collection where this entity is listed, in the case of an individual brand, you will the URL for the collection of brands. If the resource is accessible from more than one collection, you will only get one of the collections, the canonical which will remain the same.Collections refer to lists of entities, this is where you will be able to browse and navigate to a given entity.
On top of the base attributes they will have these characteristics:
{
"rel": "collection",
"meta": {
"page_total": <int>,
"paginated": <bool>,
"next": <url>,
"current": <url>,
"collection_total": <int>,
"prev": <url>
},
"collection": [...]
}
collection
, this is how you tell a collection. href
link with the URL to the entity's detail endpoint. Each element on the collection may contain more attributes to help quickly describe each item.