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

{
    "id": 1076,
    "url": "https://api.represent.me/api/questions/1076/",
    "question": "Limit cars and lorries to 20mph in cities between 7am and midnight.",
    "slug": "limit-cars-and-lorries-to-20mph-in-cities-between-7am-and-midnight",
    "my_vote": [],
    "user": {
        "id": 7,
        "username": "eddowding",
        "first_name": "Ed",
        "last_name": "Dowding",
        "url": "https://api.represent.me/api/users/7/?format=api",
        "photo": "https://s3.eu-central-1.amazonaws.com:443/static.represent.me/images/profile_pic_7_kD3OzJV.jpg",
        "age": 42,
        "latest_compare": [],
        "follow": [],
        "locations": [
            "https://api.represent.me/api/user_geos/750852/?format=api",
            "https://api.represent.me/api/user_geos/750851/?format=api",
            "https://api.represent.me/api/user_geos/750850/?format=api",
            "https://api.represent.me/api/user_geos/750849/?format=api",
            "https://api.represent.me/api/user_geos/750848/?format=api"
        ],
        "bio": "Eventually, everything will be recognised as priceless.",
        "created_at": "2015-01-31T09:10:43.588000Z",
        "modified_at": "2019-07-13T20:17:07.348323Z",
        "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": "2019-03-15T11:37:17.678652Z",
        "politician": null,
        "politician_info": null,
        "is_email_verified": true,
        "is_admin_verified": true,
        "is_facebook_verified": true,
        "is_google_verified": true,
        "is_twitter_verified": true,
        "is_linkedin_verified": true,
        "is_stripe_verified": false,
        "verification_count": 7,
        "verification_score": 100,
        "count_questions": 219,
        "count_votes": 2119,
        "count_question_votes": 1925,
        "count_friends": 162,
        "count_comment_votes": 106,
        "count_choice_votes": 194,
        "count_group_memberships": 37,
        "count_following_tags": 18,
        "count_comments": 76,
        "count_following_users": 132,
        "count_followers": 68,
        "karma": 120
    },
    "tags": [
        {
            "id": 1637,
            "tag": {
                "id": 4,
                "text": "transport",
                "followers_count": 85,
                "questions_count": 172,
                "votes_count": 65522
            },
            "created_at": "2016-03-20T04:29:49.431423Z",
            "modified_at": "2016-03-29T15:55:08.632469Z",
            "direct_vote_count": 0,
            "direct_value": 0.0,
            "direct_sum": 0.0,
            "direct_heat": 0.0,
            "direct_consensus": 0.0,
            "direct_skipped": 0,
            "direct_minimum": 0,
            "direct_low": 0,
            "direct_medium": 0,
            "direct_high": 0,
            "direct_maximum": 0
        },
        {
            "id": 1638,
            "tag": {
                "id": 130,
                "text": "cities",
                "followers_count": 21,
                "questions_count": 9,
                "votes_count": 2742
            },
            "created_at": "2016-03-20T04:29:49.437322Z",
            "modified_at": "2016-03-29T15:55:08.641380Z",
            "direct_vote_count": 0,
            "direct_value": 0.0,
            "direct_sum": 0.0,
            "direct_heat": 0.0,
            "direct_consensus": 0.0,
            "direct_skipped": 0,
            "direct_minimum": 0,
            "direct_low": 0,
            "direct_medium": 0,
            "direct_high": 0,
            "direct_maximum": 0
        },
        {
            "id": 1639,
            "tag": {
                "id": 251,
                "text": "cars",
                "followers_count": 5,
                "questions_count": 7,
                "votes_count": 4890
            },
            "created_at": "2016-03-20T04:29:49.443930Z",
            "modified_at": "2016-03-29T15:55:08.650033Z",
            "direct_vote_count": 0,
            "direct_value": 0.0,
            "direct_sum": 0.0,
            "direct_heat": 0.0,
            "direct_consensus": 0.0,
            "direct_skipped": 0,
            "direct_minimum": 0,
            "direct_low": 0,
            "direct_medium": 0,
            "direct_high": 0,
            "direct_maximum": 0
        }
    ],
    "choices": [],
    "description": "",
    "perodic_repeat_interval": null,
    "ogImage": null,
    "subtype": "likert",
    "topic": 4,
    "topic_info": {
        "id": 4,
        "text": "transport",
        "followers_count": 85,
        "questions_count": 172,
        "votes_count": 65522
    },
    "group": null,
    "geo": null,
    "geo_info": null,
    "group_url": null,
    "geo_url": null,
    "links": [
        {
            "id": 10,
            "url": "https://api.represent.me/api/question_links/10/",
            "link": "www.ciht.org.uk/en/media-centre/news/index.cfm/parties-urged-to-support-urban-20mph-limits",
            "desc": null,
            "thumbnailUrl": "",
            "title": "www.ciht.org.uk/en/media-centre/news/index.cfm/parties-urged-to-support-urban-20mph-limits"
        },
        {
            "id": 9,
            "url": "https://api.represent.me/api/question_links/9/",
            "link": "www.telegraph.co.uk/finance/newsbysector/transport/11113207/Extend-20-mph-limit-across-all-urban-areas-to-allow-children-to-roam-wild-Labour-shadow-transport-secretary-says.html",
            "desc": null,
            "thumbnailUrl": "",
            "title": "www.telegraph.co.uk/finance/newsbysector/transport/11113207/Extend-20-mph-limit-across-all-urban-areas-to-allow-children-to-roam-wild-Labour-shadow-transport-secretary-says.html"
        }
    ],
    "start_at": null,
    "end_at": null,
    "publish": false,
    "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": 2,
    "direct_value": 2.5,
    "direct_sum": -1.0,
    "direct_heat": 0.0773993808049536,
    "direct_consensus": 0.25,
    "direct_skipped": 0,
    "direct_minimum": 1,
    "direct_low": 0,
    "direct_medium": 0,
    "direct_high": 1,
    "direct_maximum": 0,
    "created_at": "2015-06-09T06:36:56.222000Z",
    "modified_at": "2017-03-06T20:37:37.117454Z",
    "liquid_vote_count": 2,
    "liquid_value": 2.5,
    "liquid_sum": -1.0,
    "liquid_heat": 0.0773993808049536,
    "liquid_consensus": 0.0,
    "liquid_skipped": 0,
    "liquid_minimum": 1,
    "liquid_low": 0,
    "liquid_medium": 0,
    "liquid_high": 1,
    "liquid_maximum": 0,
    "polarisation": 0.273861278752583
}