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

{
    "id": 2869,
    "url": "https://api.represent.me/api/questions/2869/",
    "question": "How did you vote in the UK's EU referendum in June 2016?",
    "slug": "how-did-you-vote-in-the-uks-eu-referendum-in-june-2016",
    "my_vote": [],
    "user": {
        "id": 4680,
        "username": "kcorrick",
        "first_name": "Kathryn",
        "last_name": "Corrick",
        "url": "https://api.represent.me/api/users/4680/",
        "photo": "https://s3.eu-central-1.amazonaws.com:443/static.represent.me/images/profile_pic_4680_R4815ev.jpg",
        "age": 45,
        "latest_compare": [],
        "follow": [],
        "locations": [
            "https://api.represent.me/api/user_geos/761471/",
            "https://api.represent.me/api/user_geos/761470/",
            "https://api.represent.me/api/user_geos/761469/",
            "https://api.represent.me/api/user_geos/761468/",
            "https://api.represent.me/api/user_geos/761467/",
            "https://api.represent.me/api/user_geos/761466/"
        ],
        "bio": "",
        "created_at": "2016-01-03T09:29:59Z",
        "modified_at": "2019-10-31T11:13:03.014276Z",
        "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": 9108,
            "question_count": 923,
            "created_at": "2016-03-20T04:26:45.483907Z",
            "type_description": null,
            "parent": null,
            "parent_url": null,
            "politicians": [],
            "modified_at": "2019-11-22T13:00:12.936521Z"
        },
        "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": 7890,
            "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-11-22T13:00:12.886674Z"
        },
        "last_answer_time": "2019-06-06T16:17:08.901183Z",
        "politician": null,
        "politician_info": null,
        "is_email_verified": true,
        "is_admin_verified": true,
        "is_facebook_verified": true,
        "is_google_verified": false,
        "is_twitter_verified": false,
        "is_linkedin_verified": false,
        "is_stripe_verified": false,
        "verification_count": 3,
        "verification_score": 100,
        "count_questions": 191,
        "count_votes": 934,
        "count_question_votes": 822,
        "count_friends": 47,
        "count_comment_votes": 43,
        "count_choice_votes": 112,
        "count_group_memberships": 18,
        "count_following_tags": 14,
        "count_comments": 47,
        "count_following_users": 227,
        "count_followers": 32,
        "karma": 2
    },
    "tags": [
        {
            "id": 6746,
            "tag": {
                "id": 769,
                "text": "important",
                "followers_count": 0,
                "questions_count": 1682,
                "votes_count": 721342
            },
            "created_at": "2017-01-19T14:25:17.182365Z",
            "modified_at": "2017-05-07T21:35:34.605432Z",
            "direct_vote_count": 28,
            "direct_value": 4.71428571428571,
            "direct_sum": 48.0,
            "direct_heat": 11.1864406779661,
            "direct_consensus": 0.73469387755102,
            "direct_skipped": 0,
            "direct_minimum": 2,
            "direct_low": 0,
            "direct_medium": 0,
            "direct_high": 0,
            "direct_maximum": 26
        },
        {
            "id": 6692,
            "tag": {
                "id": 2,
                "text": "politics",
                "followers_count": 696,
                "questions_count": 478,
                "votes_count": 146008
            },
            "created_at": "2017-01-17T17:53:56.382250Z",
            "modified_at": "2017-01-17T17:53:56.382518Z",
            "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": 6693,
            "tag": {
                "id": 606,
                "text": "EUreferendum",
                "followers_count": 48,
                "questions_count": 81,
                "votes_count": 31149
            },
            "created_at": "2017-01-17T17:53:56.389874Z",
            "modified_at": "2017-01-17T17:53:56.390148Z",
            "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": 6691,
            "tag": {
                "id": 791,
                "text": "European Union",
                "followers_count": 6,
                "questions_count": 80,
                "votes_count": 158907
            },
            "created_at": "2017-01-17T17:53:56.373900Z",
            "modified_at": "2017-01-17T17:53:56.374170Z",
            "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": 6690,
            "tag": {
                "id": 787,
                "text": "Brexit",
                "followers_count": 11,
                "questions_count": 141,
                "votes_count": 222419
            },
            "created_at": "2017-01-17T17:53:56.365039Z",
            "modified_at": "2017-01-17T17:53:56.365306Z",
            "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": 982,
            "url": "https://api.represent.me/api/question_choices/982/",
            "text": "I was unable to vote.",
            "mongo_number": null,
            "direct_vote_count": 475,
            "direct_value": 5.0,
            "direct_sum": 950.0,
            "direct_heat": 39.1914191419142,
            "direct_consensus": 1.0,
            "direct_skipped": 0,
            "direct_minimum": 0,
            "direct_low": 0,
            "direct_medium": 0,
            "direct_high": 0,
            "direct_maximum": 475,
            "created_at": "2017-01-18T15:59:35Z",
            "modified_at": "2018-09-07T09:55:12.953153Z",
            "liquid_vote_count": 475,
            "liquid_value": 5.0,
            "liquid_sum": 950.0,
            "liquid_heat": 39.1914191419142,
            "liquid_consensus": 1.0,
            "liquid_skipped": 0,
            "liquid_minimum": 0,
            "liquid_low": 0,
            "liquid_medium": 0,
            "liquid_high": 0,
            "liquid_maximum": 475,
            "polarisation": 0.447213595499958
        },
        {
            "id": 975,
            "url": "https://api.represent.me/api/question_choices/975/",
            "text": "Leave the EU",
            "mongo_number": null,
            "direct_vote_count": 580,
            "direct_value": 5.0,
            "direct_sum": 1160.0,
            "direct_heat": 47.7759472817133,
            "direct_consensus": 1.0,
            "direct_skipped": 0,
            "direct_minimum": 0,
            "direct_low": 0,
            "direct_medium": 0,
            "direct_high": 0,
            "direct_maximum": 580,
            "created_at": "2017-01-17T17:53:56.357019Z",
            "modified_at": "2018-09-07T09:55:12.971335Z",
            "liquid_vote_count": 580,
            "liquid_value": 5.0,
            "liquid_sum": 1160.0,
            "liquid_heat": 47.7759472817133,
            "liquid_consensus": 1.0,
            "liquid_skipped": 0,
            "liquid_minimum": 0,
            "liquid_low": 0,
            "liquid_medium": 0,
            "liquid_high": 0,
            "liquid_maximum": 580,
            "polarisation": 0.447213595499958
        },
        {
            "id": 976,
            "url": "https://api.represent.me/api/question_choices/976/",
            "text": "Stay in the EU",
            "mongo_number": null,
            "direct_vote_count": 2923,
            "direct_value": 5.0,
            "direct_sum": 5846.0,
            "direct_heat": 240.774299835255,
            "direct_consensus": 1.0,
            "direct_skipped": 0,
            "direct_minimum": 0,
            "direct_low": 0,
            "direct_medium": 0,
            "direct_high": 0,
            "direct_maximum": 2923,
            "created_at": "2017-01-17T17:53:56.360115Z",
            "modified_at": "2018-09-07T09:55:13.004767Z",
            "liquid_vote_count": 2923,
            "liquid_value": 5.0,
            "liquid_sum": 5846.0,
            "liquid_heat": 240.774299835255,
            "liquid_consensus": 1.0,
            "liquid_skipped": 0,
            "liquid_minimum": 0,
            "liquid_low": 0,
            "liquid_medium": 0,
            "liquid_high": 0,
            "liquid_maximum": 2923,
            "polarisation": 0.447213595499958
        },
        {
            "id": 977,
            "url": "https://api.represent.me/api/question_choices/977/",
            "text": "I didn't vote",
            "mongo_number": null,
            "direct_vote_count": 107,
            "direct_value": 5.0,
            "direct_sum": 214.0,
            "direct_heat": 8.81383855024712,
            "direct_consensus": 1.0,
            "direct_skipped": 0,
            "direct_minimum": 0,
            "direct_low": 0,
            "direct_medium": 0,
            "direct_high": 0,
            "direct_maximum": 107,
            "created_at": "2017-01-17T17:53:56Z",
            "modified_at": "2018-09-07T09:55:13.019428Z",
            "liquid_vote_count": 107,
            "liquid_value": 5.0,
            "liquid_sum": 214.0,
            "liquid_heat": 8.81383855024712,
            "liquid_consensus": 1.0,
            "liquid_skipped": 0,
            "liquid_minimum": 0,
            "liquid_low": 0,
            "liquid_medium": 0,
            "liquid_high": 0,
            "liquid_maximum": 107,
            "polarisation": 0.447213595499958
        }
    ],
    "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": 9108,
        "question_count": 923,
        "created_at": "2016-03-20T04:26:45.483907Z",
        "type_description": null,
        "parent": null,
        "parent_url": null,
        "politicians": [],
        "modified_at": "2019-11-22T13:00:12.936521Z"
    },
    "group_url": null,
    "geo_url": "https://api.represent.me/api/geos/59/",
    "links": [],
    "start_at": null,
    "end_at": null,
    "publish": true,
    "count_comments": 1,
    "count_comments_suggestion": 0,
    "count_comments_reason": 1,
    "count_comments_info": 0,
    "group_name": null,
    "their_vote": [],
    "my_importance": [],
    "direct_vote_count": 4085,
    "direct_value": 0.0,
    "direct_sum": 8170.0,
    "direct_heat": 134.596375617792,
    "direct_consensus": 0.715544675642595,
    "direct_skipped": 0,
    "direct_minimum": 0,
    "direct_low": 0,
    "direct_medium": 0,
    "direct_high": 0,
    "direct_maximum": 0,
    "created_at": "2017-01-17T17:53:56.333724Z",
    "modified_at": "2018-09-07T09:55:13.033347Z",
    "liquid_vote_count": 4085,
    "liquid_value": 0.0,
    "liquid_sum": 8170.0,
    "liquid_heat": 134.596375617792,
    "liquid_consensus": 0.715544675642595,
    "liquid_skipped": 0,
    "liquid_minimum": 0,
    "liquid_low": 0,
    "liquid_medium": 0,
    "liquid_high": 0,
    "liquid_maximum": 0,
    "polarisation": 0.0
}