live_help Notes

assignment_ind This action requires a token resource owner scoped on forum with enough privileges .

settings Params

Param name Description
id required . Must be String

The requested id

vote optional , nil allowed . Must be a Hash
vote[user_id] optional . Must be Fixnum

The user id. Must be unique in the scope of a given message id and kind.

vote[message_id] optional . Must be Fixnum

The message id.

vote[kind] optional , nil allowed . Must be one of: upvote, downvote, trollvote, problem.

The kind.

comments powered by <span class='logo-disqus'>Disqus</span>
PUT /v2/votes/25
{
  "vote": {
    "kind": "upvote",
    "message_id": "38"
  }
}
204
curl  -X PUT -H "Authorization: Bearer YOUR_ACCESS_TOKEN" -H "Content-Type: application/json" -d '{"vote":{"kind":"upvote","message_id":"38"}}' "https://api.intra.42.fr/v2/votes/25"
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

params = {vote: {kind: "upvote", message_id: "38"}}
response = token.put("/v2/votes/25", params: params)
response.status
# => 204
response.parsed
# =>