This package has been deprecated

Author message:

Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

plasma-reviews-api-client-js

1.0.44 • Public • Published

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

Param Type Description
params Object Reviews 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"}}
}, ...]
}

Param Type Description
token String Access token
params Object Reviews 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"}}
}, ...]
}

Param Type Description
params Object Reviews 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"}}
}
}

Param Type Description
token String Access token
id Number Review 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"}}
}
}

Param Type Description
token String Access token
id Number Review id
params Object Reviews 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"}}
}
}

Param Type Description
token String Access token
id Number Review 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"}}
}
}

Param Type Description
token String Access token
id Number Review id
params Object Reviews 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"}}
}
}

Param Type Description
token String Access token
review_id Number ID of the parent review
params Object Body 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"}}
}
}

Param Type Description
review_id Number ID 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"}} } }

Param Type Description
token String Access token
id Number ID of the comment
review_id Number ID 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"}}
}

Param Type Description
token String Access token
params Object Body 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"}}
}
}

Param Type Description
token String Access token
id Number Comment id
params Object Comment votes parameters

Dependents (1)

Package Sidebar

Install

npm i plasma-reviews-api-client-js

Weekly Downloads

0

Version

1.0.44

License

MIT

Last publish

Collaborators

  • alienmonster
  • ch-tm
  • stevenreed
  • viram