API Documentation

BuzzVoteProfile:

Accepted methods:

GET, POST

Methods:

read(method=<optional>, id=<optional>, user_id=<optional>, count=<optional>, start=<optional>, end=<optional>):

Return BuzzVote Profile information.

  • Fetch the profile of a user specified by 'id':

    $ curl -u username "https://www.buzzvote.com/api/1/profile/{id}/"
    

Example:

$ curl -u buzzvote "http://buzzvote.tld/api/1/profiles/json/b35c36f7-8203-4b1b-b9b7-b4d26e8aaba9/"
Enter host password for user 'buzzvote':
{
    "username": "jim",
    "number_of_votes_caused": 539,
    "number_of_polls_added": 93,
    "number_of_followers": 38,
    "number_following": 3,
    "id": "b35c36f7-8203-4b1b-b9b7-b4d26e8aaba9",
    "number_of_votes_cast": 543
}
  • Fetch the profile of the logged in user:

    $ curl -u username "https://www.buzzvote.com/api/1/profile/me/"
    
  • Fetch the list of people a profile 'id' is following along with optional indexes 'start' and 'end':

    $ curl -u username "https://www.buzzvote.com/api/1/profile/{id}/following/{start}/{end}/"
    

Example:

$ curl -u username "https://www.buzzvote.com/api/1/profile/buzzvote/following/"
Enter the host password for user 'username':
[
    {
        "username": "tom",
        "number_of_votes_caused": 133,
        "number_of_polls_added": 6,
        "number_of_followers": 6,
        "number_following": 0,
        "id": "5b085378-c8ae-4613-af27-29b22ad0c42b",
        "number_of_votes_cast": 121
    }
]
  • Fetch a list of followers for a profile 'id with optional indexes 'start' and 'end':

    $ curl -u username "https://www.buzzvote.com/api/1/profile/{id}/followers/{start}/{end}/"
    
  • Fetch the list of profiles of top voters indexed by (optional) 'start' and 'end':

    $ curl -u username "https://www.buzzvote.com/api/1/top_voters/{start}/{end}/"
    

Example:

$ curl -u username "https://www.buzzvote.com/api/1/top_voters/1/3/"

The above example returns the top voters from 1 and 3. If the start and end are not specified, the top 5 voters are returned.

  • Fetch a list of profiles of top voters indexed by (optional) count:

    $ curl -u username "https://www.buzzvote.com/api/1/top_voters/{count}/"
    

Example:

$ curl -u username "https://www.buzzvote.com/api/1/top_voters/3/"

The above example returns the top 3 voters. If the count is not specified, the first 5 top voters are returned.

  • Fetch the list of profiles of top vote getters indexed by (optional) 'start' and 'end':

    $ curl -u username "https://www.buzzvote.com/api/1/top_vote_getters/{start}/{end}/"
    
  • Fetch a list of profiles of top vote getters indexed by (optional) count:

    $ curl -u username "https://www.buzzvote.com/api/1/top_vote_getters/{count}/"
    
  • Fetch the list of profiles of top questions indexed by (optional) 'start' and 'end':

    $ curl -u username "https://www.buzzvote.com/api/1/top_questions/{start}/{end}/"
    
  • Fetch a list of profiles of top questions indexed by (optional) count:

    $ curl -u username "https://www.buzzvote.com/api/1/top_questions/{count}/"
    
  • Fetch the currently logged in user's voter rank:

    $ curl -u username "https://www.buzzvote.com/api/1/profile/voters/my_standing/"
    

Example:

$ curl -u jim
Enter host password for user 'jim':
{
    "username": "jim",
    "number_of_votes_caused": 577,
    "number_of_polls_added": 60,
    "number_of_followers": 38,
    "voters_standing": 1,
    "number_following": 3,
    "id": "b35c36f7-8203-4b1b-b9b7-b4d26e8aaba9",
    "number_of_votes_cast": 587
}
  • Fetch the currently logged in user's vote getter rank:

    $ curl -u username "https://www.buzzvote.com/api/1/profile/vote_getters/my_standing/"
    
  • Fetch the currently logged in user's highest voted question rank:

    $ curl -u username "https://www.buzzvote.com/api/1/profile/question/my_standing/"
    

