API endpoint that allows Questions to be viewed or edited.

POST

{
"question": "Title Here",
"tags": [{"tag":{"id":20}}, {"tag":{"id":25}}],
"choices": [{"text":"Choice1"}, {"text":"Choice2"}, {"text":"Choice3"}],
"collections": [{"parent":{"id":X}}],
"description": "More Info Here",
"ogImage": null,
"group": 39,
"geo": 12,
"links": [{"link":"http://google.com", "title":"google"}] #title is optional
}

Searching and filtering

to find questions asked by molly, answered by chozabu, sorted by date of chozabs answer

http://localhost:8000/api/questions/?ordering=-votes__created_at&votes__user__username=chozabu&user__username=molly_bishop1

to find questions with keyword represent, in order of vote count

http://localhost:8000/api/questions/?ordering=-direct_vote_count&search=represent

A shortcut to find answers by a user, and avoid dupe results is answered_by - which takes a user id

http://localhost:8000/api/questions/?answered_by=1

to find questions with any word in question text:

http://localhost:8000/api/questions/?exact_question=word

Extra info on filtering questions in relation to groups:

group=6 # will get active questions in group 6 (represent)
in_group_all=6 # will get all questions in group 6, active or not
in_group_disabled=6 # will only get disabled questions in group 6

count

checkout count to get just the number of questions matching a query

nearby

check out nearby to get questions from district | region | country

Personal History

check out my_history to get questions in the order you answered them, this should be equivalent to /api/questions/?ordering=-votes__created_at&votes__user__username=YOUR_ID

in detail view:

check out friends_answers to get friends answers

