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/3756/
HTTP 200 OK
Allow: GET, PUT, PATCH, DELETE, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 3756,
    "url": "https://api.represent.me/api/questions/3756/",
    "question": "Which Brexit outcome would you prefer in terms of its impact on the UK police force?",
    "slug": "which-brexit-outcome-would-you-prefer-in-terms-of-its-impact-on-the-uk-police-force",
    "my_vote": [],
    "user": {
        "id": 13242,
        "username": "AdamSpiers",
        "first_name": "Adam",
        "last_name": "Spiers",
        "url": "https://api.represent.me/api/users/13242/",
        "photo": "https://s3.eu-central-1.amazonaws.com:443/static.represent.me/images/profile_pic_13242.jpg",
        "age": 43,
        "latest_compare": [],
        "follow": [],
        "locations": [
            "https://api.represent.me/api/user_geos/759570/",
            "https://api.represent.me/api/user_geos/759569/",
            "https://api.represent.me/api/user_geos/759568/",
            "https://api.represent.me/api/user_geos/759567/",
            "https://api.represent.me/api/user_geos/759566/",
            "https://api.represent.me/api/user_geos/759565/"
        ],
        "bio": "",
        "created_at": "2017-01-26T00:16:08.518770Z",
        "modified_at": "2019-04-15T15:52:58.835064Z",
        "is_deleted": false,
        "country": 59,
        "country_info": {
            "id": 59,
            "ID": "GBR",
            "name": "United Kingdom",
            "m_type": "country",
            "location": {
                "type": "Point",
                "coordinates": [
                    -2.8869514831036756,
                    54.14704818919766
                ]
            },
            "members_count": 9085,
            "question_count": 923,
            "created_at": "2016-03-20T04:26:45.483907Z",
            "type_description": null,
            "parent": null,
            "parent_url": null,
            "politicians": [],
            "modified_at": "2019-07-27T09:51:07.091181Z"
        },
        "region": 45690,
        "region_info": {
            "id": 45690,
            "ID": "GBR_REGION_ENG",
            "name": "England",
            "m_type": "region",
            "location": {
                "type": "Point",
                "coordinates": [
                    -1.4587100703941027,
                    52.59501517841384
                ]
            },
            "members_count": 7867,
            "question_count": 13,
            "created_at": "2017-03-17T16:31:15.805339Z",
            "type_description": "Constituent Country",
            "parent": 59,
            "parent_url": "https://api.represent.me/api/simple_geos/59/?format=api",
            "politicians": [],
            "modified_at": "2019-07-27T09:51:07.055081Z"
        },
        "last_answer_time": "2018-10-03T18:58:50.601229Z",
        "politician": null,
        "politician_info": null,
        "is_email_verified": true,
        "is_admin_verified": false,
        "is_facebook_verified": true,
        "is_google_verified": false,
        "is_twitter_verified": false,
        "is_linkedin_verified": false,
        "is_stripe_verified": false,
        "verification_count": 2,
        "verification_score": 77,
        "count_questions": 12,
        "count_votes": 88,
        "count_question_votes": 67,
        "count_friends": 0,
        "count_comment_votes": 12,
        "count_choice_votes": 21,
        "count_group_memberships": 2,
        "count_following_tags": 12,
        "count_comments": 0,
        "count_following_users": 2,
        "count_followers": 0,
        "karma": 0
    },
    "tags": [
        {
            "id": 9456,
            "tag": {
                "id": 813,
                "text": "united kingdom",
                "followers_count": 0,
                "questions_count": 2,
                "votes_count": 15
            },
            "created_at": "2018-08-22T13:20:49.016869Z",
            "modified_at": "2018-08-22T13:20:49.017214Z",
            "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": 9455,
            "tag": {
                "id": 569,
                "text": "policing",
                "followers_count": 0,
                "questions_count": 5,
                "votes_count": 1366
            },
            "created_at": "2018-08-22T13:20:48.979641Z",
            "modified_at": "2018-08-22T13:20:48.979975Z",
            "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": 9454,
            "tag": {
                "id": 19,
                "text": "police",
                "followers_count": 35,
                "questions_count": 21,
                "votes_count": 5944
            },
            "created_at": "2018-08-22T13:20:48.831465Z",
            "modified_at": "2018-08-22T13:20:48.831828Z",
            "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": 9453,
            "tag": {
                "id": 787,
                "text": "Brexit",
                "followers_count": 11,
                "questions_count": 141,
                "votes_count": 222394
            },
            "created_at": "2018-08-22T13:20:48.790671Z",
            "modified_at": "2018-08-22T13:20:48.791058Z",
            "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": 1472,
            "url": "https://api.represent.me/api/question_choices/1472/",
            "text": "I would feel safer if we remained in the EU and continued to enjoy cross border cooperation of our police forces.",
            "mongo_number": 0,
            "direct_vote_count": 6,
            "direct_value": 5.0,
            "direct_sum": 12.0,
            "direct_heat": 2.88461538461538,
            "direct_consensus": 1.0,
            "direct_skipped": 0,
            "direct_minimum": 0,
            "direct_low": 0,
            "direct_medium": 0,
            "direct_high": 0,
            "direct_maximum": 6,
            "created_at": "2018-08-22T13:20:48.732020Z",
            "modified_at": "2018-11-24T13:30:47.320913Z",
            "liquid_vote_count": 6,
            "liquid_value": 5.0,
            "liquid_sum": 12.0,
            "liquid_heat": 2.88461538461538,
            "liquid_consensus": 1.0,
            "liquid_skipped": 0,
            "liquid_minimum": 0,
            "liquid_low": 0,
            "liquid_medium": 0,
            "liquid_high": 0,
            "liquid_maximum": 6,
            "polarisation": 0.447213595499958
        },
        {
            "id": 1473,
            "url": "https://api.represent.me/api/question_choices/1473/",
            "text": "Even after Brexit, it would be in the EU’s interest to continue cooperating with the UK police force",
            "mongo_number": 1,
            "direct_vote_count": 1,
            "direct_value": 5.0,
            "direct_sum": 2.0,
            "direct_heat": 0.480769230769231,
            "direct_consensus": 1.0,
            "direct_skipped": 0,
            "direct_minimum": 0,
            "direct_low": 0,
            "direct_medium": 0,
            "direct_high": 0,
            "direct_maximum": 1,
            "created_at": "2018-08-22T13:20:48.759310Z",
            "modified_at": "2018-11-24T13:30:47.334342Z",
            "liquid_vote_count": 1,
            "liquid_value": 5.0,
            "liquid_sum": 2.0,
            "liquid_heat": 0.480769230769231,
            "liquid_consensus": 1.0,
            "liquid_skipped": 0,
            "liquid_minimum": 0,
            "liquid_low": 0,
            "liquid_medium": 0,
            "liquid_high": 0,
            "liquid_maximum": 1,
            "polarisation": 0.447213595499958
        },
        {
            "id": 1474,
            "url": "https://api.represent.me/api/question_choices/1474/",
            "text": "The UK will be able to deal better with policing if we have a free hand in it",
            "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": "2018-08-22T13:20:48.766100Z",
            "modified_at": "2018-11-24T13:30:47.347883Z",
            "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": 59,
    "geo_info": {
        "id": 59,
        "ID": "GBR",
        "name": "United Kingdom",
        "m_type": "country",
        "location": {
            "type": "Point",
            "coordinates": [
                -2.8869514831036756,
                54.14704818919766
            ]
        },
        "members_count": 9085,
        "question_count": 923,
        "created_at": "2016-03-20T04:26:45.483907Z",
        "type_description": null,
        "parent": null,
        "parent_url": null,
        "politicians": [],
        "modified_at": "2019-07-27T09:51:07.091181Z"
    },
    "group_url": null,
    "geo_url": "https://api.represent.me/api/geos/59/",
    "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": 7,
    "direct_value": 0.0,
    "direct_sum": 14.0,
    "direct_heat": 1.34615384615385,
    "direct_consensus": 0.857142857142857,
    "direct_skipped": 0,
    "direct_minimum": 0,
    "direct_low": 0,
    "direct_medium": 0,
    "direct_high": 0,
    "direct_maximum": 0,
    "created_at": "2018-08-22T13:20:48.599933Z",
    "modified_at": "2018-11-24T13:30:47.361881Z",
    "liquid_vote_count": 7,
    "liquid_value": 0.0,
    "liquid_sum": 14.0,
    "liquid_heat": 1.34615384615385,
    "liquid_consensus": 0.857142857142857,
    "liquid_skipped": 0,
    "liquid_minimum": 0,
    "liquid_low": 0,
    "liquid_medium": 0,
    "liquid_high": 0,
    "liquid_maximum": 0,
    "polarisation": 0.0
}