settings Params

Param name Description
id required . Must be String

The requested id

comments powered by <span class='logo-disqus'>Disqus</span>
GET /v2/users/27
200
{
  "id": 27,
  "email": "kiki-adi@student.42.us.org",
  "login": "kiki-adi",
  "first_name": "Ki-adi-mundi",
  "last_name": "Ki-adi-mundi",
  "url": "https://api.intra.42.fr/v2/users/kiki-adi",
  "phone": null,
  "displayname": "Ki Adi Mundi Ki Adi Mundi",
  "image_url": "https://cdn.intra.42.fr/images/default.png",
  "staff?": false,
  "correction_point": 4,
  "pool_month": "august",
  "pool_year": "2016",
  "location": null,
  "wallet": 0,
  "groups": [],
  "cursus_users": [
    {
      "id": 27,
      "begin_at": "2016-06-21T17:11:54.110Z",
      "end_at": null,
      "grade": "Cadet",
      "level": 0.0,
      "skills": [],
      "cursus_id": 2,
      "user": {
        "id": 27,
        "login": "kiki-adi",
        "url": "https://api.intra.42.fr/v2/users/kiki-adi"
      },
      "cursus": {
        "id": 2,
        "created_at": "2017-03-06T14:58:44.047Z",
        "name": "42",
        "slug": "42"
      }
    }
  ],
  "projects_users": [],
  "languages_users": [
    {
      "id": 27,
      "language_id": 2,
      "user_id": 27,
      "position": 1,
      "created_at": "2017-03-06T14:58:51.013Z"
    }
  ],
  "achievements": [],
  "titles": [],
  "partnerships": [],
  "patroned": [
    {
      "id": 26,
      "user_id": 27,
      "godfather_id": 48,
      "ongoing": true,
      "created_at": "2017-03-06T14:59:37.048Z",
      "updated_at": "2017-03-06T14:59:37.053Z"
    }
  ],
  "patroning": [],
  "expertises_users": [
    {
      "id": 26,
      "expertise_id": 9,
      "interested": false,
      "value": 2,
      "contact_me": false,
      "created_at": "2017-03-06T14:59:00.730Z",
      "user_id": 27
    }
  ],
  "campus": [
    {
      "id": 5,
      "name": "Fremont",
      "time_zone": "Pacific Time (US & Canada)",
      "language": {
        "id": 2,
        "name": "English",
        "identifier": "en",
        "created_at": "2017-03-06T14:58:43.172Z",
        "updated_at": "2017-03-06T14:58:43.172Z"
      },
      "users_count": 10,
      "vogsphere_id": 2
    }
  ],
  "campus_users": [
    {
      "id": 27,
      "user_id": 27,
      "campus_id": 5,
      "is_primary": true
    }
  ]
}
curl  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" "https://api.intra.42.fr/v2/users/27"