create(user_id=<optional>, method=<optional>):

  • Make the logged in user follow a profile specified by 'id'. This call returns the followed profile details on success.:

    $ curl -u username -X POST -H 'Content-Type: application/x-www-form-urlencoded' -d 'user_id={id}' "https://www.buzzvote.com/api/1/profile/follow/"
    
  • Make the logged in user unfollow a profile specified by 'id'. This call returns the unfollowed profile details on success.:

    $ curl -u username -X POST -H 'Content-Type: application/x-www-form-urlencoded' -d 'user_id={id}' "https://www.buzzvote.com/api/1/profile/unfollow/"
    

update() - inherited

delete() - inherited

Category:

Accepted methods:

GET

Methods:

read():

Returns a list of available categories:

$ curl -u username "https://www.buzzvote.com/api/1/questions/categories/"

create() - inherited

update() - inherited

delete() - inherited

Avatar:

Accepted methods:

GET, POST

Methods:

read(id=<optional>):

Returns an avatar, if id is given:

$ curl -u username "https://www.buzzvote.com/api/1/avatars/json/{id}/"

This returns a JSON object with the URL to the originally uploaded avatar and a thumbnail.

create():

Upload a new avatar:

$ curl -u username -X POST -H 'Content-Type: multipart/form-data' -d 'avatar=@filename' "https://www.buzzvote.com/api/1/avatars/"

update() - inherited

delete() - inherited

AnonymousBuzzVoteProfile:

Accepted methods:

POST

Methods:

read(method=<optional>, id=<optional>, user_id=<optional>, count=<optional>, start=<optional>, end=<optional>):

Intentionally not implemented.

create(id=<optional>, activation_key=<optional>, method=<optional>, uidb36=<optional>, token=<optional>):

Confirm a newly signed up profile using the activation_key provided in the email (required):

curl -X POST -H 'Content-Type: application/x-www-form-urlencoded' "https://www.buzzvote.com/api/1/profile/confirm/ab3f039d42ee56c18bd0a9abbe0af32290e77779/"
{
    username: 'jim',
    id: 'b35c36f7-8203-4b1b-b9b7-b4d26e8aaba9',
    registration_confirmed: true
}

Choice:

Accepted methods:

GET

Methods:

read(method=following, id=<optional>):

Returns a choice and it's voters when it's id is given:

$ curl -u username "https://www.buzzvote.com/api/1/choice/{id}/"

Example:

$ curl -u username "https://www.buzzvote.com/api/1/choice/d2c6544d-7fcc-4a33-8e32-7c376a7a56ab/"
Enter host password for user 'username':
{
    "votes": 3,
     "voters": [
         {
             "username": "buzzvote",
             "id": "94042f00-062f-4993-b731-26e20eea2dbf"
         },
         {
             "username": "ember",
             "id": "9f12c929-82c0-4d14-949c-d88029bd412c"
         },
         {
             "username": "jim",
             "id": "b35c36f7-8203-4b1b-b9b7-b4d26e8aaba9"
         }
     ],
     "choice_index": 1,
     "id": "d2c6544d-7fcc-4a33-8e32-7c376a7a56ab",
     "choice": "Strongly agree"
 }

create() - inherited

update() - inherited

delete() - inherited

Question:

Accepted methods:

GET, POST, DELETE

Methods:

read(method=<optional>, id=<optional>, count=<optional>, start=<optional>, end=<optional>, user_id=<optional>, category=<optional>, slug=<optional>):

