Skip to content
Steren edited this page Aug 9, 2011 · 4 revisions

agree

agree(String id)
The current user agree a given insight
Authentication required
response: {id, updatedAgreeCount, updatedDisagreeCount, voteState}

Parameters:
id - : unique ID of this insight

categories

categories()
Get a list of all the categories
response: [{label, id}, ...]


comments

comments(String id)
Get a list of all the comments for a given insight
response: [{author, creationDate, content}, ...]

Parameters:
id -

create

create(String content,
                          java.util.Date endDate,
                          String tagList,
                          long category,
                          String lang,
                          String vote)
The current user creates an insight
response: same than show.

Parameters:
content - : the content of this insight (min 6, max 120 characters) (Required)
endDate - : the end date chosen by the user (format: "yyyy-MM-dd") (Required)
tagList - : a comma separated list of tags (example: "apple,iphone,ios")
category - : the id of the category of the insight (Required)
lang - : the language in which the insight is written ["en", "fr"]
vote - : ["agree", "disagree", "non-voted"], default: "agree"

disagree

disagree(String id)
The current user disagree a given insight
Authentication required
response: {id, updatedAgreeCount, updatedDisagreeCount, voteState}

Parameters:
id - : unique ID of this insight

list

list(Integer from,
                        Integer number,
                        String sort,
                        Long category,
                        String vote,
                        String topic,
                        Boolean closed,
                        String language)
Get a list of insights
response: [{id, content, creationDate, endDate, endDateLabel, creator, category, agreeCount, disagreeCount, commentCount, lastCurrentUserVote}, ...]

Parameters:
from - index of the first insight to return, default = 0
number - number of insights to return, default = 20
sort - possible values : ["updated", "trending", "incoming"] (String), default = "updated"
category - id of the category to restrict to, default = null
vote - filter by vote state, possible values : ["all", "voted", "non-voted"] (String), default = "all"
topic - String of the topic, default = null
closed - true to return closed insights, default = false
language - possible values : ["all", "browser", "user", "fr", "en"], default = "all" "browser" filter by browser language, "user" filter by the language the connected user reads.

show

show(String id)
Get detailed information about a given insight
response: {id, content, creationDate, endDate, endDateLabel, creator, category, agreeCount, disagreeCount, commentCount, lastCurrentUserVote, occurenceScore, validated, tags["label", ...]}

Parameters:
id - : unique ID of this insight
Clone this wiki locally