Return the team_user specified by the :id parameter

settings Params

Param name Description
id required . Must be String

The requested id

comments powered by <span class='logo-disqus'>Disqus</span>
GET /v2/teams_users/21
200
{
  "id": 21,
  "team_id": 21,
  "user_id": 31,
  "created_at": "2017-03-06T14:59:09.263Z",
  "validated": true,
  "leader": true,
  "occurrence": 0,
  "team": {
    "id": 21,
    "name": "hsolo's group",
    "url": "https://api.intra.42.fr/v2/teams/21",
    "final_mark": null,
    "project_id": 1,
    "created_at": "2017-03-06T14:59:09.247Z",
    "updated_at": "2017-03-06T14:59:09.360Z",
    "status": "waiting_for_correction",
    "terminating_at": null,
    "users": [
      {
        "id": 31,
        "login": "jarbinks",
        "url": "https://api.intra.42.fr/v2/users/jarbinks",
        "leader": true,
        "occurrence": 0,
        "validated": true,
        "projects_user_id": 21
      }
    ],
    "locked?": true,
    "validated?": null,
    "closed?": true,
    "repo_url": null,
    "repo_uuid": "intra-uuid-38340a99-42f1-4bd3-b544-8739372923d8-21",
    "locked_at": "2017-03-06T14:59:09.330Z",
    "closed_at": "2017-03-06T14:59:09.359Z",
    "project_session_id": 1
  },
  "user": {
    "id": 31,
    "login": "hsolo",
    "url": "https://api.intra.42.fr/v2/users/hsolo"
  }
}
curl  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" "https://api.intra.42.fr/v2/teams_users/21"

{
  "id": 21,
  "team_id": 21,
  "user_id": 31,
  "created_at": "2017-03-06T14:59:09.263Z",
  "validated": true,
  "leader": true,
  "occurrence": 0,
  "team": {
    "id": 21,
    "name": "hsolo's group",
    "url": "https://api.intra.42.fr/v2/teams/21",
    "final_mark": null,
    "project_id": 1,
    "created_at": "2017-03-06T14:59:09.247Z",
    "updated_at": "2017-03-06T14:59:09.360Z",
    "status": "waiting_for_correction",
    "terminating_at": null,
    "users": [
      {
        "id": 31,
        "login": "jarbinks",
        "url": "https://api.intra.42.fr/v2/users/jarbinks",
        "leader": true,
        "occurrence": 0,
        "validated": true,
        "projects_user_id": 21
      }
    ],
    "locked?": true,
    "validated?": null,
    "closed?": true,
    "repo_url": null,
    "repo_uuid": "intra-uuid-38340a99-42f1-4bd3-b544-8739372923d8-21",
    "locked_at": "2017-03-06T14:59:09.330Z",
    "closed_at": "2017-03-06T14:59:09.359Z",
    "project_session_id": 1
  },
  "user": {
    "id": 31,
    "login": "hsolo",
    "url": "https://api.intra.42.fr/v2/users/hsolo"
  }
}
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/teams_users/21")
response.status
# => 200
response.parsed
# => {"id"=>21, "team_id"=>21, "user_id"=>31, "created_at"=>"2017-03-06T14:59:09.263Z", "validated"=>true, "leader"=>true, "occurrence"=>0, "team"=>{"id"=>21, "name"=>"hsolo's group", "url"=>"https://api.intra.42.fr/v2/teams/21", "final_mark"=>nil, "project_id"=>1, "created_at"=>"2017-03-06T14:59:09.247Z", "updated_at"=>"2017-03-06T14:59:09.360Z", "status"=>"waiting_for_correction", "terminating_at"=>nil, "users"=>[{"id"=>31, "login"=>"jarbinks", "url"=>"https://api.intra.42.fr/v2/users/jarbinks", "leader"=>true, "occurrence"=>0, "validated"=>true, "projects_user_id"=>21}], "locked?"=>true, "validated?"=>nil, "closed?"=>true, "repo_url"=>nil, "repo_uuid"=>"intra-uuid-38340a99-42f1-4bd3-b544-8739372923d8-21", "locked_at"=>"2017-03-06T14:59:09.330Z", "closed_at"=>"2017-03-06T14:59:09.359Z", "project_session_id"=>1}, "user"=>{"id"=>31, "login"=>"hsolo", "url"=>"https://api.intra.42.fr/v2/users/hsolo"}}