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

{
    "id": 3639,
    "url": "https://api.represent.me/api/questions/3639/",
    "question": "The approach to funding the NHS in England should be...",
    "slug": "the-approach-to-funding-the-nhs-in-england-should-be",
    "my_vote": [],
    "user": {
        "id": 17763,
        "username": "questionsbyrepresent",
        "first_name": "Questions",
        "last_name": "by Represent",
        "url": "https://api.represent.me/api/users/17763/",
        "photo": "https://s3.eu-central-1.amazonaws.com:443/static.represent.me/images/cc7bdcfd-ae42-4c69-b02d-0fb26129820c.png",
        "age": 45,
        "latest_compare": [],
        "follow": [],
        "locations": [
            "https://api.represent.me/api/user_geos/744961/",
            "https://api.represent.me/api/user_geos/744960/",
            "https://api.represent.me/api/user_geos/744959/",
            "https://api.represent.me/api/user_geos/744958/",
            "https://api.represent.me/api/user_geos/744957/",
            "https://api.represent.me/api/user_geos/744956/"
        ],
        "bio": "",
        "created_at": "2017-05-22T13:58:29Z",
        "modified_at": "2019-04-15T15:54:57.227687Z",
        "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": 9084,
            "question_count": 923,
            "created_at": "2016-03-20T04:26:45.483907Z",
            "type_description": null,
            "parent": null,
            "parent_url": null,
            "politicians": [],
            "modified_at": "2019-07-15T09:12:13.796827Z"
        },
        "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": 7866,
            "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/",
            "politicians": [],
            "modified_at": "2019-07-15T09:12:13.773714Z"
        },
        "last_answer_time": "2017-06-05T16:30:02.921000Z",
        "politician": null,
        "politician_info": null,
        "is_email_verified": true,
        "is_admin_verified": true,
        "is_facebook_verified": false,
        "is_google_verified": false,
        "is_twitter_verified": false,
        "is_linkedin_verified": false,
        "is_stripe_verified": false,
        "verification_count": 0,
        "verification_score": 100,
        "count_questions": 8,
        "count_votes": 4,
        "count_question_votes": 1,
        "count_friends": 0,
        "count_comment_votes": 0,
        "count_choice_votes": 3,
        "count_group_memberships": 1,
        "count_following_tags": 1,
        "count_comments": 0,
        "count_following_users": 2,
        "count_followers": 0,
        "karma": 0
    },
    "tags": [
        {
            "id": 8961,
            "tag": {
                "id": 803,
                "text": "ge2017",
                "followers_count": 1,
                "questions_count": 136,
                "votes_count": 175314
            },
            "created_at": "2017-05-22T14:49:03.564012Z",
            "modified_at": "2017-05-22T14:49:03.564354Z",
            "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": 8960,
            "tag": {
                "id": 45,
                "text": "money",
                "followers_count": 23,
                "questions_count": 22,
                "votes_count": 18529
            },
            "created_at": "2017-05-22T14:49:03.540489Z",
            "modified_at": "2017-05-22T14:49:03.540828Z",
            "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": 8959,
            "tag": {
                "id": 60,
                "text": "NHS",
                "followers_count": 58,
                "questions_count": 49,
                "votes_count": 35855
            },
            "created_at": "2017-05-22T14:49:03.520003Z",
            "modified_at": "2017-05-22T14:49:03.520371Z",
            "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": 1298,
            "url": "https://api.represent.me/api/question_choices/1298/",
            "text": "to increase NHS spending by a minimum of £8bn in real terms over the next five years",
            "mongo_number": null,
            "direct_vote_count": 369,
            "direct_value": 5.0,
            "direct_sum": 738.0,
            "direct_heat": 31.5924657534247,
            "direct_consensus": 1.0,
            "direct_skipped": 0,
            "direct_minimum": 0,
            "direct_low": 0,
            "direct_medium": 0,
            "direct_high": 0,
            "direct_maximum": 369,
            "created_at": "2017-05-22T14:49:03.484488Z",
            "modified_at": "2018-12-18T06:17:56.138421Z",
            "liquid_vote_count": 369,
            "liquid_value": 5.0,
            "liquid_sum": 738.0,
            "liquid_heat": 31.5924657534247,
            "liquid_consensus": 1.0,
            "liquid_skipped": 0,
            "liquid_minimum": 0,
            "liquid_low": 0,
            "liquid_medium": 0,
            "liquid_high": 0,
            "liquid_maximum": 369,
            "polarisation": 0.447213595499958
        },
        {
            "id": 1324,
            "url": "https://api.represent.me/api/question_choices/1324/",
            "text": "to increase the role of private healthcare",
            "mongo_number": null,
            "direct_vote_count": 82,
            "direct_value": 5.0,
            "direct_sum": 164.0,
            "direct_heat": 7.0446735395189,
            "direct_consensus": 1.0,
            "direct_skipped": 0,
            "direct_minimum": 0,
            "direct_low": 0,
            "direct_medium": 0,
            "direct_high": 0,
            "direct_maximum": 82,
            "created_at": "2017-05-24T13:22:46.304105Z",
            "modified_at": "2018-12-18T06:17:56.174247Z",
            "liquid_vote_count": 82,
            "liquid_value": 5.0,
            "liquid_sum": 164.0,
            "liquid_heat": 7.0446735395189,
            "liquid_consensus": 1.0,
            "liquid_skipped": 0,
            "liquid_minimum": 0,
            "liquid_low": 0,
            "liquid_medium": 0,
            "liquid_high": 0,
            "liquid_maximum": 82,
            "polarisation": 0.447213595499958
        },
        {
            "id": 1300,
            "url": "https://api.represent.me/api/question_choices/1300/",
            "text": "a 1p rise on income tax to raise £6bn per year for spending only on the NHS and social care services",
            "mongo_number": null,
            "direct_vote_count": 850,
            "direct_value": 5.0,
            "direct_sum": 1700.0,
            "direct_heat": 72.7739726027397,
            "direct_consensus": 1.0,
            "direct_skipped": 0,
            "direct_minimum": 0,
            "direct_low": 0,
            "direct_medium": 0,
            "direct_high": 0,
            "direct_maximum": 850,
            "created_at": "2017-05-22T14:49:03.502108Z",
            "modified_at": "2018-12-18T06:17:56.191440Z",
            "liquid_vote_count": 850,
            "liquid_value": 5.0,
            "liquid_sum": 1700.0,
            "liquid_heat": 72.7739726027397,
            "liquid_consensus": 1.0,
            "liquid_skipped": 0,
            "liquid_minimum": 0,
            "liquid_low": 0,
            "liquid_medium": 0,
            "liquid_high": 0,
            "liquid_maximum": 850,
            "polarisation": 0.447213595499958
        },
        {
            "id": 1302,
            "url": "https://api.represent.me/api/question_choices/1302/",
            "text": "decrease spending and identify inefficiencies",
            "mongo_number": null,
            "direct_vote_count": 148,
            "direct_value": 5.0,
            "direct_sum": 296.0,
            "direct_heat": 12.6712328767123,
            "direct_consensus": 1.0,
            "direct_skipped": 0,
            "direct_minimum": 0,
            "direct_low": 0,
            "direct_medium": 0,
            "direct_high": 0,
            "direct_maximum": 148,
            "created_at": "2017-05-22T14:52:06.017057Z",
            "modified_at": "2018-12-18T06:17:56.206699Z",
            "liquid_vote_count": 148,
            "liquid_value": 5.0,
            "liquid_sum": 296.0,
            "liquid_heat": 12.6712328767123,
            "liquid_consensus": 1.0,
            "liquid_skipped": 0,
            "liquid_minimum": 0,
            "liquid_low": 0,
            "liquid_medium": 0,
            "liquid_high": 0,
            "liquid_maximum": 148,
            "polarisation": 0.447213595499958
        },
        {
            "id": 1299,
            "url": "https://api.represent.me/api/question_choices/1299/",
            "text": "to scrap NHS pay cap and commit to over £30bn in extra funding over the next parliament",
            "mongo_number": null,
            "direct_vote_count": 502,
            "direct_value": 5.0,
            "direct_sum": 1004.0,
            "direct_heat": 42.9794520547945,
            "direct_consensus": 1.0,
            "direct_skipped": 0,
            "direct_minimum": 0,
            "direct_low": 0,
            "direct_medium": 0,
            "direct_high": 0,
            "direct_maximum": 502,
            "created_at": "2017-05-22T14:49:03.492710Z",
            "modified_at": "2018-12-18T06:17:56.221966Z",
            "liquid_vote_count": 502,
            "liquid_value": 5.0,
            "liquid_sum": 1004.0,
            "liquid_heat": 42.9794520547945,
            "liquid_consensus": 1.0,
            "liquid_skipped": 0,
            "liquid_minimum": 0,
            "liquid_low": 0,
            "liquid_medium": 0,
            "liquid_high": 0,
            "liquid_maximum": 502,
            "polarisation": 0.447213595499958
        },
        {
            "id": 1303,
            "url": "https://api.represent.me/api/question_choices/1303/",
            "text": "for spending to remain the same but decrease available services",
            "mongo_number": null,
            "direct_vote_count": 23,
            "direct_value": 5.0,
            "direct_sum": 46.0,
            "direct_heat": 1.96917808219178,
            "direct_consensus": 1.0,
            "direct_skipped": 0,
            "direct_minimum": 0,
            "direct_low": 0,
            "direct_medium": 0,
            "direct_high": 0,
            "direct_maximum": 23,
            "created_at": "2017-05-22T14:52:06.018444Z",
            "modified_at": "2018-12-18T06:17:56.236193Z",
            "liquid_vote_count": 23,
            "liquid_value": 5.0,
            "liquid_sum": 46.0,
            "liquid_heat": 1.96917808219178,
            "liquid_consensus": 1.0,
            "liquid_skipped": 0,
            "liquid_minimum": 0,
            "liquid_low": 0,
            "liquid_medium": 0,
            "liquid_high": 0,
            "liquid_maximum": 23,
            "polarisation": 0.447213595499958
        },
        {
            "id": 1301,
            "url": "https://api.represent.me/api/question_choices/1301/",
            "text": "to close the NHS spending gap and provide an immediate cash injection",
            "mongo_number": null,
            "direct_vote_count": 249,
            "direct_value": 5.0,
            "direct_sum": 498.0,
            "direct_heat": 21.3184931506849,
            "direct_consensus": 1.0,
            "direct_skipped": 0,
            "direct_minimum": 0,
            "direct_low": 0,
            "direct_medium": 0,
            "direct_high": 0,
            "direct_maximum": 249,
            "created_at": "2017-05-22T14:49:03.510874Z",
            "modified_at": "2018-12-18T06:17:56.250211Z",
            "liquid_vote_count": 249,
            "liquid_value": 5.0,
            "liquid_sum": 498.0,
            "liquid_heat": 21.3184931506849,
            "liquid_consensus": 1.0,
            "liquid_skipped": 0,
            "liquid_minimum": 0,
            "liquid_low": 0,
            "liquid_medium": 0,
            "liquid_high": 0,
            "liquid_maximum": 249,
            "polarisation": 0.447213595499958
        }
    ],
    "description": "Total health spending in England for 2016/17 is about £120 billion, of which, £106.8 billion is allocated to  NHS England. \r\nAccording to the health think tank, The Kings Fund, NHS funding in England will increase in real terms by £4.2 billion by 2020/21, using the Department of Health budget as the definition for NHS funding and taking 2015/16 as the baseline. This is much less than was expected when the Spending Review settlement for the NHS was announced. The difference is largely accounted for by a reduction of £4.8 billion in spending that falls outside NHS England’s budget.",
    "perodic_repeat_interval": null,
    "ogImage": null,
    "subtype": "mcq",
    "topic": null,
    "topic_info": null,
    "group": null,
    "geo": 45690,
    "geo_info": {
        "id": 45690,
        "ID": "GBR_REGION_ENG",
        "name": "England",
        "m_type": "region",
        "location": {
            "type": "Point",
            "coordinates": [
                -1.4587100703941027,
                52.59501517841384
            ]
        },
        "members_count": 7866,
        "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/",
        "politicians": [],
        "modified_at": "2019-07-15T09:12:13.773714Z"
    },
    "group_url": null,
    "geo_url": "https://api.represent.me/api/geos/45690/",
    "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": 2223,
    "direct_value": 0.0,
    "direct_sum": 4446.0,
    "direct_heat": 76.1301369863014,
    "direct_consensus": 0.382366171839856,
    "direct_skipped": 0,
    "direct_minimum": 0,
    "direct_low": 0,
    "direct_medium": 0,
    "direct_high": 0,
    "direct_maximum": 0,
    "created_at": "2017-05-22T14:49:03.447008Z",
    "modified_at": "2018-12-18T06:17:56.264850Z",
    "liquid_vote_count": 2223,
    "liquid_value": 0.0,
    "liquid_sum": 4446.0,
    "liquid_heat": 76.1301369863014,
    "liquid_consensus": 0.382366171839856,
    "liquid_skipped": 0,
    "liquid_minimum": 0,
    "liquid_low": 0,
    "liquid_medium": 0,
    "liquid_high": 0,
    "liquid_maximum": 0,
    "polarisation": 0.0
}