GET /api/questions/3771/
HTTP 200 OK
Allow: GET, PUT, PATCH, DELETE, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 3771,
    "url": "https://api.represent.me/api/questions/3771/",
    "question": "Devrait on imposer le sport hebdomadaire à tous les non dispensés",
    "slug": "devrait-on-imposer-le-sport-hebdomadaire-a-tous-les-non-dispenses",
    "my_vote": [],
    "user": {
        "id": 20252,
        "username": "sessouv",
        "first_name": "Victor",
        "last_name": "SESSOU",
        "url": "https://api.represent.me/api/users/20252/",
        "photo": "https://s3.eu-central-1.amazonaws.com:443/static.represent.me/images/17485a20-8ec4-4397-80ae-4fae49a410a8.png",
        "age": 29,
        "latest_compare": [],
        "follow": [],
        "locations": [
            "https://api.represent.me/api/user_geos/760699/",
            "https://api.represent.me/api/user_geos/760698/"
        ],
        "bio": "",
        "created_at": "2017-06-24T10:43:56.909516Z",
        "modified_at": "2019-04-15T15:52:25.741571Z",
        "is_deleted": false,
        "country": 14,
        "country_info": {
            "id": 14,
            "ID": "BEN",
            "name": "Benin",
            "m_type": "country",
            "location": {
                "type": "Point",
                "coordinates": [
                    2.3287407454765714,
                    9.641216769508844
                ]
            },
            "members_count": 1,
            "question_count": 1,
            "created_at": "2016-03-20T04:26:45.376590Z",
            "type_description": null,
            "parent": null,
            "parent_url": null,
            "politicians": [],
            "modified_at": "2019-03-15T10:36:31.616882Z"
        },
        "region": 3007,
        "region_info": {
            "id": 3007,
            "ID": "3158",
            "name": "Littoral",
            "m_type": "region",
            "location": {
                "type": "Point",
                "coordinates": [
                    2.4240635910961528,
                    6.363618106781622
                ]
            },
            "members_count": 1,
            "question_count": 0,
            "created_at": "2016-03-20T04:26:57.240082Z",
            "type_description": null,
            "parent": 14,
            "parent_url": "https://api.represent.me/api/simple_geos/14/",
            "politicians": [],
            "modified_at": "2019-03-15T10:28:55.085658Z"
        },
        "last_answer_time": "2019-03-18T12:54:56.967170Z",
        "politician": null,
        "politician_info": null,
        "is_email_verified": true,
        "is_admin_verified": false,
        "is_facebook_verified": false,
        "is_google_verified": true,
        "is_twitter_verified": false,
        "is_linkedin_verified": false,
        "is_stripe_verified": false,
        "verification_count": 2,
        "verification_score": 77,
        "count_questions": 1,
        "count_votes": 47,
        "count_question_votes": 42,
        "count_friends": 0,
        "count_comment_votes": 0,
        "count_choice_votes": 5,
        "count_group_memberships": 1,
        "count_following_tags": 1,
        "count_comments": 0,
        "count_following_users": 2,
        "count_followers": 0,
        "karma": 0
    },
    "tags": [
        {
            "id": 9495,
            "tag": {
                "id": 2,
                "text": "politics",
                "followers_count": 693,
                "questions_count": 478,
                "votes_count": 145845
            },
            "created_at": "2019-03-15T10:36:31.672404Z",
            "modified_at": "2019-03-15T10:36:31.672719Z",
            "direct_vote_count": 0,
            "direct_value": 0.0,
            "direct_sum": 0.0,
            "direct_heat": 0.0,
            "direct_consensus": 0.5,
            "direct_skipped": 0,
            "direct_minimum": 0,
            "direct_low": 0,
            "direct_medium": 0,
            "direct_high": 0,
            "direct_maximum": 0
        },
        {
            "id": 9494,
            "tag": {
                "id": 841,
                "text": "health,",
                "followers_count": 0,
                "questions_count": 1,
                "votes_count": 4
            },
            "created_at": "2019-03-15T10:36:31.661488Z",
            "modified_at": "2019-03-15T10:36:31.661808Z",
            "direct_vote_count": 0,
            "direct_value": 0.0,
            "direct_sum": 0.0,
            "direct_heat": 0.0,
            "direct_consensus": 0.5,
            "direct_skipped": 0,
            "direct_minimum": 0,
            "direct_low": 0,
            "direct_medium": 0,
            "direct_high": 0,
            "direct_maximum": 0
        },
        {
            "id": 9493,
            "tag": {
                "id": 885,
                "text": "Santé",
                "followers_count": 0,
                "questions_count": 1,
                "votes_count": 4
            },
            "created_at": "2019-03-15T10:36:31.646647Z",
            "modified_at": "2019-03-15T10:36:31.647002Z",
            "direct_vote_count": 0,
            "direct_value": 0.0,
            "direct_sum": 0.0,
            "direct_heat": 0.0,
            "direct_consensus": 0.5,
            "direct_skipped": 0,
            "direct_minimum": 0,
            "direct_low": 0,
            "direct_medium": 0,
            "direct_high": 0,
            "direct_maximum": 0
        }
    ],
    "choices": [
        {
            "id": 1480,
            "url": "https://api.represent.me/api/question_choices/1480/",
            "text": "Sans Avis",
            "mongo_number": 2,
            "direct_vote_count": 0,
            "direct_value": 0.0,
            "direct_sum": 0.0,
            "direct_heat": 0.0,
            "direct_consensus": 0.5,
            "direct_skipped": 0,
            "direct_minimum": 0,
            "direct_low": 0,
            "direct_medium": 0,
            "direct_high": 0,
            "direct_maximum": 0,
            "created_at": "2019-03-15T10:36:31.638365Z",
            "modified_at": "2019-03-15T11:37:17.430409Z",
            "liquid_vote_count": 0,
            "liquid_value": 0.0,
            "liquid_sum": 0.0,
            "liquid_heat": 0.0,
            "liquid_consensus": 0.5,
            "liquid_skipped": 0,
            "liquid_minimum": 0,
            "liquid_low": 0,
            "liquid_medium": 0,
            "liquid_high": 0,
            "liquid_maximum": 0,
            "polarisation": 0.0
        },
        {
            "id": 1481,
            "url": "https://api.represent.me/api/question_choices/1481/",
            "text": "Oui c'est pour le bonheur de tous",
            "mongo_number": 3,
            "direct_vote_count": 2,
            "direct_value": 5.0,
            "direct_sum": 4.0,
            "direct_heat": 10.0,
            "direct_consensus": 1.0,
            "direct_skipped": 0,
            "direct_minimum": 0,
            "direct_low": 0,
            "direct_medium": 0,
            "direct_high": 0,
            "direct_maximum": 2,
            "created_at": "2019-03-15T10:36:31.642403Z",
            "modified_at": "2019-03-15T11:37:17.444185Z",
            "liquid_vote_count": 2,
            "liquid_value": 5.0,
            "liquid_sum": 4.0,
            "liquid_heat": 10.0,
            "liquid_consensus": 1.0,
            "liquid_skipped": 0,
            "liquid_minimum": 0,
            "liquid_low": 0,
            "liquid_medium": 0,
            "liquid_high": 0,
            "liquid_maximum": 2,
            "polarisation": 0.447213595499958
        },
        {
            "id": 1478,
            "url": "https://api.represent.me/api/question_choices/1478/",
            "text": "Oui",
            "mongo_number": 0,
            "direct_vote_count": 2,
            "direct_value": 5.0,
            "direct_sum": 4.0,
            "direct_heat": 10.0,
            "direct_consensus": 1.0,
            "direct_skipped": 0,
            "direct_minimum": 0,
            "direct_low": 0,
            "direct_medium": 0,
            "direct_high": 0,
            "direct_maximum": 2,
            "created_at": "2019-03-15T10:36:31.625882Z",
            "modified_at": "2019-03-15T11:37:17.458015Z",
            "liquid_vote_count": 2,
            "liquid_value": 5.0,
            "liquid_sum": 4.0,
            "liquid_heat": 10.0,
            "liquid_consensus": 1.0,
            "liquid_skipped": 0,
            "liquid_minimum": 0,
            "liquid_low": 0,
            "liquid_medium": 0,
            "liquid_high": 0,
            "liquid_maximum": 2,
            "polarisation": 0.447213595499958
        },
        {
            "id": 1479,
            "url": "https://api.represent.me/api/question_choices/1479/",
            "text": "Non",
            "mongo_number": 1,
            "direct_vote_count": 0,
            "direct_value": 0.0,
            "direct_sum": 0.0,
            "direct_heat": 0.0,
            "direct_consensus": 0.5,
            "direct_skipped": 0,
            "direct_minimum": 0,
            "direct_low": 0,
            "direct_medium": 0,
            "direct_high": 0,
            "direct_maximum": 0,
            "created_at": "2019-03-15T10:36:31.634101Z",
            "modified_at": "2019-03-15T11:37:17.471244Z",
            "liquid_vote_count": 0,
            "liquid_value": 0.0,
            "liquid_sum": 0.0,
            "liquid_heat": 0.0,
            "liquid_consensus": 0.5,
            "liquid_skipped": 0,
            "liquid_minimum": 0,
            "liquid_low": 0,
            "liquid_medium": 0,
            "liquid_high": 0,
            "liquid_maximum": 0,
            "polarisation": 0.0
        }
    ],
    "description": "",
    "perodic_repeat_interval": null,
    "ogImage": null,
    "subtype": "mcq",
    "topic": null,
    "topic_info": null,
    "group": null,
    "geo": 14,
    "geo_info": {
        "id": 14,
        "ID": "BEN",
        "name": "Benin",
        "m_type": "country",
        "location": {
            "type": "Point",
            "coordinates": [
                2.3287407454765714,
                9.641216769508844
            ]
        },
        "members_count": 1,
        "question_count": 1,
        "created_at": "2016-03-20T04:26:45.376590Z",
        "type_description": null,
        "parent": null,
        "parent_url": null,
        "politicians": [],
        "modified_at": "2019-03-15T10:36:31.616882Z"
    },
    "group_url": null,
    "geo_url": "https://api.represent.me/api/geos/14/",
    "links": [],
    "start_at": null,
    "end_at": null,
    "publish": true,
    "count_comments": 0,
    "count_comments_suggestion": 0,
    "count_comments_reason": 0,
    "count_comments_info": 0,
    "group_name": null,
    "their_vote": [],
    "my_importance": [],
    "direct_vote_count": 4,
    "direct_value": 0.0,
    "direct_sum": 8.0,
    "direct_heat": 8.0,
    "direct_consensus": 0.5,
    "direct_skipped": 0,
    "direct_minimum": 0,
    "direct_low": 0,
    "direct_medium": 0,
    "direct_high": 0,
    "direct_maximum": 0,
    "created_at": "2019-03-15T10:36:31.605409Z",
    "modified_at": "2019-03-15T11:37:17.486851Z",
    "liquid_vote_count": 4,
    "liquid_value": 0.0,
    "liquid_sum": 8.0,
    "liquid_heat": 8.0,
    "liquid_consensus": 0.5,
    "liquid_skipped": 0,
    "liquid_minimum": 0,
    "liquid_low": 0,
    "liquid_medium": 0,
    "liquid_high": 0,
    "liquid_maximum": 0,
    "polarisation": 0.0
}