Get Best Contribution Insight
This endpoint retrieves the best contribution insights list.
HTTP Request
GET /api/v2/insight/contribution/
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
limit | path | integer | false | Number of results to return per page |
offset | path | integer | false | The initial index from which to return the results |
category_id | path | string | false | Can 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__gte | path | string(date-time) | false | Datetime of creation(greater than or equal to the given value) |
created_at__lte | path | string(date-time) | false | Datetime of creation(less than or equal to the given value) |
contribution_type | path | string | false | The contribution type (discussion, post, status) |
user_id | path | integer | false | The user id |
ranked_by | path | integer | false | The 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_id | path | string | false | The embed id (required in combo with embed_type) |
embed_type | path | string | false | The embed type (required in combo with embed_id) |
Example Request
- JavaScript
- Bash
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);
});
# You can also use wget
curl -X GET /api/v2/insight/contribution/ \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access_token}'
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Response status code | Inline |
Response Schema
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
count | integer | false | none | Total results count |
next | string(uri)¦null | false | none | Next page url |
previous | string(uri)¦null | false | none | Previous page url |
results | list | false | none | List of results |
» contribution | object | false | none | The contribution object |
» score | integer | false | none | The score |
Valid types for contribution
Field | Type | Description |
---|---|---|
contribution | Post | A contribution of type post |
contribution | Discussion | A contribution of type discussion |
contribution | Status | A 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"
}
]
}