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

{
    "id": 2179,
    "url": "https://api.represent.me/api/questions/2179/",
    "question": "Does the A48 between Ewenny roundabout and Laleston roundabout in Bridgend need more funding to improve road safety?",
    "slug": "does-the-a48-between-ewenny-roundabout-and-laleston-roundabout-in-bridgend-need-more-funding-to-improve-road-safety",
    "my_vote": [],
    "user": {
        "id": 6273,
        "username": "BethanMaeve",
        "first_name": "Bethan",
        "last_name": "Maeve",
        "url": "https://api.represent.me/api/users/6273/",
        "photo": "https://s3.eu-central-1.amazonaws.com:443/static.represent.me/images/d2088e13-8e2d-4015-b080-88db67c0e0b3.png",
        "age": 37,
        "latest_compare": [],
        "follow": [],
        "locations": [
            "https://api.represent.me/api/user_geos/733739/",
            "https://api.represent.me/api/user_geos/733738/",
            "https://api.represent.me/api/user_geos/733737/",
            "https://api.represent.me/api/user_geos/733736/",
            "https://api.represent.me/api/user_geos/733735/"
        ],
        "bio": "Politician in the National Assembly for Wales. \r\nGwleidydd yna Nghynulliad Cenedlaethol Cymru.",
        "created_at": "2016-07-20T12:16:10Z",
        "modified_at": "2019-04-15T15:52:28.097383Z",
        "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": 45693,
        "region_info": {
            "id": 45693,
            "ID": "GBR_REGION_WLS",
            "name": "Wales",
            "m_type": "region",
            "location": {
                "type": "Point",
                "coordinates": [
                    -3.756944661352604,
                    52.33927198343644
                ]
            },
            "members_count": 421,
            "question_count": 2,
            "created_at": "2017-03-17T16:31:16.918533Z",
            "type_description": "Constituent Country",
            "parent": 59,
            "parent_url": "https://api.represent.me/api/simple_geos/59/",
            "politicians": [],
            "modified_at": "2019-04-12T11:24:46.601156Z"
        },
        "last_answer_time": "2017-08-29T13:31:13.484848Z",
        "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": 2,
        "verification_score": 100,
        "count_questions": 4,
        "count_votes": 123,
        "count_question_votes": 113,
        "count_friends": 0,
        "count_comment_votes": 1,
        "count_choice_votes": 10,
        "count_group_memberships": 2,
        "count_following_tags": 2,
        "count_comments": 1,
        "count_following_users": 7,
        "count_followers": 7,
        "karma": 0
    },
    "tags": [
        {
            "id": 9476,
            "tag": {
                "id": 769,
                "text": "important",
                "followers_count": 0,
                "questions_count": 1679,
                "votes_count": 719996
            },
            "created_at": "2019-01-24T16:11:32.749200Z",
            "modified_at": "2019-01-24T16:11:32.986094Z",
            "direct_vote_count": 1,
            "direct_value": 1.0,
            "direct_sum": -2.0,
            "direct_heat": 1.0,
            "direct_consensus": 1.0,
            "direct_skipped": 0,
            "direct_minimum": 1,
            "direct_low": 0,
            "direct_medium": 0,
            "direct_high": 0,
            "direct_maximum": 0
        },
        {
            "id": 4335,
            "tag": {
                "id": 235,
                "text": "road safety",
                "followers_count": 0,
                "questions_count": 3,
                "votes_count": 168
            },
            "created_at": "2016-07-20T13:10:03.868557Z",
            "modified_at": "2016-07-20T13:10:03.868872Z",
            "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": [],
    "description": "There have been many road accidents over the years on this road, most recently a 16 year old who was knocked down by a motorcycle. The A48 is the main walking route for school children but there is no safe crossing and speed restrictions are deemed too high by many locals.",
    "perodic_repeat_interval": null,
    "ogImage": null,
    "subtype": "likert",
    "topic": 235,
    "topic_info": {
        "id": 235,
        "text": "road safety",
        "followers_count": 0,
        "questions_count": 3,
        "votes_count": 168
    },
    "group": null,
    "geo": null,
    "geo_info": null,
    "group_url": null,
    "geo_url": null,
    "links": [
        {
            "id": 265,
            "url": "https://api.represent.me/api/question_links/265/",
            "link": "http://www.bbc.co.uk/news/uk-wales-south-east-wales-36781010",
            "desc": "",
            "thumbnailUrl": null,
            "title": "http://www.bbc.co.uk/news/uk-wales-south-east-wales-36781010"
        }
    ],
    "start_at": null,
    "end_at": null,
    "publish": true,
    "count_comments": 2,
    "count_comments_suggestion": 0,
    "count_comments_reason": 1,
    "count_comments_info": 1,
    "group_name": null,
    "their_vote": [],
    "my_importance": [],
    "direct_vote_count": 41,
    "direct_value": 4.24390243902439,
    "direct_sum": 51.0,
    "direct_heat": 5.24096385542169,
    "direct_consensus": 0.575847709696609,
    "direct_skipped": 9,
    "direct_minimum": 0,
    "direct_low": 0,
    "direct_medium": 13,
    "direct_high": 5,
    "direct_maximum": 23,
    "created_at": "2016-07-20T13:10:03.861438Z",
    "modified_at": "2019-01-24T16:11:32.739653Z",
    "liquid_vote_count": 41,
    "liquid_value": 4.24390243902439,
    "liquid_sum": 51.0,
    "liquid_heat": 5.24096385542169,
    "liquid_consensus": 0.682926829268293,
    "liquid_skipped": 9,
    "liquid_minimum": 0,
    "liquid_low": 0,
    "liquid_medium": 13,
    "liquid_high": 5,
    "liquid_maximum": 23,
    "polarisation": 0.23984428817443
}