{
  "id": 27,
  "email": "kiki-adi@student.42.us.org",
  "login": "kiki-adi",
  "first_name": "Ki-adi-mundi",
  "last_name": "Ki-adi-mundi",
  "url": "https://api.intra.42.fr/v2/users/kiki-adi",
  "phone": null,
  "displayname": "Ki Adi Mundi Ki Adi Mundi",
  "image_url": "https://cdn.intra.42.fr/images/default.png",
  "staff?": false,
  "correction_point": 4,
  "pool_month": "august",
  "pool_year": "2016",
  "location": null,
  "wallet": 0,
  "groups": [],
  "cursus_users": [
    {
      "id": 27,
      "begin_at": "2016-06-21T17:11:54.110Z",
      "end_at": null,
      "grade": "Cadet",
      "level": 0.0,
      "skills": [],
      "cursus_id": 2,
      "user": {
        "id": 27,
        "login": "kiki-adi",
        "url": "https://api.intra.42.fr/v2/users/kiki-adi"
      },
      "cursus": {
        "id": 2,
        "created_at": "2017-03-06T14:58:44.047Z",
        "name": "42",
        "slug": "42"
      }
    }
  ],
  "projects_users": [],
  "languages_users": [
    {
      "id": 27,
      "language_id": 2,
      "user_id": 27,
      "position": 1,
      "created_at": "2017-03-06T14:58:51.013Z"
    }
  ],
  "achievements": [],
  "titles": [],
  "partnerships": [],
  "patroned": [
    {
      "id": 26,
      "user_id": 27,
      "godfather_id": 48,
      "ongoing": true,
      "created_at": "2017-03-06T14:59:37.048Z",
      "updated_at": "2017-03-06T14:59:37.053Z"
    }
  ],
  "patroning": [],
  "expertises_users": [
    {
      "id": 26,
      "expertise_id": 9,
      "interested": false,
      "value": 2,
      "contact_me": false,
      "created_at": "2017-03-06T14:59:00.730Z",
      "user_id": 27
    }
  ],
  "campus": [
    {
      "id": 5,
      "name": "Fremont",
      "time_zone": "Pacific Time (US & Canada)",
      "language": {
        "id": 2,
        "name": "English",
        "identifier": "en",
        "created_at": "2017-03-06T14:58:43.172Z",
        "updated_at": "2017-03-06T14:58:43.172Z"
      },
      "users_count": 10,
      "vogsphere_id": 2
    }
  ],
  "campus_users": [
    {
      "id": 27,
      "user_id": 27,
      "campus_id": 5,
      "is_primary": true
    }
  ]
}
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/users/27")
response.status
# => 200
response.parsed
# => {"id"=>27, "email"=>"kiki-adi@student.42.us.org", "login"=>"kiki-adi", "first_name"=>"Ki-adi-mundi", "last_name"=>"Ki-adi-mundi", "url"=>"https://api.intra.42.fr/v2/users/kiki-adi", "phone"=>nil, "displayname"=>"Ki Adi Mundi Ki Adi Mundi", "image_url"=>"https://cdn.intra.42.fr/images/default.png", "staff?"=>false, "correction_point"=>4, "pool_month"=>"august", "pool_year"=>"2016", "location"=>nil, "wallet"=>0, "groups"=>[], "cursus_users"=>[{"id"=>27, "begin_at"=>"2016-06-21T17:11:54.110Z", "end_at"=>nil, "grade"=>"Cadet", "level"=>0.0, "skills"=>[], "cursus_id"=>2, "user"=>{"id"=>27, "login"=>"kiki-adi", "url"=>"https://api.intra.42.fr/v2/users/kiki-adi"}, "cursus"=>{"id"=>2, "created_at"=>"2017-03-06T14:58:44.047Z", "name"=>"42", "slug"=>"42"}}], "projects_users"=>[], "languages_users"=>[{"id"=>27, "language_id"=>2, "user_id"=>27, "position"=>1, "created_at"=>"2017-03-06T14:58:51.013Z"}], "achievements"=>[], "titles"=>[], "partnerships"=>[], "patroned"=>[{"id"=>26, "user_id"=>27, "godfather_id"=>48, "ongoing"=>true, "created_at"=>"2017-03-06T14:59:37.048Z", "updated_at"=>"2017-03-06T14:59:37.053Z"}], "patroning"=>[], "expertises_users"=>[{"id"=>26, "expertise_id"=>9, "interested"=>false, "value"=>2, "contact_me"=>false, "created_at"=>"2017-03-06T14:59:00.730Z", "user_id"=>27}], "campus"=>[{"id"=>5, "name"=>"Fremont", "time_zone"=>"Pacific Time (US & Canada)", "language"=>{"id"=>2, "name"=>"English", "identifier"=>"en", "created_at"=>"2017-03-06T14:58:43.172Z", "updated_at"=>"2017-03-06T14:58:43.172Z"}, "users_count"=>10, "vogsphere_id"=>2}], "campus_users"=>[{"id"=>27, "user_id"=>27, "campus_id"=>5, "is_primary"=>true}]}