Returns a question or a list of questions based on the input parameters.

  • If id is provided, then it returns 'only' the associated question:

    $ curl -u username "https://www.buzzvote.com/api/1/question/37947adf-ee5b-4e2d-8879-e45ca3b8edd9/"
    Enter host password for user 'username':
    {
      "encoded_choices": "["Choice 1", 3, "f67e6bc8-8c5d-4b1f-913c-dd426b3d3553", "Choice 2", 1, "6c87b5aa-f481-4861-8483-2fa14d894736"]",
      "poster_username": "username",
      "id": "37947adf-ee5b-4e2d-8879-e45ca3b8edd9",
      "question": "Test Question",
      "feature_rank": 1000000,
      "poster_uuid": "b35c36f7-8203-4b1b-b9b7-b4d26e8aaba9",
      "encoded_tags": "["economy", "news", "technology"]",
      "pub_date": "2012-02-02 05:36:27",
      "slug": "test-question",
      "total_votes": 4
    }
    
  • If 'no' question exists with the id then an empty response is sent.

  • If the user has already voted on the specified question the voter_percentage will be dispatched:

    $ curl -u username "https://www.buzzvote.com/api/1/question/37947adf-ee5b-4e2d-8879-e45ca3b8edd9/"
    Enter host password for user 'username':
    {
      "encoded_choices": "["Choice 1", 3, "f67e6bc8-8c5d-4b1f-913c-dd426b3d3553", "Choice 2", 2, "6c87b5aa-f481-4861-8483-2fa14d894736"]",
      "voted_choice_uuid": "6c87b5aa-f481-4861-8483-2fa14d894736",
      "poster_username": "username",
      "id": "37947adf-ee5b-4e2d-8879-e45ca3b8edd9",
      "question": "Test Question",
      "feature_rank": 1000000,
      "poster_uuid": "b35c36f7-8203-4b1b-b9b7-b4d26e8aaba9",
      "encoded_tags": "["economy", "news", "technology"]",
      "voted_percentages": [
      {
        "pk": "f67e6bc8-8c5d-4b1f-913c-dd426b3d3553",
        "votes": 3,
        "vote_percentage": "60",
        "id": "f67e6bc8-8c5d-4b1f-913c-dd426b3d3553",
        "choice": "Choice 1"
      },
      {
        "pk": "6c87b5aa-f481-4861-8483-2fa14d894736",
        "votes": 2,
        "vote_percentage": "40",
        "id": "6c87b5aa-f481-4861-8483-2fa14d894736",
        "choice": "Choice 2"
      }
      ],
      "pub_date": "2012-02-02 05:36:27",
      "slug": "test-question",
      "total_votes": 5
    }
    
  • To fetch a list of recently posted questions by a particular profile:

    $ curl -u username "https://www.buzzvote.com/api/1/questions/posted_by/b35c36f7-8203-4b1b-b9b7-b4d26e8aaba9/recent/"
    $ curl -u username "https://www.buzzvote.com/api/1/questions/posted_by/b35c36f7-8203-4b1b-b9b7-b4d26e8aaba9/recent/{start}/{end}"
    $ curl -u username "https://www.buzzvote.com/api/1/questions/posted_by/b35c36f7-8203-4b1b-b9b7-b4d26e8aaba9/recent/{count}"
    [
      {
        "encoded_choices": "["Choice 1", 3, "f67e6bc8-8c5d-4b1f-913c-dd426b3d3553", "Choice", 2, "6c87b5aa-f481-4861-8483-2fa14d894736"]",
        "voted_choice_uuid": "6c87b5aa-f481-4861-8483-2fa14d894736",
        "poster_username": "username",
        "id": "37947adf-ee5b-4e2d-8879-e45ca3b8edd9",
        "question": "Test Question",
        "feature_rank": 1000000,
        "poster_uuid": "b35c36f7-8203-4b1b-b9b7-b4d26e8aaba9",
        "encoded_tags": "["economy", "news", "technology"]",
        "pub_date": "2012-02-02 05:36:27",
        "slug": "test-question",
        "total_votes": 5
      },
      ...
    ]
    

    By default, 50 items are shown in a list and can be cuztomized through the count fragments. The start and end fragments can be used to set the offset of the items in the list.

  • To get a list of popular questions posted by a particular profile (say b35c36f7-8203-4b1b-b9b7-b4d26e8aaba9) (ordered by the number of votes):

    $ curl -u username "https://www.buzzvote.com/api/1/questions/posted_by/b35c36f7-8203-4b1b-b9b7-b4d26e8aaba9/popular/"
    $ curl -u username "https://www.buzzvote.com/api/1/questions/posted_by/b35c36f7-8203-4b1b-b9b7-b4d26e8aaba9/popular/{start}/{end}"
    $ curl -u username "https://www.buzzvote.com/api/1/questions/posted_by/b35c36f7-8203-4b1b-b9b7-b4d26e8aaba9/popular/{count}"
    
  • To fetch a list of questions voted on by a particular profile:

    $ curl -u username "https://www.buzzvote.com/api/1/questions/voted_on_by/b35c36f7-8203-4b1b-b9b7-b4d26e8aaba9/"
    // $ curl -u username "https://www.buzzvote.com/api/1/questions/voted_on_by/b35c36f7-8203-4b1b-b9b7-b4d26e8aaba9/{start}/{end}"
    // $ curl -u username "https://www.buzzvote.com/api/1/questions/voted_on_by/b35c36f7-8203-4b1b-b9b7-b4d26e8aaba9/{count}"
    
  • Fetch the list of categories:

    $ curl -u username "https://www.buzzvote.com/api/1/questions/categories/"
    Enter host password for user 'username':
    {
      "fashion": 5,
      "celebrities": 32,
      "books": 6,
      "politics": 108,
      "technology": 63,
      "catfight": 12,
      "funny": 38,
      "rumors": 1,
      "tv": 17,
      "travel": 13,
      "sports": 17,
      "current": 158,
      "movies_ExitPoll": 2,
      "health": 22,
      "best": 13,
      "pets": 3,
      "music": 8,
      "events": 1,
      "economy": 43,
      "business": 39,
      "ratings": 11,
      "2012Elections": 28,
      "favorites": 23,
      "shouldbebanned": 4,
      "news": 51,
      "istheproblem?": 11,
      "science": 18,
      "movies": 20,
      "food.and.drink": 23,
      "games": 8,
      "comparisons": 32,
      "OccupyWallSt": 7
    }
    
  • To fetch the details of a question:

    $ curl -u username "https://www.buzzvote.com/api/1/questions/slug/do-you-intend-to-vote-in-the-2012-presidential-election/"
      {
        "encoded_choices": "["Choice 1", 3, "f67e6bc8-8c5d-4b1f-913c-dd426b3d3553", "Choice", 2, "6c87b5aa-f481-4861-8483-2fa14d894736"]",
        "voted_choice_uuid": "6c87b5aa-f481-4861-8483-2fa14d894736",
        "poster_username": "username",
        "id": "37947adf-ee5b-4e2d-8879-e45ca3b8edd9",
        "question": "Do you intent to vote in the 2012 presidential election",
        "feature_rank": 1000000,
        "poster_uuid": "b35c36f7-8203-4b1b-b9b7-b4d26e8aaba9",
        "encoded_tags": "["economy", "news", "technology"]",
        "pub_date": "2012-02-02 05:36:27",
        "slug": "do-you-intend-to-vote-in-the-2012-presidential-election",
        "total_votes": 5
      }
    

