live_help Notes

chrome_reader_mode This resource is paginated by 30 items

settings Params

Param name Description
user_id optional . Must be String

The user id or slug

team_id optional . Must be String

The team id

sort optional . Must be one of: id, team_id, user_id, leader, validated, created_at, updated_at, occurrence.

The sort field. Sorted by id desc by default.

Example:

To sort on teams users on the fields updated_at on a descending order and occurrence on a ascending order:

...&sort=-updated_at,occurrence

filter optional . Must be one of: id, team_id, user_id, leader, validated, created_at, updated_at, occurrence.

Filtering on one or more fields

Example:

To filter on teams users with the id field matching a_value or another_value:

...&filter[id]=a_value,another_value

Filterable fields:
  • id (standard field)
  • team_id (standard field)
  • user_id (standard field)
  • leader (standard field)
  • validated (standard field)
  • created_at (standard field)
  • updated_at (standard field)
  • occurrence (standard field)
range optional . Must be one of: id, team_id, user_id, leader, validated, created_at, updated_at, occurrence.

Select on a particular range

Example:

To range on teams users with the occurrence field between min_value and max_value:

...&range[occurrence]=min_value,max_value

Rangeable fields:
  • id
  • team_id
  • user_id
  • leader
  • validated
  • created_at
  • updated_at
  • occurrence
page optional . Must be a Hash

The pagination params, as a hash

page[number] optional . Must be Fixnum

The current page

page[size] optional . Must be Fixnum

The number of items per page, defaults to 30, maximum 100

comments powered by <span class='logo-disqus'>Disqus</span>
GET /v2/teams_users
200
[
  {
    "id": 34,
    "team_id": 34,
    "user_id": 66,
    "created_at": "2017-03-06T14:59:11.380Z",
    "validated": true,
    "leader": true,
    "occurrence": 0,
    "team": {
      "id": 34,
      "name": "cdooku's group",
      "url": "https://api.intra.42.fr/v2/teams/34",
      "final_mark": null,
      "project_id": 1,
      "created_at": "2017-03-06T14:59:11.365Z",
      "updated_at": "2017-03-06T14:59:34.775Z",
      "status": "waiting_for_correction",
      "terminating_at": null,
      "users": [
        {
          "id": 66,
          "login": "jbinks2",
          "url": "https://api.intra.42.fr/v2/users/jbinks2",
          "leader": true,
          "occurrence": 0,
          "validated": true,
          "projects_user_id": 34
        }
      ],
      "locked?": true,
      "validated?": null,
      "closed?": true,
      "repo_url": null,
      "repo_uuid": "intra-uuid-e595b115-a857-4ea9-bc02-fde6947e9480-34",
      "locked_at": "2017-03-06T14:59:11.442Z",
      "closed_at": "2017-03-06T14:59:11.471Z",
      "project_session_id": 1
    },
    "user": {
      "id": 66,
      "login": "cdooku",
      "url": "https://api.intra.42.fr/v2/users/cdooku"
    }
  },
  {
    "id": 33,
    "team_id": 33,
    "user_id": 65,
    "created_at": "2017-03-06T14:59:11.234Z",
    "validated": true,
    "leader": true,
    "occurrence": 0,
    "team": {
      "id": 33,
      "name": "jabinks's group",
      "url": "https://api.intra.42.fr/v2/teams/33",
      "final_mark": null,
      "project_id": 1,
      "created_at": "2017-03-06T14:59:11.201Z",
      "updated_at": "2017-03-06T14:59:11.327Z",
      "status": "waiting_for_correction",
      "terminating_at": null,
      "users": [
        {
          "id": 65,
          "login": "jabinks",
          "url": "https://api.intra.42.fr/v2/users/jabinks",
          "leader": true,
          "occurrence": 0,
          "validated": true,
          "projects_user_id": 33
        }
      ],
      "locked?": true,
      "validated?": null,
      "closed?": true,
      "repo_url": null,
      "repo_uuid": "intra-uuid-52a38575-a8ca-44ae-a32c-ab82a8c0fcf7-33",
      "locked_at": "2017-03-06T14:59:11.297Z",
      "closed_at": "2017-03-06T14:59:11.326Z",
      "project_session_id": 1
    },
    "user": {
      "id": 65,
      "login": "jabinks",
      "url": "https://api.intra.42.fr/v2/users/jabinks"
    }
  },
  {
    "id": 32,
    "team_id": 32,
    "user_id": 62,
    "created_at": "2017-03-06T14:59:11.065Z",
    "validated": true,
    "leader": true,
    "occurrence": 0,
    "team": {
      "id": 32,
      "name": "lukskywa's group",
      "url": "https://api.intra.42.fr/v2/teams/32",
      "final_mark": null,
      "project_id": 1,
      "created_at": "2017-03-06T14:59:11.050Z",
      "updated_at": "2017-03-06T14:59:11.160Z",
      "status": "waiting_for_correction",
      "terminating_at": null,
      "users": [
        {
          "id": 62,
          "login": "hsolo2",
          "url": "https://api.intra.42.fr/v2/users/hsolo2",
          "leader": true,
          "occurrence": 0,
          "validated": true,
          "projects_user_id": 32
        }
      ],
      "locked?": true,
      "validated?": null,
      "closed?": true,
      "repo_url": null,
      "repo_uuid": "intra-uuid-9d565df1-9175-4fa8-bb84-34f22cded1fa-32",
      "locked_at": "2017-03-06T14:59:11.129Z",
      "closed_at": "2017-03-06T14:59:11.158Z",
      "project_session_id": 1
    },
    "user": {
      "id": 62,
      "login": "lukskywa",
      "url": "https://api.intra.42.fr/v2/users/lukskywa"
    }
  }
]
curl  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" "https://api.intra.42.fr/v2/teams_users"

