$ git clone
$ npm install
$ npm run client-dev
RUN IN DEV MODE WITH NODEMON
$ npm run server-dev
/app-hrsei-api.herokuapp.com/api/fec2/hr-rfe/
Authorization: <GitHub Token>
Parameter
Type
Description
page
int
Selects the page of results to return. Default 1
count
int
Specifies how many results per page to return. Default 5
Response 200 (application/json)
[
{
"id" : 1 ,
"name" : " Camo Onesie" ,
"slogan" : " Blend in to your crowd" ,
"description" : " The So Fatigues will wake you up and fit you in. This high energy camo will have you blending in to even the wildest surroundings." ,
"category" : " Jackets" ,
"default_price" : " 140"
},
{
"id" : 2 ,
"name" : " Bright Future Sunglasses" ,
"slogan" : " You've got to wear shades" ,
"description" : " Where you're going you might not need roads, but you definitely need some shades. Give those baby blues a rest and let the future shine bright on these timeless lenses." ,
"category" : " Accessories" ,
"default_price" : " 69"
},
{
"id" : 3 ,
"name" : " Morning Joggers" ,
"slogan" : " Make yourself a morning person" ,
"description" : " Whether you're a morning person or not. Whether you're gym bound or not. Everyone looks good in joggers." ,
"category" : " Pants" ,
"default_price" : " 40"
},
// ...
]
GET /products/:product_id
Parameter
Type
Description
product_id
int
Requires ID of product requested
Response 200 (application/json)
{
"id" : 11 ,
"name" : " Air Minis 250" ,
"slogan" : " Full court support" ,
"description" : " This optimized air cushion pocket reduces impact but keeps a perfect balance underfoot." ,
"category" : " Basketball Shoes" ,
"default_price" : " 0" ,
"features" : [
{
"feature" : " Sole" ,
"value" : " Rubber"
},
{
"feature" : " Material" ,
"value" : " FullControlSkin"
},
// ...
],
}
GET /products/:product_id/styles
Parameter
Type
Description
product_id
int
Requires ID of product requested
Response 200 (application/json)
{
"product_id" : " 1" ,
"results" : [
{
"style_id" : 1 ,
"name" : " Forest Green & Black" ,
"original_price" : " 140" ,
"sale_price" : " 0" ,
"default?" : true ,
"photos" : [
{
"thumbnail_url" : " urlplaceholder/style_1_photo_number_thumbnail.jpg" ,
"url" : " urlplaceholder/style_1_photo_number.jpg"
},
{
"thumbnail_url" : " urlplaceholder/style_1_photo_number_thumbnail.jpg" ,
"url" : " urlplaceholder/style_1_photo_number.jpg"
}
// ...
],
"skus" : {
"37" : {
"quantity" : 8 ,
"size" : " XS"
},
"38" : {
"quantity" : 16 ,
"size" : " S"
},
"39" : {
"quantity" : 17 ,
"size" : " M"
},
//...
}
},
{
"style_id" : 2 ,
"name" : " Desert Brown & Tan" ,
"original_price" : " 140" ,
"sale_price" : " 0" ,
"default?" : false ,
"photos" : [
{
"thumbnail_url" : " urlplaceholder/style_2_photo_number_thumbnail.jpg" ,
"url" : " urlplaceholder/style_2_photo_number.jpg"
}
// ...
],
"skus" : {
"37" : {
"quantity" : 8 ,
"size" : " XS"
},
"38" : {
"quantity" : 16 ,
"size" : " S"
},
"39" : {
"quantity" : 17 ,
"size" : " M"
},
//...
}
},
// ...
}
GET /products/:product_id/related
Parameter
Type
Description
product_id
int
Requires ID of product requested
Response 200 (application/json)
Parameter
Type
Description
page
int
Selects the page of results to return. Default 1
count
int
Specifies how many results per page to return. Default 5
sort
text
Changes the sort order of reviews to be based on "newest", "helpful", or "relevant"
product_id
int
Specifies the product for which to retrieve reviews.
Response 200 (application/json)
{
"product" : " 2" ,
"page" : 0 ,
"count" : 5 ,
"results" : [
{
"review_id" : 5 ,
"rating" : 3 ,
"summary" : " I'm enjoying wearing these shades" ,
"recommend" : false ,
"response" : null ,
"body" : " Comfortable and practical." ,
"date" : " 2019-04-14T00:00:00.000Z" ,
"reviewer_name" : " shortandsweeet" ,
"helpfulness" : 5 ,
"photos" : [{
"id" : 1 ,
"url" : " urlplaceholder/review_5_photo_number_1.jpg"
},
{
"id" : 2 ,
"url" : " urlplaceholder/review_5_photo_number_2.jpg"
},
// ...
]
},
{
"review_id" : 3 ,
"rating" : 4 ,
"summary" : " I am liking these glasses" ,
"recommend" : false ,
"response" : " Glad you're enjoying the product!" ,
"body" : " They are very dark. But that's good because I'm in very sunny spots" ,
"date" : " 2019-06-23T00:00:00.000Z" ,
"reviewer_name" : " bigbrotherbenjamin" ,
"helpfulness" : 5 ,
"photos" : [],
},
// ...
]
}
Parameter
Type
Description
product_id
int
Requires ID of product requested
Response 200 (application/json)
{
"product_id" : " 2" ,
"ratings" : {
2 : 1,
3 : 1,
4 : 2,
// ...
},
"recommended" : {
0 : 5
// ...
},
"characteristics" : {
"Size" : {
"id" : 14 ,
"value" : " 4.0000"
},
"Width" : {
"id" : 15 ,
"value" : " 3.5000"
},
"Comfort" : {
"id" : 16 ,
"value" : " 4.0000"
},
// ...
}
Parameter
Type
Description
product_id
int
Requires ID of product requested
rating
int
Integer (1-5) indicating the review rating
summary
text
Summary text of the review
body
text
Continued text of the review
recommend
bool
Value indicating if the reviewer recommends the product
name
text
Username for question asker
email
text
Email address for question asker
photos
[text]
Array of text urls that link to images to be shown
characteristics
object
Object of keys representing characteristic_id and values representing the review value for that characteristic. { "14": 5, "15": 5 //...}
PUT /reviews/:review_id/helpful
Parameter
Type
Description
review_id
int
Required ID of the review to update
PUT /reviews/:review_id/report
Parameter
Type
Description
review_id
int
Required ID of the review to update
Parameter
Type
Description
product_id
int
Specifies the product for which to retrieve questions.
page
int
Selects the page of results to return. Default 1
count
int
Specifies how many results per page to return. Default 5
Response 200 (application/json)
{
"product_id" : " 5" ,
"results" : [{
"question_id" : 37 ,
"question_body" : " Why is this product cheaper here than other sites?" ,
"question_date" : " 2018-10-18T00:00:00.000Z" ,
"asker_name" : " williamsmith" ,
"question_helpfulness" : 4 ,
"reported" : false ,
"answers" : {
68 : {
"id" : 68 ,
"body" : " We are selling it here without any markup from the middleman!" ,
"date" : " 2018-08-18T00:00:00.000Z" ,
"answerer_name" : " Seller" ,
"helpfulness" : 4 ,
"photos" : []
// ...
}
}
},
{
"question_id" : 38 ,
"question_body" : " How long does it last?" ,
"question_date" : " 2019-06-28T00:00:00.000Z" ,
"asker_name" : " funnygirl" ,
"question_helpfulness" : 2 ,
"reported" : false ,
"answers" : {
70 : {
"id" : 70 ,
"body" : " Some of the seams started splitting the first time I wore it!" ,
"date" : " 2019-11-28T00:00:00.000Z" ,
"answerer_name" : " sillyguy" ,
"helpfulness" : 6 ,
"photos" : [],
},
78 : {
"id" : 78 ,
"body" : " 9 lives" ,
"date" : " 2019-11-12T00:00:00.000Z" ,
"answerer_name" : " iluvdogz" ,
"helpfulness" : 31 ,
"photos" : [],
}
}
},
// ...
]
}
GET /qa/questions/:question_id/answers
Parameter
Type
Description
question_id
int
Required ID of the question for wich answers are needed
page
int
Selects the page of results to return. Default 1
count
int
Specifies how many results per page to return. Default 5
Response 200 (application/json)
{
"question" : " 1" ,
"page" : 0 ,
"count" : 5 ,
"results" : [
{
"answer_id" : 8 ,
"body" : " What a great question!" ,
"date" : " 2018-01-04T00:00:00.000Z" ,
"answerer_name" : " metslover" ,
"helpfulness" : 8 ,
"photos" : [],
},
{
"answer_id" : 5 ,
"body" : " Something pretty durable but I can't be sure" ,
"date" : " 2018-01-04T00:00:00.000Z" ,
"answerer_name" : " metslover" ,
"helpfulness" : 5 ,
"photos" : [{
"id" : 1 ,
"url" : " urlplaceholder/answer_5_photo_number_1.jpg"
},
{
"id" : 2 ,
"url" : " urlplaceholder/answer_5_photo_number_2.jpg"
},
// ...
]
},
// ...
]
}
Parameter
Type
Description
product_id
int
Required ID of the Product for which the question is posted
body
text
Continued text of the review
name
text
Username for question asker
email
text
Email address for question asker
POST /qa/questions/:question_id/answers
Parameter
Type
Description
question_id
int
Required ID of the question to post the answer for
body
text
Continued text of the review
name
text
Username for question asker
email
text
Email address for question asker
photos
[text]
An array of urls corresponding to images to display
PUT /qa/questions/:question_id/helpful
Parameter
Type
Description
question_id
int
Required ID of the question to update
PUT /qa/questions/:question_id/report
Parameter
Type
Description
question_id
int
Required ID of the question to update
PUT /qa/answers/:answer_id/helpful
Parameter
Type
Description
answer_id
int
Required ID of the answer to update
PUT /qa/answers/:answer_id/report
Parameter
Type
Description
answer_id
int
Required ID of the answer to update
Parameter
Type
Description
element
string
Required. Selector for the element which was clicked
widget
string
Required. Name of the module/widget in which the click occured
time
string
Required. Time the interaction occurred