create(method=<optional>):

Creates a new BuzzVote question and returns the new object. This call expects a JSON object with the following properties:

* 'question'
* An array of 'choices'
* An array of 'categories'

Example:

$ curl -u username -X POST -H 'Content-Type: application/x-www-form-urlencoded' -d 'json={"question": "Test API Question", "choices": ["Choice 1", "Choice 2"], "categories": ["best"]}' "https://www.buzzvote.com/api/1/question/"
Enter host password for user 'username':
{
    "encoded_choices": "["Choice 1", 0, "911219c8-ff9e-45d1-909a-1a2ea43fac53", "Choice 2", 0, "109bad8b-1e69-4167-a1ef-2216d831b1cb"]",
    "poster_username": "username",
    "id": "5398df2d-dd93-4855-906c-381b3b686522",
    "question": "Test API Question",
    "feature_rank": 1000000,
    "poster_uuid": "b35c36f7-8203-4b1b-b9b7-b4d26e8aaba9",
    "encoded_tags": "["best"]",
    "pub_date": "2012-05-22T04:31:34",
    "slug": "test-api-question",
    "total_votes": 0
}

update() - inherited

delete(id=<optional>, method=<optional>):

Delete a user's question.

Delete a question referenced by 'id' and posted by logged in user:

$ curl -X DELETE -u username "https://www.buzzvote.com/api/1/question/{id}/"

