Skip to main content

Get Best Contribution Insight

This endpoint retrieves the best contribution insights list.

HTTP Request

GET /api/v2/insight/contribution/

Parameters

NameInTypeRequiredDescription
limitpathintegerfalseNumber of results to return per page
offsetpathintegerfalseThe initial index from which to return the results
category_idpathstringfalseCan be a single category id or list (comma separated) of categories ids. 0 means empty (no category). If you use a list of category ids then any contribution that matches at least one category_id will be returned (the filter is in OR and not in AND)
created_at__gtepathstring(date-time)falseDatetime of creation(greater than or equal to the given value)
created_at__ltepathstring(date-time)falseDatetime of creation(less than or equal to the given value)
contribution_typepathstringfalseThe contribution type (discussion, post, status)
user_idpathintegerfalseThe user id
ranked_bypathintegerfalseThe rank value to use: num_votes, num_comments, num_shares, num_views (default: rank function). If a list (eg: num_comments, num_answers_received) the final rank will be the sum of the list components
embed_idpathstringfalseThe embed id (required in combo with embed_type)
embed_typepathstringfalseThe embed type (required in combo with embed_id)

Example Request

const headers = {
'Accept':'application/json',
'Authorization': 'Bearer {access_token}'
};

fetch('/api/v2/insight/contribution/',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});

Responses

StatusMeaningDescriptionSchema
200OKResponse status codeInline

Response Schema

NameTypeRequiredRestrictionsDescription
countintegerfalsenoneTotal results count
nextstring(uri)¦nullfalsenoneNext page url
previousstring(uri)¦nullfalsenonePrevious page url
resultslistfalsenoneList of results
» contributionobjectfalsenoneThe contribution object
» scoreintegerfalsenoneThe score

Valid types for contribution

FieldTypeDescription
contributionPostA contribution of type post
contributionDiscussionA contribution of type discussion
contributionStatusA contribution of type status

Example response

{
"count": "integer",
"next": "string(uri)",
"previous": "string(uri)",
"results": [
{
"post": "{Post}",
"score": "integer"
},
{
"discussion": "{Discussion}",
"score": "integer"
},
{
"status": "{Status}",
"score": "integer"
}
]
}