[
  {
    "id": 34,
    "team_id": 34,
    "user_id": 66,
    "created_at": "2017-03-06T14:59:11.380Z",
    "validated": true,
    "leader": true,
    "occurrence": 0,
    "team": {
      "id": 34,
      "name": "cdooku's group",
      "url": "https://api.intra.42.fr/v2/teams/34",
      "final_mark": null,
      "project_id": 1,
      "created_at": "2017-03-06T14:59:11.365Z",
      "updated_at": "2017-03-06T14:59:34.775Z",
      "status": "waiting_for_correction",
      "terminating_at": null,
      "users": [
        {
          "id": 66,
          "login": "jbinks2",
          "url": "https://api.intra.42.fr/v2/users/jbinks2",
          "leader": true,
          "occurrence": 0,
          "validated": true,
          "projects_user_id": 34
        }
      ],
      "locked?": true,
      "validated?": null,
      "closed?": true,
      "repo_url": null,
      "repo_uuid": "intra-uuid-e595b115-a857-4ea9-bc02-fde6947e9480-34",
      "locked_at": "2017-03-06T14:59:11.442Z",
      "closed_at": "2017-03-06T14:59:11.471Z",
      "project_session_id": 1
    },
    "user": {
      "id": 66,
      "login": "cdooku",
      "url": "https://api.intra.42.fr/v2/users/cdooku"
    }
  },
  {
    "id": 33,
    "team_id": 33,
    "user_id": 65,
    "created_at": "2017-03-06T14:59:11.234Z",
    "validated": true,
    "leader": true,
    "occurrence": 0,
    "team": {
      "id": 33,
      "name": "jabinks's group",
      "url": "https://api.intra.42.fr/v2/teams/33",
      "final_mark": null,
      "project_id": 1,
      "created_at": "2017-03-06T14:59:11.201Z",
      "updated_at": "2017-03-06T14:59:11.327Z",
      "status": "waiting_for_correction",
      "terminating_at": null,
      "users": [
        {
          "id": 65,
          "login": "jabinks",
          "url": "https://api.intra.42.fr/v2/users/jabinks",
          "leader": true,
          "occurrence": 0,
          "validated": true,
          "projects_user_id": 33
        }
      ],
      "locked?": true,
      "validated?": null,
      "closed?": true,
      "repo_url": null,
      "repo_uuid": "intra-uuid-52a38575-a8ca-44ae-a32c-ab82a8c0fcf7-33",
      "locked_at": "2017-03-06T14:59:11.297Z",
      "closed_at": "2017-03-06T14:59:11.326Z",
      "project_session_id": 1
    },
    "user": {
      "id": 65,
      "login": "jabinks",
      "url": "https://api.intra.42.fr/v2/users/jabinks"
    }
  },
  {
    "id": 32,
    "team_id": 32,
    "user_id": 62,
    "created_at": "2017-03-06T14:59:11.065Z",
    "validated": true,
    "leader": true,
    "occurrence": 0,
    "team": {
      "id": 32,
      "name": "lukskywa's group",
      "url": "https://api.intra.42.fr/v2/teams/32",
      "final_mark": null,
      "project_id": 1,
      "created_at": "2017-03-06T14:59:11.050Z",
      "updated_at": "2017-03-06T14:59:11.160Z",
      "status": "waiting_for_correction",
      "terminating_at": null,
      "users": [
        {
          "id": 62,
          "login": "hsolo2",
          "url": "https://api.intra.42.fr/v2/users/hsolo2",
          "leader": true,
          "occurrence": 0,
          "validated": true,
          "projects_user_id": 32
        }
      ],
      "locked?": true,
      "validated?": null,
      "closed?": true,
      "repo_url": null,
      "repo_uuid": "intra-uuid-9d565df1-9175-4fa8-bb84-34f22cded1fa-32",
      "locked_at": "2017-03-06T14:59:11.129Z",
      "closed_at": "2017-03-06T14:59:11.158Z",
      "project_session_id": 1
    },
    "user": {
      "id": 62,
      "login": "lukskywa",
      "url": "https://api.intra.42.fr/v2/users/lukskywa"
    }
  }
]
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")
response.status
# => 200
response.parsed
# => [{"id"=>34, "team_id"=>34, "user_id"=>66, "created_at"=>"2017-03-06T14:59:11.380Z", "validated"=>true, "leader"=>true, "occurrence"=>0, "team"=>{"id"=>34, "name"=>"cdooku's group", "url"=>"https://api.intra.42.fr/v2/teams/34", "final_mark"=>nil, "project_id"=>1, "created_at"=>"2017-03-06T14:59:11.365Z", "updated_at"=>"2017-03-06T14:59:34.775Z", "status"=>"waiting_for_correction", "terminating_at"=>nil, "users"=>[{"id"=>66, "login"=>"jbinks2", "url"=>"https://api.intra.42.fr/v2/users/jbinks2", "leader"=>true, "occurrence"=>0, "validated"=>true, "projects_user_id"=>34}], "locked?"=>true, "validated?"=>nil, "closed?"=>true, "repo_url"=>nil, "repo_uuid"=>"intra-uuid-e595b115-a857-4ea9-bc02-fde6947e9480-34", "locked_at"=>"2017-03-06T14:59:11.442Z", "closed_at"=>"2017-03-06T14:59:11.471Z", "project_session_id"=>1}, "user"=>{"id"=>66, "login"=>"cdooku", "url"=>"https://api.intra.42.fr/v2/users/cdooku"}}, {"id"=>33, "team_id"=>33, "user_id"=>65, "created_at"=>"2017-03-06T14:59:11.234Z", "validated"=>true, "leader"=>true, "occurrence"=>0, "team"=>{"id"=>33, "name"=>"jabinks's group", "url"=>"https://api.intra.42.fr/v2/teams/33", "final_mark"=>nil, "project_id"=>1, "created_at"=>"2017-03-06T14:59:11.201Z", "updated_at"=>"2017-03-06T14:59:11.327Z", "status"=>"waiting_for_correction", "terminating_at"=>nil, "users"=>[{"id"=>65, "login"=>"jabinks", "url"=>"https://api.intra.42.fr/v2/users/jabinks", "leader"=>true, "occurrence"=>0, "validated"=>true, "projects_user_id"=>33}], "locked?"=>true, "validated?"=>nil, "closed?"=>true, "repo_url"=>nil, "repo_uuid"=>"intra-uuid-52a38575-a8ca-44ae-a32c-ab82a8c0fcf7-33", "locked_at"=>"2017-03-06T14:59:11.297Z", "closed_at"=>"2017-03-06T14:59:11.326Z", "project_session_id"=>1}, "user"=>{"id"=>65, "login"=>"jabinks", "url"=>"https://api.intra.42.fr/v2/users/jabinks"}}, {"id"=>32, "team_id"=>32, "user_id"=>62, "created_at"=>"2017-03-06T14:59:11.065Z", "validated"=>true, "leader"=>true, "occurrence"=>0, "team"=>{"id"=>32, "name"=>"lukskywa's group", "url"=>"https://api.intra.42.fr/v2/teams/32", "final_mark"=>nil, "project_id"=>1, "created_at"=>"2017-03-06T14:59:11.050Z", "updated_at"=>"2017-03-06T14:59:11.160Z", "status"=>"waiting_for_correction", "terminating_at"=>nil, "users"=>[{"id"=>62, "login"=>"hsolo2", "url"=>"https://api.intra.42.fr/v2/users/hsolo2", "leader"=>true, "occurrence"=>0, "validated"=>true, "projects_user_id"=>32}], "locked?"=>true, "validated?"=>nil, "closed?"=>true, "repo_url"=>nil, "repo_uuid"=>"intra-uuid-9d565df1-9175-4fa8-bb84-34f22cded1fa-32", "locked_at"=>"2017-03-06T14:59:11.129Z", "closed_at"=>"2017-03-06T14:59:11.158Z", "project_session_id"=>1}, "user"=>{"id"=>62, "login"=>"lukskywa", "url"=>"https://api.intra.42.fr/v2/users/lukskywa"}}]