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

{
    "id": 1638,
    "url": "https://api.represent.me/api/questions/1638/",
    "question": "What's your favourite colour?",
    "slug": "whats-your-favourite-colour",
    "my_vote": [],
    "user": {
        "id": 6,
        "username": "represent_admin",
        "first_name": "Ed",
        "last_name": "Dowding",
        "url": "https://api.represent.me/api/users/6/",
        "photo": "https://s3.eu-central-1.amazonaws.com:443/static.represent.me/images/21665-1b6h8j.png",
        "age": 42,
        "latest_compare": [],
        "follow": [],
        "locations": [],
        "bio": "This is Team Represent! We want to modernise democracy so that together we can be do great things! Sometimes ask provocative questions!",
        "created_at": "2015-01-29T15:24:49.581000Z",
        "modified_at": "2019-11-21T19:20:36.991093Z",
        "is_deleted": false,
        "country": null,
        "country_info": null,
        "region": null,
        "region_info": null,
        "last_answer_time": "2019-06-13T18:15:23.872299Z",
        "politician": null,
        "politician_info": null,
        "is_email_verified": false,
        "is_admin_verified": false,
        "is_facebook_verified": false,
        "is_google_verified": true,
        "is_twitter_verified": false,
        "is_linkedin_verified": false,
        "is_stripe_verified": false,
        "verification_count": 1,
        "verification_score": 70,
        "count_questions": 807,
        "count_votes": 325,
        "count_question_votes": 319,
        "count_friends": 0,
        "count_comment_votes": 17,
        "count_choice_votes": 6,
        "count_group_memberships": 11,
        "count_following_tags": 7,
        "count_comments": 11,
        "count_following_users": 0,
        "count_followers": 20337,
        "karma": 24
    },
    "tags": [
        {
            "id": 2969,
            "tag": {
                "id": 520,
                "text": "colours",
                "followers_count": 0,
                "questions_count": 1,
                "votes_count": 0
            },
            "created_at": "2016-03-20T04:30:01.998942Z",
            "modified_at": "2016-03-29T15:55:28.071270Z",
            "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": [
        {
            "id": 9,
            "url": "https://api.represent.me/api/question_choices/9/",
            "text": "green",
            "mongo_number": 2,
            "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": "2016-03-20T04:30:02.009290Z",
            "modified_at": "2017-03-06T20:37:18.423367Z",
            "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
        },
        {
            "id": 10,
            "url": "https://api.represent.me/api/question_choices/10/",
            "text": "purple",
            "mongo_number": 3,
            "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": "2016-03-20T04:30:02.012166Z",
            "modified_at": "2017-03-06T20:37:18.441240Z",
            "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
        },
        {
            "id": 8,
            "url": "https://api.represent.me/api/question_choices/8/",
            "text": "blue",
            "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": "2016-03-20T04:30:02.006495Z",
            "modified_at": "2017-03-06T20:37:18.472127Z",
            "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
        },
        {
            "id": 7,
            "url": "https://api.represent.me/api/question_choices/7/",
            "text": "red",
            "mongo_number": 0,
            "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": "2016-03-20T04:30:02.003387Z",
            "modified_at": "2017-03-06T20:37:18.491533Z",
            "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": null,
    "subtype": "mcq",
    "topic": null,
    "topic_info": null,
    "group": null,
    "geo": null,
    "geo_info": null,
    "group_url": null,
    "geo_url": null,
    "links": [],
    "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": 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": "2015-12-07T20:00:26.860000Z",
    "modified_at": "2017-03-06T20:37:18.510579Z",
    "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
}