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

{
    "id": 3640,
    "url": "https://api.represent.me/api/questions/3640/",
    "question": "Members of public company and public sector boards should...",
    "slug": "members-of-public-company-and-public-sector-boards-should",
    "my_vote": [],
    "user": {
        "id": 17687,
        "username": "greenpartypolicies",
        "first_name": "Green",
        "last_name": "Party (Eng & Wal) Policies",
        "url": "https://api.represent.me/api/users/17687/",
        "photo": "https://s3.eu-central-1.amazonaws.com:443/static.represent.me/images/03c8d0db-89f9-4618-9e22-26290e3b0f87.png",
        "age": 29,
        "latest_compare": [],
        "follow": [],
        "locations": [
            "https://api.represent.me/api/user_geos/744972/",
            "https://api.represent.me/api/user_geos/744971/",
            "https://api.represent.me/api/user_geos/744970/",
            "https://api.represent.me/api/user_geos/744969/",
            "https://api.represent.me/api/user_geos/744968/",
            "https://api.represent.me/api/user_geos/744967/"
        ],
        "bio": "The Green Party of England & Wales isn't on Represent yet. Their answers are based on their 2017 manifesto and communications.",
        "created_at": "2017-05-16T09:26:13.665828Z",
        "modified_at": "2019-04-15T15:54:58.693235Z",
        "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": 9104,
            "question_count": 923,
            "created_at": "2016-03-20T04:26:45.483907Z",
            "type_description": null,
            "parent": null,
            "parent_url": null,
            "politicians": [],
            "modified_at": "2019-11-08T14:36:30.842961Z"
        },
        "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": 7886,
            "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-08T14:36:30.820979Z"
        },
        "last_answer_time": "2017-06-01T16:41:56.095900Z",
        "politician": null,
        "politician_info": null,
        "is_email_verified": true,
        "is_admin_verified": false,
        "is_facebook_verified": false,
        "is_google_verified": false,
        "is_twitter_verified": false,
        "is_linkedin_verified": false,
        "is_stripe_verified": false,
        "verification_count": 1,
        "verification_score": 59,
        "count_questions": 17,
        "count_votes": 93,
        "count_question_votes": 84,
        "count_friends": 0,
        "count_comment_votes": 0,
        "count_choice_votes": 9,
        "count_group_memberships": 1,
        "count_following_tags": 2,
        "count_comments": 0,
        "count_following_users": 1,
        "count_followers": 25,
        "karma": 0
    },
    "tags": [
        {
            "id": 8965,
            "tag": {
                "id": 803,
                "text": "ge2017",
                "followers_count": 1,
                "questions_count": 136,
                "votes_count": 175339
            },
            "created_at": "2017-05-22T15:11:09.830882Z",
            "modified_at": "2017-05-22T15:11:09.831237Z",
            "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": 8964,
            "tag": {
                "id": 92,
                "text": "Gender",
                "followers_count": 59,
                "questions_count": 19,
                "votes_count": 20495
            },
            "created_at": "2017-05-22T15:11:09.812597Z",
            "modified_at": "2017-05-22T15:11:09.812949Z",
            "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": 8963,
            "tag": {
                "id": 162,
                "text": "equality",
                "followers_count": 68,
                "questions_count": 66,
                "votes_count": 36750
            },
            "created_at": "2017-05-22T15:11:09.793539Z",
            "modified_at": "2017-05-22T15:11:09.793939Z",
            "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": 8962,
            "tag": {
                "id": 9,
                "text": "business",
                "followers_count": 50,
                "questions_count": 96,
                "votes_count": 65084
            },
            "created_at": "2017-05-22T15:11:09.770428Z",
            "modified_at": "2017-05-22T15:11:09.770835Z",
            "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": 1305,
            "url": "https://api.represent.me/api/question_choices/1305/",
            "text": "be at least 25% women",
            "mongo_number": 1,
            "direct_vote_count": 34,
            "direct_value": 5.0,
            "direct_sum": 68.0,
            "direct_heat": 3.66379310344828,
            "direct_consensus": 1.0,
            "direct_skipped": 0,
            "direct_minimum": 0,
            "direct_low": 0,
            "direct_medium": 0,
            "direct_high": 0,
            "direct_maximum": 34,
            "created_at": "2017-05-22T15:11:09.744981Z",
            "modified_at": "2018-08-19T20:14:49.011254Z",
            "liquid_vote_count": 34,
            "liquid_value": 5.0,
            "liquid_sum": 68.0,
            "liquid_heat": 3.66379310344828,
            "liquid_consensus": 1.0,
            "liquid_skipped": 0,
            "liquid_minimum": 0,
            "liquid_low": 0,
            "liquid_medium": 0,
            "liquid_high": 0,
            "liquid_maximum": 34,
            "polarisation": 0.447213595499958
        },
        {
            "id": 1322,
            "url": "https://api.represent.me/api/question_choices/1322/",
            "text": "be diverse by gender",
            "mongo_number": null,
            "direct_vote_count": 145,
            "direct_value": 5.0,
            "direct_sum": 290.0,
            "direct_heat": 15.6926406926407,
            "direct_consensus": 1.0,
            "direct_skipped": 0,
            "direct_minimum": 0,
            "direct_low": 0,
            "direct_medium": 0,
            "direct_high": 0,
            "direct_maximum": 145,
            "created_at": "2017-05-24T09:15:26.927178Z",
            "modified_at": "2018-08-19T20:14:49.024760Z",
            "liquid_vote_count": 145,
            "liquid_value": 5.0,
            "liquid_sum": 290.0,
            "liquid_heat": 15.6926406926407,
            "liquid_consensus": 1.0,
            "liquid_skipped": 0,
            "liquid_minimum": 0,
            "liquid_low": 0,
            "liquid_medium": 0,
            "liquid_high": 0,
            "liquid_maximum": 145,
            "polarisation": 0.447213595499958
        },
        {
            "id": 1304,
            "url": "https://api.represent.me/api/question_choices/1304/",
            "text": "be at least 40% women",
            "mongo_number": 0,
            "direct_vote_count": 102,
            "direct_value": 5.0,
            "direct_sum": 204.0,
            "direct_heat": 10.9913793103448,
            "direct_consensus": 1.0,
            "direct_skipped": 0,
            "direct_minimum": 0,
            "direct_low": 0,
            "direct_medium": 0,
            "direct_high": 0,
            "direct_maximum": 102,
            "created_at": "2017-05-22T15:11:09.736769Z",
            "modified_at": "2018-08-19T20:14:49.041452Z",
            "liquid_vote_count": 102,
            "liquid_value": 5.0,
            "liquid_sum": 204.0,
            "liquid_heat": 10.9913793103448,
            "liquid_consensus": 1.0,
            "liquid_skipped": 0,
            "liquid_minimum": 0,
            "liquid_low": 0,
            "liquid_medium": 0,
            "liquid_high": 0,
            "liquid_maximum": 102,
            "polarisation": 0.447213595499958
        },
        {
            "id": 1307,
            "url": "https://api.represent.me/api/question_choices/1307/",
            "text": "not be required to have a specific gender mix",
            "mongo_number": 3,
            "direct_vote_count": 177,
            "direct_value": 5.0,
            "direct_sum": 354.0,
            "direct_heat": 19.073275862069,
            "direct_consensus": 1.0,
            "direct_skipped": 0,
            "direct_minimum": 0,
            "direct_low": 0,
            "direct_medium": 0,
            "direct_high": 0,
            "direct_maximum": 177,
            "created_at": "2017-05-22T15:11:09.762981Z",
            "modified_at": "2018-08-19T20:14:49.055716Z",
            "liquid_vote_count": 177,
            "liquid_value": 5.0,
            "liquid_sum": 354.0,
            "liquid_heat": 19.073275862069,
            "liquid_consensus": 1.0,
            "liquid_skipped": 0,
            "liquid_minimum": 0,
            "liquid_low": 0,
            "liquid_medium": 0,
            "liquid_high": 0,
            "liquid_maximum": 177,
            "polarisation": 0.447213595499958
        },
        {
            "id": 1306,
            "url": "https://api.represent.me/api/question_choices/1306/",
            "text": "have the best people for the job",
            "mongo_number": 2,
            "direct_vote_count": 1078,
            "direct_value": 5.0,
            "direct_sum": 2156.0,
            "direct_heat": 116.163793103448,
            "direct_consensus": 1.0,
            "direct_skipped": 0,
            "direct_minimum": 0,
            "direct_low": 0,
            "direct_medium": 0,
            "direct_high": 0,
            "direct_maximum": 1078,
            "created_at": "2017-05-22T15:11:09.752530Z",
            "modified_at": "2018-08-19T20:14:49.073468Z",
            "liquid_vote_count": 1078,
            "liquid_value": 5.0,
            "liquid_sum": 2156.0,
            "liquid_heat": 116.163793103448,
            "liquid_consensus": 1.0,
            "liquid_skipped": 0,
            "liquid_minimum": 0,
            "liquid_low": 0,
            "liquid_medium": 0,
            "liquid_high": 0,
            "liquid_maximum": 1078,
            "polarisation": 0.447213595499958
        },
        {
            "id": 1321,
            "url": "https://api.represent.me/api/question_choices/1321/",
            "text": "be diverse by gender and ethnicity",
            "mongo_number": null,
            "direct_vote_count": 750,
            "direct_value": 5.0,
            "direct_sum": 1500.0,
            "direct_heat": 81.1688311688312,
            "direct_consensus": 1.0,
            "direct_skipped": 0,
            "direct_minimum": 0,
            "direct_low": 0,
            "direct_medium": 0,
            "direct_high": 0,
            "direct_maximum": 750,
            "created_at": "2017-05-24T09:15:26.925639Z",
            "modified_at": "2018-08-19T20:14:49.089778Z",
            "liquid_vote_count": 750,
            "liquid_value": 5.0,
            "liquid_sum": 1500.0,
            "liquid_heat": 81.1688311688312,
            "liquid_consensus": 1.0,
            "liquid_skipped": 0,
            "liquid_minimum": 0,
            "liquid_low": 0,
            "liquid_medium": 0,
            "liquid_high": 0,
            "liquid_maximum": 750,
            "polarisation": 0.447213595499958
        }
    ],
    "description": "",
    "perodic_repeat_interval": null,
    "ogImage": null,
    "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": 9511,
        "question_count": 186,
        "created_at": "2016-11-18T11:48:43Z",
        "type_description": null,
        "parent": null,
        "parent_url": null,
        "politicians": [],
        "modified_at": "2019-11-08T14:36:30.787531Z"
    },
    "group_url": null,
    "geo_url": "https://api.represent.me/api/geos/20977/",
    "links": [],
    "start_at": null,
    "end_at": null,
    "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": 2286,
    "direct_value": 0.0,
    "direct_sum": 4572.0,
    "direct_heat": 98.5344827586207,
    "direct_consensus": 0.47156605424322,
    "direct_skipped": 0,
    "direct_minimum": 0,
    "direct_low": 0,
    "direct_medium": 0,
    "direct_high": 0,
    "direct_maximum": 0,
    "created_at": "2017-05-22T15:11:09.710195Z",
    "modified_at": "2018-08-19T20:14:49.104172Z",
    "liquid_vote_count": 2286,
    "liquid_value": 0.0,
    "liquid_sum": 4572.0,
    "liquid_heat": 98.5344827586207,
    "liquid_consensus": 0.47156605424322,
    "liquid_skipped": 0,
    "liquid_minimum": 0,
    "liquid_low": 0,
    "liquid_medium": 0,
    "liquid_high": 0,
    "liquid_maximum": 0,
    "polarisation": 0.0
}