settings Params

Param name Description
id required . Must be String

The requested id

comments powered by <span class='logo-disqus'>Disqus</span>
GET /v2/blocs/1
200
{
  "id": 1,
  "campus_id": 5,
  "cursus_id": 1,
  "squad_size": 80,
  "created_at": "2017-11-22T13:41:20.665Z",
  "updated_at": "2017-11-22T13:41:20.665Z",
  "coalitions": [
    {
      "id": 1,
      "name": "Indiana goblins",
      "slug": "super-slug",
      "image_url": "https://admin.intra.42.fr/uploads/coalition/image/1/logo.svg",
      "color": "#1c7f08",
      "score": 54,
      "user_id": 38
    },
    {
      "id": 2,
      "name": "Kansas giants",
      "slug": "super-slug",
      "image_url": "https://admin.intra.42.fr/uploads/coalition/image/2/logo.svg",
      "color": "#087262",
      "score": 83,
      "user_id": 90
    }
  ]
}
curl  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" "https://api.intra.42.fr/v2/blocs/1"

{
  "id": 1,
  "campus_id": 5,
  "cursus_id": 1,
  "squad_size": 80,
  "created_at": "2017-11-22T13:41:20.665Z",
  "updated_at": "2017-11-22T13:41:20.665Z",
  "coalitions": [
    {
      "id": 1,
      "name": "Indiana goblins",
      "slug": "super-slug",
      "image_url": "https://admin.intra.42.fr/uploads/coalition/image/1/logo.svg",
      "color": "#1c7f08",
      "score": 54,
      "user_id": 38
    },
    {
      "id": 2,
      "name": "Kansas giants",
      "slug": "super-slug",
      "image_url": "https://admin.intra.42.fr/uploads/coalition/image/2/logo.svg",
      "color": "#087262",
      "score": 83,
      "user_id": 90
    }
  ]
}
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/blocs/1")
response.status
# => 200
response.parsed
# => {"id"=>1, "campus_id"=>5, "cursus_id"=>1, "squad_size"=>80, "created_at"=>"2017-11-22T13:41:20.665Z", "updated_at"=>"2017-11-22T13:41:20.665Z", "coalitions"=>[{"id"=>1, "name"=>"Indiana goblins", "slug"=>"super-slug", "image_url"=>"https://admin.intra.42.fr/uploads/coalition/image/1/logo.svg", "color"=>"#1c7f08", "score"=>54, "user_id"=>38}, {"id"=>2, "name"=>"Kansas giants", "slug"=>"super-slug", "image_url"=>"https://admin.intra.42.fr/uploads/coalition/image/2/logo.svg", "color"=>"#087262", "score"=>83, "user_id"=>90}]}