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
200OKnoneInline

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": 409,
"next": "https://apiv2.quentrix.com/api/v2/insight/contribution/?limit=20&offset=20",
"previous": null,
"results": [
{
"post": "{see Post schema}",
"score": 856
},
{
"discussion": "{see Discussion schema}",
"score": 453
},
{
"status": "{see Status schema}",
"score": 260
}
]
}