Reviews
Kind: global class
- Reviews
- new Reviews()
- .getReviews(params) ⇒
Object
- .getReviewsUser(token, params) ⇒
Object
- .getReviewsUser(params) ⇒
Object
- .approveReview(token, id) ⇒
Object
- .completeReview(token, id, params) ⇒
Object
- .declineReview(token, id) ⇒
Object
- .addReviewVote(token, id, params) ⇒
Object
- .replayTheReview(token, review_id, params) ⇒
Object
- .requestReviewComments(review_id) ⇒
Object
- .voteComments(token, id, review_id) ⇒
Object
- .addComment(token, params) ⇒
Object
- .addReviewVote(token, id, params) ⇒
Object
new Reviews()
Reviews API JS client.
In order to use Reviews API you should create an instance of this class.
import Reviews from "tm-reviews-api-client-js";
const reviews = new Reviews ('http://api.templatemonster.com/reviews/v1', 'en');
const list = reviews.getReviews ([12345, 55555]);
Object
reviews.getReviews(params) ⇒ Return review information for given identifiers.
Kind: instance method of Reviews
Returns: Object
-
{ "currentPageIndex":1, "totalCount":11, "lastPageIndex":6, "items": [ { "id":23, "status":4, "user_id":21543, "user_name":"mice mice", "title":"review title", "content":"review content", "score":5, "template_id":58444, "vote_up":0, "vote_down":0, "_links":{"self":{"href":"http://service-reviews.dev/api/v1/reviews/23"}} }, ...] }
Param | Type | Description |
---|---|---|
params | Object |
Reviews parameters |
Object
reviews.getReviewsUser(token, params) ⇒ Return review information for given identifiers. (user mode)
Kind: instance method of Reviews
Returns: Object
-
{ "currentPageIndex":1, "totalCount":11, "lastPageIndex":6, "items": [ { "id":23, "status":4, "user_id":21543, "user_name":"mice mice", "title":"review title", "content":"review content", "score":5, "template_id":58444, "vote_up":0, "vote_down":0, "_links":{"self":{"href":"http://service-reviews.dev/api/v1/reviews/23"}} }, ...] }
Param | Type | Description |
---|---|---|
token | String |
Access token |
params | Object |
Reviews parameters |
Object
reviews.getReviewsUser(params) ⇒ Return vendors reviews for given identifiers.
Kind: instance method of Reviews
Returns: Object
-
{ "currentPageIndex":1, "totalCount":11, "lastPageIndex":6, "items": [ { "id":23, "status":4, "user_id":21543, "user_name":"mice mice", "title":"review title", "content":"review content", "score":5, "template_id":58444, "vote_up":0, "vote_down":0, "_links":{"self":{"href":"http://service-reviews.dev/api/v1/reviews/23"}} }, ...] }
Param | Type | Description |
---|---|---|
params | Object |
Reviews parameters |
Object
reviews.approveReview(token, id) ⇒ Return approve review information for given identifiers.
Kind: instance method of Reviews
Returns: Object
-
{ "canModerate": 1, "items": { "id": 1, "title": "Really good. Html is better than cms", "content": "I had font problem with flash cms. Now I have no problem with html", "score": 5, "created_at": 1469607948519, "user_id": 123, "template_id": 12345, "status": "initial", "vote_up": 1, "vote_down": 0, "_links": {"self":{"href":"http://service-reviews.dev/api/v1/reviews/1"}} } }
Param | Type | Description |
---|---|---|
token | String |
Access token |
id | Number |
Review id |
Object
reviews.completeReview(token, id, params) ⇒ Return complete review information for given identifiers.
Kind: instance method of Reviews
Returns: Object
-
{ "canModerate": 1, "items": { "id": 1, "title": "Really good. Html is better than cms", "content": "I had font problem with flash cms. Now I have no problem with html", "score": 5, "created_at": 1469607948519, "user_id": 123, "template_id": 12345, "status": "initial", "vote_up": 1, "vote_down": 0, "_links": {"self":{"href":"http://service-reviews.dev/api/v1/reviews/1"}} } }
Param | Type | Description |
---|---|---|
token | String |
Access token |
id | Number |
Review id |
params | Object |
Reviews parameters |
Object
reviews.declineReview(token, id) ⇒ Return decline review information for given identifiers.
Kind: instance method of Reviews
Returns: Object
-
{ "canModerate": 1, "items": { "id": 1, "title": "Really good. Html is better than cms", "content": "I had font problem with flash cms. Now I have no problem with html", "score": 5, "created_at": 1469607948519, "user_id": 123, "template_id": 12345, "status": "initial", "vote_up": 1, "vote_down": 0, "_links": {"self":{"href":"http://service-reviews.dev/api/v1/reviews/1"}} } }
Param | Type | Description |
---|---|---|
token | String |
Access token |
id | Number |
Review id |
Object
reviews.addReviewVote(token, id, params) ⇒ Return added votes for the review: increment vote_up or vote_down field.
Kind: instance method of Reviews
Returns: Object
-
{ "canModerate": 1, "items": { "id": 1, "title": "Really good. Html is better than cms", "content": "I had font problem with flash cms. Now I have no problem with html", "score": 5, "created_at": 1469607948519, "user_id": 123, "template_id": 12345, "status": "initial", "vote_up": 1, "vote_down": 0, "_links": {"self":{"href":"http://service-reviews.dev/api/v1/reviews/1"}} } }
Param | Type | Description |
---|---|---|
token | String |
Access token |
id | Number |
Review id |
params | Object |
Reviews votes parameters |
Object
reviews.replayTheReview(token, review_id, params) ⇒ Return reply of the review information for given identifiers.
Kind: instance method of Reviews
Returns: Object
-
{ "canModerate": 1, "items": { "id": 1, "review_id": 1, "content": "I had font problem with flash cms. Now I have no problem with html", "created_at": 1469607948519, "user_id": 123, "vote_up": 0, "vote_down": 0, "_links": {"self":{"href":"http://service-reviews.dev/api/v1/reviews/1/comment/1"}} } }
Param | Type | Description |
---|---|---|
token | String |
Access token |
review_id | Number |
ID of the parent review |
params | Object |
Body parameters |
Object
reviews.requestReviewComments(review_id) ⇒ Return request review comments list.
Kind: instance method of Reviews
Returns: Object
-
{ "canModerate": 1, "items": { "id": 1, "review_id": 1, "content": "I had font problem with flash cms. Now I have no problem with html", "created_at": 1469607948519, "user_id": 123, "vote_up": 0, "vote_down": 0, "_links": {"self":{"href":"http://service-reviews.dev/api/v1/reviews/1/comment/1"}} } }
Param | Type | Description |
---|---|---|
review_id | Number |
ID of the parent review |
Object
reviews.voteComments(token, id, review_id) ⇒ Return votes of the review.
Kind: instance method of Reviews
Returns: Object
-
{ "canModerate": 1, "items": {
"id": 1, "review_id": 1, "content": "I had font problem with flash cms. Now I have no problem with html", "created_at": 1469607948519, "user_id": 123, "vote_up": 0, "vote_down": 0, "_links": {"self":{"href":"http://service-reviews.dev/api/v1/reviews/1/comment/1"}} } }
Param | Type | Description |
---|---|---|
token | String |
Access token |
id | Number |
ID of the comment |
review_id | Number |
ID of the parent review |
Object
reviews.addComment(token, params) ⇒ Add new QA
Kind: instance method of Reviews
Returns: Object
-
{ "canModerate": 1, "items": { "id": 1, "status": "pending", "user_id": 12345, "user_name": "John Doe", "user_email": "jho***@gmail.com", "content": "I had font problem with flash cms. Now I have no problem with html", "template_id": 55555, "created_at": 1469607948519, "updated_at": 1469607948519, "vote_up": 0, "vote_down": 0, "locale": "en", "author": "moderator" "_links": {"self":{"href":"http://service-reviews.dev/api/v1/qas/1"}} }
Param | Type | Description |
---|---|---|
token | String |
Access token |
params | Object |
Body parameters |
Object
reviews.addReviewVote(token, id, params) ⇒ Return added votes for the comment: increment vote_up or vote_down field.
Kind: instance method of Reviews
Returns: Object
-
{ "canModerate": 1, "items": { "id": 1, "status": "pending", "user_id": 12345, "user_name": "John Doe", "user_email": "jho***@gmail.com", "content": "I had font problem with flash cms. Now I have no problem with html", "template_id": 55555, "created_at": 1469607948519, "updated_at": 1469607948519, "vote_up": 0, "vote_down": 0, "locale": "en", "author": "moderator" "_links": {"self":{"href":"http://service-reviews.dev/api/v1/qas/1"}} } }
Param | Type | Description |
---|---|---|
token | String |
Access token |
id | Number |
Comment id |
params | Object |
Comment votes parameters |