live_help Notes

assignment This action requires one of theses roles: Advanced tutor

settings Params

Param name Description
id required . Must be String

The requested id

coalition_id optional . Must be String

The coalition id or slug

coalitions_user_id optional . Must be String

The coalitions_user id

bloc_id optional . Must be String

The bloc id

GET /v2/scores/2
200
{
  "id": 2,
  "coalition_id": 1,
  "scoreable_id": 5,
  "scoreable_type": "Location",
  "coalitions_user_id": 3,
  "calculation_id": 3,
  "value": 54,
  "reason": "Who's the more foolish; the fool, or the fool who follows him?",
  "created_at": "2017-11-22T13:42:09.850Z",
  "updated_at": "2017-11-22T13:42:09.850Z"
}
curl  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" "https://api.intra.42.fr/v2/scores/2"

{
  "id": 2,
  "coalition_id": 1,
  "scoreable_id": 5,
  "scoreable_type": "Location",
  "coalitions_user_id": 3,
  "calculation_id": 3,
  "value": 54,
  "reason": "Who's the more foolish; the fool, or the fool who follows him?",
  "created_at": "2017-11-22T13:42:09.850Z",
  "updated_at": "2017-11-22T13:42:09.850Z"
}
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/scores/2")
response.status
# => 200
response.parsed
# => {"id"=>2, "coalition_id"=>1, "scoreable_id"=>5, "scoreable_type"=>"Location", "coalitions_user_id"=>3, "calculation_id"=>3, "value"=>54, "reason"=>"Who's the more foolish; the fool, or the fool who follows him?", "created_at"=>"2017-11-22T13:42:09.850Z", "updated_at"=>"2017-11-22T13:42:09.850Z"}