A Vote is set on a message by an user. A vote can be an upvote, a downvote, a problem (when people report a content as inappropriate) or a trollvote. Each user can upvote OR downvote a message, and can trollvote and mark as inappropriate as well.

This call obviously lists all votes.

The user id of the voter is always hidden.

if there is a resource owner (an user uses this api trough your app, with the web application flow):

  • The /me/*/votes endpoint will list all the votes mades by the current user. If you want to known is the current user have made a vote on a particular message, you can hit the endpoint /v2/me/messages/:message_id/votes.

live_help Notes

chrome_reader_mode This resource is paginated by 30 items

settings Params

Param name Description
topic_id optional . Must be String

The topic id

message_id optional . Must be String

The message id

sort optional . Must be one of: id, user_id, message_id, kind, created_at, updated_at.

The sort field. Sorted by created_at asc by default.

Example:

To sort on votes on the fields created_at on a descending order and updated_at on a ascending order:

...&sort=-created_at,updated_at

filter optional . Must be one of: id, user_id, message_id, created_at, updated_at.

Filtering on one or more fields

Example:

To filter on votes with the id field matching a_value or another_value:

...&filter[id]=a_value,another_value

Filterable fields:
  • id (standard field)
  • user_id (standard field)
  • message_id (standard field)
  • created_at (standard field)
  • updated_at (standard field)
range optional . Must be one of: id, user_id, message_id, created_at, updated_at.

Select on a particular range

Example:

To range on votes with the updated_at field between min_value and max_value:

...&range[updated_at]=min_value,max_value

Rangeable fields:
  • id
  • user_id
  • message_id
  • created_at
  • updated_at
page optional . Must be a Hash

The pagination params, as a hash

page[number] optional . Must be Fixnum

The current page

page[size] optional . Must be Fixnum

The number of items per page, defaults to 30, maximum 100

comments powered by <span class='logo-disqus'>Disqus</span>
GET /v2/votes
200
[
  {
    "id": 1,
    "kind": "trollvote",
    "created_at": "2017-03-06T14:59:44.293Z",
    "user": null,
    "message": {
      "id": 20,
      "author": {
        "login": "dartcaed",
        "id": 61,
        "url": "https://profile.intra.42.fr/users/dartcaed"
      },
      "content": "Cray gastropub ethical cold-pressed poutine. Normcore chambray wolf. Venmo ramps normcore 3 wolf moon.\nVice franzen cred church-key actually pug tofu xoxo. Yr scenester lo-fi schlitz williamsburg wayfarers mumblecore. Gentrify pinterest vinegar ennui venmo chambray.\nAsymmetrical tousled hammock hashtag godard crucifix small batch helvetica. Skateboard blog mumblecore cold-pressed try-hard yr. Knausgaard pitchfork post-ironic blue bottle beard normcore carry 8-bit.",
      "content_html": null,
      "replies": [],
      "created_at": "2017-03-06T14:59:39.136Z",
      "updated_at": "2017-03-06T14:59:44.296Z",
      "parent_id": 15,
      "is_root": false,
      "messageable_id": 2,
      "messageable_type": "Topic",
      "votes_count": {
        "upvote": 0,
        "downvote": 0,
        "trollvote": 1,
        "problem": 0
      },
      "user_votes": {
        "upvote": false,
        "downvote": false,
        "trollvote": false,
        "problem": false
      },
      "readings": 0
    }
  },
  {
    "id": 2,
    "kind": "downvote",
    "created_at": "2017-03-06T14:59:44.319Z",
    "user": null,
    "message": {
      "id": 84,
      "author": {
        "login": "lskywalk",
        "id": 8,
        "url": "https://profile.intra.42.fr/users/lskywalk"
      },
      "content": "Kombucha humblebrag try-hard shabby chic yr trust fund. Etsy wes anderson hashtag. Viral celiac cleanse locavore. Scenester humblebrag vegan banjo meggings pop-up mustache. Locavore vhs stumptown +1 mumblecore.\n3 wolf moon art party letterpress readymade pug marfa photo booth hammock. Gastropub health tousled pabst. Kombucha vice microdosing swag pinterest before they sold out green juice shoreditch. Migas tacos pop-up green juice semiotics salvia.\nBanjo yr pickled. Letterpress vinyl austin pabst scenester trust fund church-key pbr&b. Park raw denim vinyl bicycle rights art party aesthetic. Blue bottle fanny pack kitsch.",
      "content_html": null,
      "replies": [
        {
          "id": 88,
          "author": {
            "id": 52,
            "login": "lacalris",
            "url": "https://api.intra.42.fr/v2/users/lacalris"
          },
          "content": "Fashion axe gastropub chillwave. Direct trade meditation aesthetic jean shorts bespoke carry pinterest cray. Yr craft beer art party vinegar ugh. You probably haven't heard of them fanny pack neutra fashion axe drinking.\nCleanse locavore roof messenger bag brooklyn neutra direct trade. Raw denim fashion axe tofu. Neutra wes anderson portland five dollar toast.\nFap sriracha drinking truffaut hammock polaroid chillwave. Authentic brunch park twee crucifix flannel synth ugh. Celiac yuccie jean shorts. Squid selvage dreamcatcher. Craft beer austin pug.",
          "content_html": null,
          "replies": [],
          "created_at": "2017-03-06T14:59:43.476Z",
          "updated_at": "2017-03-06T14:59:43.476Z",
          "parent_id": 84,
          "is_root": false,
          "messageable_id": 9,
          "messageable_type": "Topic",
          "votes_count": {
            "upvote": 0,
            "downvote": 0,
            "trollvote": 0,
            "problem": 0
          },
          "user_votes": {
            "upvote": false,
            "downvote": false,
            "trollvote": false,
            "problem": false
          },
          "readings": 0
        }
      ],
      "created_at": "2017-03-06T14:59:43.267Z",
      "updated_at": "2017-03-06T14:59:44.323Z",
      "parent_id": null,
      "is_root": false,
      "messageable_id": 9,
      "messageable_type": "Topic",
      "votes_count": {
        "upvote": 0,
        "downvote": 1,
        "trollvote": 0,
        "problem": 0
      },
      "user_votes": {
        "upvote": false,
        "downvote": false,
        "trollvote": false,
        "problem": false
      },
      "readings": 0
    }
  },
  {
    "id": 3,
    "kind": "problem",
    "created_at": "2017-03-06T14:59:44.338Z",
    "user": null,
    "message": {
      "id": 17,
      "author": {
        "login": "qjinn",
        "id": 10,
        "url": "https://profile.intra.42.fr/users/qjinn"
      },
      "content": "Kogi chicharrones cred austin godard poutine asymmetrical whatever. Pitchfork single-origin coffee everyday synth drinking health you probably haven't heard of them cornhole. Kitsch lo-fi next level umami viral try-hard deep v selvage.\nGreen juice diy narwhal wes anderson. Hella asymmetrical cronut next level selvage. Fap franzen yolo tumblr banh mi green juice kogi.\nKeytar chartreuse raw denim jean shorts. Loko echo narwhal blue bottle yr. Tacos shabby chic green juice fixie carry tofu.",
      "content_html": null,
      "replies": [],
      "created_at": "2017-03-06T14:59:38.938Z",
      "updated_at": "2017-03-06T14:59:44.584Z",
      "parent_id": null,
      "is_root": false,
      "messageable_id": 2,
      "messageable_type": "Topic",
      "votes_count": {
        "upvote": 1,
        "downvote": 0,
        "trollvote": 0,
        "problem": 1
      },
      "user_votes": {
        "upvote": false,
        "downvote": false,
        "trollvote": false,
        "problem": false
      },
      "readings": 0
    }
  }
]
curl  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" "https://api.intra.42.fr/v2/votes"

[
  {
    "id": 1,
    "kind": "trollvote",
    "created_at": "2017-03-06T14:59:44.293Z",
    "user": null,
    "message": {
      "id": 20,
      "author": {
        "login": "dartcaed",
        "id": 61,
        "url": "https://profile.intra.42.fr/users/dartcaed"
      },
      "content": "Cray gastropub ethical cold-pressed poutine. Normcore chambray wolf. Venmo ramps normcore 3 wolf moon.\nVice franzen cred church-key actually pug tofu xoxo. Yr scenester lo-fi schlitz williamsburg wayfarers mumblecore. Gentrify pinterest vinegar ennui venmo chambray.\nAsymmetrical tousled hammock hashtag godard crucifix small batch helvetica. Skateboard blog mumblecore cold-pressed try-hard yr. Knausgaard pitchfork post-ironic blue bottle beard normcore carry 8-bit.",
      "content_html": null,
      "replies": [],
      "created_at": "2017-03-06T14:59:39.136Z",
      "updated_at": "2017-03-06T14:59:44.296Z",
      "parent_id": 15,
      "is_root": false,
      "messageable_id": 2,
      "messageable_type": "Topic",
      "votes_count": {
        "upvote": 0,
        "downvote": 0,
        "trollvote": 1,
        "problem": 0
      },
      "user_votes": {
        "upvote": false,
        "downvote": false,
        "trollvote": false,
        "problem": false
      },
      "readings": 0
    }
  },
  {
    "id": 2,
    "kind": "downvote",
    "created_at": "2017-03-06T14:59:44.319Z",
    "user": null,
    "message": {
      "id": 84,
      "author": {
        "login": "lskywalk",
        "id": 8,
        "url": "https://profile.intra.42.fr/users/lskywalk"
      },
      "content": "Kombucha humblebrag try-hard shabby chic yr trust fund. Etsy wes anderson hashtag. Viral celiac cleanse locavore. Scenester humblebrag vegan banjo meggings pop-up mustache. Locavore vhs stumptown +1 mumblecore.\n3 wolf moon art party letterpress readymade pug marfa photo booth hammock. Gastropub health tousled pabst. Kombucha vice microdosing swag pinterest before they sold out green juice shoreditch. Migas tacos pop-up green juice semiotics salvia.\nBanjo yr pickled. Letterpress vinyl austin pabst scenester trust fund church-key pbr&b. Park raw denim vinyl bicycle rights art party aesthetic. Blue bottle fanny pack kitsch.",
      "content_html": null,
      "replies": [
        {
          "id": 88,
          "author": {
            "id": 52,
            "login": "lacalris",
            "url": "https://api.intra.42.fr/v2/users/lacalris"
          },
          "content": "Fashion axe gastropub chillwave. Direct trade meditation aesthetic jean shorts bespoke carry pinterest cray. Yr craft beer art party vinegar ugh. You probably haven't heard of them fanny pack neutra fashion axe drinking.\nCleanse locavore roof messenger bag brooklyn neutra direct trade. Raw denim fashion axe tofu. Neutra wes anderson portland five dollar toast.\nFap sriracha drinking truffaut hammock polaroid chillwave. Authentic brunch park twee crucifix flannel synth ugh. Celiac yuccie jean shorts. Squid selvage dreamcatcher. Craft beer austin pug.",
          "content_html": null,
          "replies": [],
          "created_at": "2017-03-06T14:59:43.476Z",
          "updated_at": "2017-03-06T14:59:43.476Z",
          "parent_id": 84,
          "is_root": false,
          "messageable_id": 9,
          "messageable_type": "Topic",
          "votes_count": {
            "upvote": 0,
            "downvote": 0,
            "trollvote": 0,
            "problem": 0
          },
          "user_votes": {
            "upvote": false,
            "downvote": false,
            "trollvote": false,
            "problem": false
          },
          "readings": 0
        }
      ],
      "created_at": "2017-03-06T14:59:43.267Z",
      "updated_at": "2017-03-06T14:59:44.323Z",
      "parent_id": null,
      "is_root": false,
      "messageable_id": 9,
      "messageable_type": "Topic",
      "votes_count": {
        "upvote": 0,
        "downvote": 1,
        "trollvote": 0,
        "problem": 0
      },
      "user_votes": {
        "upvote": false,
        "downvote": false,
        "trollvote": false,
        "problem": false
      },
      "readings": 0
    }
  },
  {
    "id": 3,
    "kind": "problem",
    "created_at": "2017-03-06T14:59:44.338Z",
    "user": null,
    "message": {
      "id": 17,
      "author": {
        "login": "qjinn",
        "id": 10,
        "url": "https://profile.intra.42.fr/users/qjinn"
      },
      "content": "Kogi chicharrones cred austin godard poutine asymmetrical whatever. Pitchfork single-origin coffee everyday synth drinking health you probably haven't heard of them cornhole. Kitsch lo-fi next level umami viral try-hard deep v selvage.\nGreen juice diy narwhal wes anderson. Hella asymmetrical cronut next level selvage. Fap franzen yolo tumblr banh mi green juice kogi.\nKeytar chartreuse raw denim jean shorts. Loko echo narwhal blue bottle yr. Tacos shabby chic green juice fixie carry tofu.",
      "content_html": null,
      "replies": [],
      "created_at": "2017-03-06T14:59:38.938Z",
      "updated_at": "2017-03-06T14:59:44.584Z",
      "parent_id": null,
      "is_root": false,
      "messageable_id": 2,
      "messageable_type": "Topic",
      "votes_count": {
        "upvote": 1,
        "downvote": 0,
        "trollvote": 0,
        "problem": 1
      },
      "user_votes": {
        "upvote": false,
        "downvote": false,
        "trollvote": false,
        "problem": false
      },
      "readings": 0
    }
  }
]
require "oauth2"
UID = "Your application uid"
SECRET = "Your application secret"
client = OAuth2::Client.new(UID, SECRET, site: "https://api.intra.42.fr")
token = client.client_credentials.get_token

response = token.get("/v2/votes")
response.status
# => 200
response.parsed
# => [{"id"=>1, "kind"=>"trollvote", "created_at"=>"2017-03-06T14:59:44.293Z", "user"=>nil, "message"=>{"id"=>20, "author"=>{"login"=>"dartcaed", "id"=>61, "url"=>"https://profile.intra.42.fr/users/dartcaed"}, "content"=>"Cray gastropub ethical cold-pressed poutine. Normcore chambray wolf. Venmo ramps normcore 3 wolf moon.\nVice franzen cred church-key actually pug tofu xoxo. Yr scenester lo-fi schlitz williamsburg wayfarers mumblecore. Gentrify pinterest vinegar ennui venmo chambray.\nAsymmetrical tousled hammock hashtag godard crucifix small batch helvetica. Skateboard blog mumblecore cold-pressed try-hard yr. Knausgaard pitchfork post-ironic blue bottle beard normcore carry 8-bit.", "content_html"=>nil, "replies"=>[], "created_at"=>"2017-03-06T14:59:39.136Z", "updated_at"=>"2017-03-06T14:59:44.296Z", "parent_id"=>15, "is_root"=>false, "messageable_id"=>2, "messageable_type"=>"Topic", "votes_count"=>{"upvote"=>0, "downvote"=>0, "trollvote"=>1, "problem"=>0}, "user_votes"=>{"upvote"=>false, "downvote"=>false, "trollvote"=>false, "problem"=>false}, "readings"=>0}}, {"id"=>2, "kind"=>"downvote", "created_at"=>"2017-03-06T14:59:44.319Z", "user"=>nil, "message"=>{"id"=>84, "author"=>{"login"=>"lskywalk", "id"=>8, "url"=>"https://profile.intra.42.fr/users/lskywalk"}, "content"=>"Kombucha humblebrag try-hard shabby chic yr trust fund. Etsy wes anderson hashtag. Viral celiac cleanse locavore. Scenester humblebrag vegan banjo meggings pop-up mustache. Locavore vhs stumptown +1 mumblecore.\n3 wolf moon art party letterpress readymade pug marfa photo booth hammock. Gastropub health tousled pabst. Kombucha vice microdosing swag pinterest before they sold out green juice shoreditch. Migas tacos pop-up green juice semiotics salvia.\nBanjo yr pickled. Letterpress vinyl austin pabst scenester trust fund church-key pbr&b. Park raw denim vinyl bicycle rights art party aesthetic. Blue bottle fanny pack kitsch.", "content_html"=>nil, "replies"=>[{"id"=>88, "author"=>{"id"=>52, "login"=>"lacalris", "url"=>"https://api.intra.42.fr/v2/users/lacalris"}, "content"=>"Fashion axe gastropub chillwave. Direct trade meditation aesthetic jean shorts bespoke carry pinterest cray. Yr craft beer art party vinegar ugh. You probably haven't heard of them fanny pack neutra fashion axe drinking.\nCleanse locavore roof messenger bag brooklyn neutra direct trade. Raw denim fashion axe tofu. Neutra wes anderson portland five dollar toast.\nFap sriracha drinking truffaut hammock polaroid chillwave. Authentic brunch park twee crucifix flannel synth ugh. Celiac yuccie jean shorts. Squid selvage dreamcatcher. Craft beer austin pug.", "content_html"=>nil, "replies"=>[], "created_at"=>"2017-03-06T14:59:43.476Z", "updated_at"=>"2017-03-06T14:59:43.476Z", "parent_id"=>84, "is_root"=>false, "messageable_id"=>9, "messageable_type"=>"Topic", "votes_count"=>{"upvote"=>0, "downvote"=>0, "trollvote"=>0, "problem"=>0}, "user_votes"=>{"upvote"=>false, "downvote"=>false, "trollvote"=>false, "problem"=>false}, "readings"=>0}], "created_at"=>"2017-03-06T14:59:43.267Z", "updated_at"=>"2017-03-06T14:59:44.323Z", "parent_id"=>nil, "is_root"=>false, "messageable_id"=>9, "messageable_type"=>"Topic", "votes_count"=>{"upvote"=>0, "downvote"=>1, "trollvote"=>0, "problem"=>0}, "user_votes"=>{"upvote"=>false, "downvote"=>false, "trollvote"=>false, "problem"=>false}, "readings"=>0}}, {"id"=>3, "kind"=>"problem", "created_at"=>"2017-03-06T14:59:44.338Z", "user"=>nil, "message"=>{"id"=>17, "author"=>{"login"=>"qjinn", "id"=>10, "url"=>"https://profile.intra.42.fr/users/qjinn"}, "content"=>"Kogi chicharrones cred austin godard poutine asymmetrical whatever. Pitchfork single-origin coffee everyday synth drinking health you probably haven't heard of them cornhole. Kitsch lo-fi next level umami viral try-hard deep v selvage.\nGreen juice diy narwhal wes anderson. Hella asymmetrical cronut next level selvage. Fap franzen yolo tumblr banh mi green juice kogi.\nKeytar chartreuse raw denim jean shorts. Loko echo narwhal blue bottle yr. Tacos shabby chic green juice fixie carry tofu.", "content_html"=>nil, "replies"=>[], "created_at"=>"2017-03-06T14:59:38.938Z", "updated_at"=>"2017-03-06T14:59:44.584Z", "parent_id"=>nil, "is_root"=>false, "messageable_id"=>2, "messageable_type"=>"Topic", "votes_count"=>{"upvote"=>1, "downvote"=>0, "trollvote"=>0, "problem"=>1}, "user_votes"=>{"upvote"=>false, "downvote"=>false, "trollvote"=>false, "problem"=>false}, "readings"=>0}}]