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

{
    "id": 3507,
    "url": "https://api.represent.me/api/questions/3507/",
    "question": "If you could vote for a candidate like Emmanuel Macron, would you vote for them?",
    "slug": "if-you-could-vote-for-a-candidate-like-emmanuel-macron-would-you-vote-for-them",
    "my_vote": [],
    "user": {
        "id": 7,
        "username": "eddowding",
        "first_name": "Ed",
        "last_name": "Dowding",
        "url": "https://api.represent.me/api/users/7/",
        "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/",
            "https://api.represent.me/api/user_geos/750851/",
            "https://api.represent.me/api/user_geos/750850/",
            "https://api.represent.me/api/user_geos/750849/",
            "https://api.represent.me/api/user_geos/750848/"
        ],
        "bio": "Eventually, everything will be recognised as priceless.",
        "created_at": "2015-01-31T09:10:43.588000Z",
        "modified_at": "2019-08-21T05:09:17.516802Z",
        "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/",
            "politicians": [],
            "modified_at": "2019-07-27T09:51:07.055081Z"
        },
        "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": 8585,
            "tag": {
                "id": 2,
                "text": "politics",
                "followers_count": 693,
                "questions_count": 478,
                "votes_count": 145845
            },
            "created_at": "2017-05-09T06:35:26.580172Z",
            "modified_at": "2017-05-09T06:35:26.580483Z",
            "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": 1194,
            "url": "https://api.represent.me/api/question_choices/1194/",
            "text": "Yes",
            "mongo_number": 0,
            "direct_vote_count": 2,
            "direct_value": 5.0,
            "direct_sum": 4.0,
            "direct_heat": 2.56410256410256,
            "direct_consensus": 1.0,
            "direct_skipped": 0,
            "direct_minimum": 0,
            "direct_low": 0,
            "direct_medium": 0,
            "direct_high": 0,
            "direct_maximum": 2,
            "created_at": "2017-05-09T06:35:26.570554Z",
            "modified_at": "2017-06-07T18:14:10.526383Z",
            "liquid_vote_count": 2,
            "liquid_value": 5.0,
            "liquid_sum": 4.0,
            "liquid_heat": 2.56410256410256,
            "liquid_consensus": 1.0,
            "liquid_skipped": 0,
            "liquid_minimum": 0,
            "liquid_low": 0,
            "liquid_medium": 0,
            "liquid_high": 0,
            "liquid_maximum": 2,
            "polarisation": 0.447213595499958
        },
        {
            "id": 1195,
            "url": "https://api.represent.me/api/question_choices/1195/",
            "text": "No",
            "mongo_number": 1,
            "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": "2017-05-09T06:35:26.574328Z",
            "modified_at": "2017-06-07T18:14:10.548452Z",
            "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": "https://s3.eu-central-1.amazonaws.com:443/static.represent.me/images/1cf23aab-3e04-47e4-b4f8-f7649e4c4bc7.png",
    "subtype": "mcq",
    "topic": null,
    "topic_info": null,
    "group": null,
    "geo": 20977,
    "geo_info": {
        "id": 20977,
        "ID": "E1",
        "name": "Europe",
        "m_type": "country",
        "location": {
            "type": "Point",
            "coordinates": [
                8.542895397135718,
                50.13662306127327
            ]
        },
        "members_count": 9491,
        "question_count": 185,
        "created_at": "2016-11-18T11:48:43Z",
        "type_description": null,
        "parent": null,
        "parent_url": null,
        "politicians": [],
        "modified_at": "2019-07-27T09:51:07.024282Z"
    },
    "group_url": null,
    "geo_url": "https://api.represent.me/api/geos/20977/",
    "links": [
        {
            "id": 432,
            "url": "https://api.represent.me/api/question_links/432/",
            "link": "https://en.wikipedia.org/wiki/Emmanuel_Macronhttp://",
            "desc": "",
            "thumbnailUrl": null,
            "title": "https://en.wikipedia.org/wiki/Emmanuel_Macronhttp://"
        }
    ],
    "start_at": null,
    "end_at": "2017-06-12T06:23:51.490000Z",
    "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": 2,
    "direct_value": 0.0,
    "direct_sum": 4.0,
    "direct_heat": 1.02564102564103,
    "direct_consensus": 1.0,
    "direct_skipped": 0,
    "direct_minimum": 0,
    "direct_low": 0,
    "direct_medium": 0,
    "direct_high": 0,
    "direct_maximum": 0,
    "created_at": "2017-05-09T06:35:26.450067Z",
    "modified_at": "2017-06-07T18:14:10.567747Z",
    "liquid_vote_count": 2,
    "liquid_value": 0.0,
    "liquid_sum": 4.0,
    "liquid_heat": 1.02564102564103,
    "liquid_consensus": 1.0,
    "liquid_skipped": 0,
    "liquid_minimum": 0,
    "liquid_low": 0,
    "liquid_medium": 0,
    "liquid_high": 0,
    "liquid_maximum": 0,
    "polarisation": 0.0
}