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

{
    "id": 966,
    "url": "https://api.represent.me/api/questions/966/",
    "question": "Should the UK stay in the European Union?",
    "slug": "should-the-uk-stay-in-the-european-union",
    "my_vote": [],
    "user": {
        "id": 573,
        "username": "ben_walters",
        "first_name": "Ben",
        "last_name": "Walters",
        "url": "https://api.represent.me/api/users/573/",
        "photo": "https://s3.eu-central-1.amazonaws.com:443/static.represent.me/images/profile_pic_573.jpg",
        "age": 49,
        "latest_compare": [],
        "follow": [],
        "locations": [
            "https://api.represent.me/api/user_geos/733046/",
            "https://api.represent.me/api/user_geos/733045/",
            "https://api.represent.me/api/user_geos/733044/",
            "https://api.represent.me/api/user_geos/733043/",
            "https://api.represent.me/api/user_geos/733042/"
        ],
        "bio": "",
        "created_at": "2015-05-20T04:34:31.544000Z",
        "modified_at": "2019-04-15T15:51:42.701097Z",
        "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": 9093,
            "question_count": 923,
            "created_at": "2016-03-20T04:26:45.483907Z",
            "type_description": null,
            "parent": null,
            "parent_url": null,
            "politicians": [],
            "modified_at": "2019-10-01T16:01:15.905104Z"
        },
        "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": 7875,
            "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-10-01T16:01:15.883160Z"
        },
        "last_answer_time": "2016-07-15T12:29:06.345278Z",
        "politician": null,
        "politician_info": null,
        "is_email_verified": false,
        "is_admin_verified": false,
        "is_facebook_verified": true,
        "is_google_verified": false,
        "is_twitter_verified": false,
        "is_linkedin_verified": false,
        "is_stripe_verified": false,
        "verification_count": 1,
        "verification_score": 70,
        "count_questions": 1,
        "count_votes": 254,
        "count_question_votes": 250,
        "count_friends": 0,
        "count_comment_votes": 0,
        "count_choice_votes": 4,
        "count_group_memberships": 1,
        "count_following_tags": 1,
        "count_comments": 0,
        "count_following_users": 1,
        "count_followers": 1,
        "karma": 0
    },
    "tags": [
        {
            "id": 5195,
            "tag": {
                "id": 769,
                "text": "important",
                "followers_count": 0,
                "questions_count": 1680,
                "votes_count": 720783
            },
            "created_at": "2016-11-21T19:45:27.349939Z",
            "modified_at": "2019-07-05T16:02:06.317213Z",
            "direct_vote_count": 106,
            "direct_value": 4.73584905660377,
            "direct_sum": 184.0,
            "direct_heat": 5.2020725388601,
            "direct_consensus": 0.753292986828053,
            "direct_skipped": 0,
            "direct_minimum": 7,
            "direct_low": 0,
            "direct_medium": 0,
            "direct_high": 0,
            "direct_maximum": 99
        },
        {
            "id": 3530,
            "tag": {
                "id": 584,
                "text": "principle",
                "followers_count": 20195,
                "questions_count": 86,
                "votes_count": 98346
            },
            "created_at": "2016-04-04T21:05:39.065365Z",
            "modified_at": "2016-04-04T21:05:39.065717Z",
            "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": 3841,
            "tag": {
                "id": 5,
                "text": "europe",
                "followers_count": 375,
                "questions_count": 63,
                "votes_count": 21141
            },
            "created_at": "2016-04-19T10:42:56.689022Z",
            "modified_at": "2016-04-19T10:42:56.722260Z",
            "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": 3859,
            "tag": {
                "id": 606,
                "text": "EUreferendum",
                "followers_count": 48,
                "questions_count": 81,
                "votes_count": 31138
            },
            "created_at": "2016-04-24T11:07:51.175530Z",
            "modified_at": "2016-04-24T11:07:51.175877Z",
            "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": "",
    "perodic_repeat_interval": null,
    "ogImage": null,
    "subtype": "likert",
    "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": true,
    "count_comments": 12,
    "count_comments_suggestion": 1,
    "count_comments_reason": 11,
    "count_comments_info": 0,
    "group_name": null,
    "their_vote": [],
    "my_importance": [],
    "direct_vote_count": 4029,
    "direct_value": 4.15214693472326,
    "direct_sum": 4642.0,
    "direct_heat": 104.490943160525,
    "direct_consensus": 0.514941346373072,
    "direct_skipped": 456,
    "direct_minimum": 391,
    "direct_low": 212,
    "direct_medium": 95,
    "direct_high": 1026,
    "direct_maximum": 2305,
    "created_at": "2015-05-20T04:43:55.785000Z",
    "modified_at": "2019-09-27T22:47:13.270080Z",
    "liquid_vote_count": 4029,
    "liquid_value": 4.15214693472326,
    "liquid_sum": 4642.0,
    "liquid_heat": 104.490943160525,
    "liquid_consensus": 0.677091089600397,
    "liquid_skipped": 456,
    "liquid_minimum": 391,
    "liquid_low": 212,
    "liquid_medium": 95,
    "liquid_high": 1026,
    "liquid_maximum": 2305,
    "polarisation": 0.226325108079639
}