1.0.44 • Published 7 years ago

plasma-reviews-api-client-js v1.0.44

Weekly downloads
2
License
MIT
Repository
github
Last release
7 years ago

Reviews

Kind: global class

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]);

reviews.getReviews(params) ⇒ Object

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"}} }, ... }

ParamTypeDescription
paramsObjectReviews parameters

reviews.getReviewsUser(token, params) ⇒ Object

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"}} }, ... }

ParamTypeDescription
tokenStringAccess token
paramsObjectReviews parameters

reviews.getReviewsUser(params) ⇒ Object

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"}} }, ... }

ParamTypeDescription
paramsObjectReviews parameters

reviews.approveReview(token, id) ⇒ Object

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"}} } }

ParamTypeDescription
tokenStringAccess token
idNumberReview id

reviews.completeReview(token, id, params) ⇒ Object

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"}} } }

ParamTypeDescription
tokenStringAccess token
idNumberReview id
paramsObjectReviews parameters

reviews.declineReview(token, id) ⇒ Object

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"}} } }

ParamTypeDescription
tokenStringAccess token
idNumberReview id

reviews.addReviewVote(token, id, params) ⇒ Object

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"}} } }

ParamTypeDescription
tokenStringAccess token
idNumberReview id
paramsObjectReviews votes parameters

reviews.replayTheReview(token, review_id, params) ⇒ Object

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"}} } }

ParamTypeDescription
tokenStringAccess token
review_idNumberID of the parent review
paramsObjectBody parameters

reviews.requestReviewComments(review_id) ⇒ Object

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"}} } }

ParamTypeDescription
review_idNumberID of the parent review

reviews.voteComments(token, id, review_id) ⇒ Object

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"}} } }

ParamTypeDescription
tokenStringAccess token
idNumberID of the comment
review_idNumberID of the parent review

reviews.addComment(token, params) ⇒ Object

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"}} }

ParamTypeDescription
tokenStringAccess token
paramsObjectBody parameters

reviews.addReviewVote(token, id, params) ⇒ Object

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"}} } }

ParamTypeDescription
tokenStringAccess token
idNumberComment id
paramsObjectComment votes parameters
1.0.44

7 years ago

1.0.43

7 years ago

1.0.42

7 years ago

1.0.41

7 years ago

1.0.40

7 years ago

1.0.39

7 years ago

1.0.38

7 years ago

1.0.37

7 years ago

1.0.36

7 years ago

1.0.35

7 years ago

1.0.34

7 years ago

1.0.33

7 years ago

1.0.32

7 years ago

1.0.31

7 years ago

1.0.30

7 years ago

1.0.29

7 years ago

1.0.28

7 years ago

1.0.27

7 years ago

1.0.26

7 years ago

1.0.25

7 years ago

1.0.24

7 years ago

1.0.23

7 years ago

1.0.22

7 years ago

1.0.21

7 years ago

1.0.20

7 years ago

1.0.19

7 years ago

1.0.18

7 years ago

1.0.17

7 years ago

1.0.16

7 years ago

1.0.15

7 years ago

1.0.14

7 years ago

1.0.13

7 years ago

1.0.12

7 years ago

1.0.11

7 years ago

1.0.10

7 years ago

1.0.9

7 years ago

1.0.8

7 years ago