Vote:

Accepted methods:

POST, DELETE

Methods:

read() - inherited

create(id=<optional>):

Cast a vote.

Cast a vote on a BuzzVote choice referenced by 'id':

$ curl -u username -X POST -H 'Content-Type: application/x-www-form-urlencoded' "https://www.buzzvote.com/api/1/vote/json/{id}/"

Example:

$ curl -u username -X POST -H 'Content-Type: application/x-www-form-urlencoded' "https://www.buzzvote.com/api/1/vote/json/d2c6544d-7fcc-4a33-8e32-7c376a7a56ab/"
Enter the host password for 'username':
{
    "encoded_choices": "["Strongly agree", 3, "d2c6544d-7fcc-4a33-8e32-7c376a7a56ab", "Agree", 3, "c4d4b1e1-bf6d-44ec-b557-216d9331b6c4", "Disagree", 3, "68802f3e-c986-45fb-8df8-29a02c858181", "Strongly disagree", 1, "655838b6-0575-4f4a-ac48-d083c4ea14cb", "Don't know", 0, "96f52d49-418b-48b8-bc86-9ba122a4ea60", "Don't care", 2, "9d0ec679-e6f8-4db3-882f-9b6532daf5cc"]",
    "voted_choice_uuid": "d2c6544d-7fcc-4a33-8e32-7c376a7a56ab",
    "poster_username": "ara",
    "id": "2f021c32-abad-4712-befb-2eba8a5d506a",
    "question": ""The greatest enemy of freedom is a happy slave."Anonymous call to "shut the Internet down"?",
    "feature_rank": 1,
    "poster_uuid": "c828da17-3141-4218-a537-5a8ac05483e3",
    "encoded_tags": "["current", "istheproblem?", "technology"]",
    "voted_percentages": [
        {
            "pk": "d2c6544d-7fcc-4a33-8e32-7c376a7a56ab",
            "votes": 3,
            "vote_percentage": "25",
            "id": "d2c6544d-7fcc-4a33-8e32-7c376a7a56ab",
            "choice": "Strongly agree"
        },
        {
            "pk": "c4d4b1e1-bf6d-44ec-b557-216d9331b6c4",
            "votes": 3,
            "vote_percentage": "25",
            "id": "c4d4b1e1-bf6d-44ec-b557-216d9331b6c4",
            "choice": "Agree"
        },
        {
            "pk": "68802f3e-c986-45fb-8df8-29a02c858181",
            "votes": 3,
            "vote_percentage": "25",
            "id": "68802f3e-c986-45fb-8df8-29a02c858181",
            "choice": "Disagree"
        },
        {
            "pk": "655838b6-0575-4f4a-ac48-d083c4ea14cb",
            "votes": 1,
            "vote_percentage": "8",
            "id": "655838b6-0575-4f4a-ac48-d083c4ea14cb",
            "choice": "Strongly disagree"
        },
        {
            "pk": "96f52d49-418b-48b8-bc86-9ba122a4ea60",
            "votes": 0,
            "vote_percentage": "0",
            "id": "96f52d49-418b-48b8-bc86-9ba122a4ea60",
            "choice": "Don't know"
        },
        {
            "pk": "9d0ec679-e6f8-4db3-882f-9b6532daf5cc",
            "votes": 2,
            "vote_percentage": "17",
            "id": "9d0ec679-e6f8-4db3-882f-9b6532daf5cc",
            "choice": "Don't care"
        }
    ],
    "pub_date": "2012-03-31T07:38:28",
    "slug": "the-greatest-enemy-of-freedom-is-a-happy-slave-anonymous-call-to-shut-the-internet-down",
    "total_votes": 12
}

update() - inherited

delete(id=<optional>):