Included in this repo is an example JSON block that contains the ideal data structure for our frontend execution. Note that it is not valid JSON. We are utilizing ...
to indicate that additional entries would be here.
Ideally we will call 7 separate endpoints for all the needed data, ingesting that into a relational database on our side.
On this v2 version, we will have the following sections as headings/tabs on the website: Business Category
, Products
, Product Categories
, Programs
, Live Animals
. We will build up the displayed data on the frontend as a direct correlation from the responses we get from the endpoint. We expect any data within the results to be active.
All data returned from the endpoint will be considered active
and ready to be displayed on the website. Thus we have removed all status
blocks from our example JSON.
We will be wholesale replacing the data every time we pull from the API endpoint.
Let us know if there are any questions.
- All business data should be un-nested, at the top-most level in the JSON object.
- All
addresses
,business_categories
,products
,product_categories
,programs
,live_animals
,programs
data within thebusinesses
endpoint should be anarray
ofintegers
that represent the cooresponding ID of the associated entry. - We only need the top-most level of data within each section. IE) we only need the
product
data. We do not need that products'product_category
orproduct_category_type
as a child of that product - If a business doesn't have a section, IE)
live_animals
it should still contain that key with an empty array as it's value - The individual entries from the
addresses
,business_categories
,products
,product_categories
,programs
,live_animals
,programs
endpoints should be an array of objects.
- All keys should be in
snake_case
- All keys should be wrapped in double quotes. IE)
"key_name_here": value
- All empty values should be
null
id
fields should beintegers
longitude
&latitude
should befloats
- boolean values should be represented by
true
andfalse
. Please do not use strings as we utilize strict comparision.
- Remove
(live)
from the JSON response on any entries related to live animals onproduct_categories
. They will be in their ownLive Animals
section doing forward so that information is redundant to the end user. - Please use the following formatting for
Live Animal
entries:products.name
—product_categories.name
—products.type
. IE)Breeding Stock
—Sheep
—Hamphire
. If any of the entries after theproducts.name
does not exist, please do not include the dash or entry. IE)Breeding stock
—Spanish Goats
We included our ideal pagination block below if/when it's needed.
"pagination": {
"total": 360,
"count": 10,
"per_page": 10,
"current_page": 1,
"total_pages": 36
}