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": 68,
    "team_id": 68,
    "user_id": 125,
    "created_at": "2017-11-22T13:41:37.430Z",
    "validated": true,
    "leader": true,
    "occurrence": 0,
    "team": {
      "id": 68,
      "name": "sebulseb's group",
      "url": "https://api.intra.42.fr/v2/teams/68",
      "final_mark": null,
      "project_id": 1,
      "created_at": "2017-11-22T13:41:37.418Z",
      "updated_at": "2017-11-22T13:42:09.246Z",
      "status": "waiting_for_correction",
      "terminating_at": null,
      "users": [
        {
          "id": 125,
          "login": "sebulseb",
          "url": "https://api.intra.42.fr/v2/users/sebulseb",
          "leader": true,
          "occurrence": 0,
          "validated": true,
          "projects_user_id": 68
        }
      ],
      "locked?": true,
      "validated?": null,
      "closed?": true,
      "repo_url": null,
      "repo_uuid": "intra-uuid-5af5ca8d-e0dc-4791-9cfc-ed657e1984e0-68",
      "locked_at": "2017-11-22T13:41:37.471Z",
      "closed_at": "2017-11-22T13:41:37.496Z",
      "project_session_id": 1
    },
    "user": {
      "id": 125,
      "login": "sebulseb",
      "url": "https://api.intra.42.fr/v2/users/sebulseb"
    }
  },
  {
    "id": 67,
    "team_id": 67,
    "user_id": 119,
    "created_at": "2017-11-22T13:41:37.310Z",
    "validated": true,
    "leader": true,
    "occurrence": 0,
    "team": {
      "id": 67,
      "name": "hasolo's group",
      "url": "https://api.intra.42.fr/v2/teams/67",
      "final_mark": null,
      "project_id": 1,
      "created_at": "2017-11-22T13:41:37.298Z",
      "updated_at": "2017-11-22T13:41:37.386Z",
      "status": "waiting_for_correction",
      "terminating_at": null,
      "users": [
        {
          "id": 119,
          "login": "hasolo",
          "url": "https://api.intra.42.fr/v2/users/hasolo",
          "leader": true,
          "occurrence": 0,
          "validated": true,
          "projects_user_id": 67
        }
      ],
      "locked?": true,
      "validated?": null,
      "closed?": true,
      "repo_url": null,
      "repo_uuid": "intra-uuid-4c9b8f90-9b63-4b8a-b919-4e0d664544c2-67",
      "locked_at": "2017-11-22T13:41:37.358Z",
      "closed_at": "2017-11-22T13:41:37.385Z",
      "project_session_id": 1
    },
    "user": {
      "id": 119,
      "login": "hasolo",
      "url": "https://api.intra.42.fr/v2/users/hasolo"
    }
  },
  {
    "id": 66,
    "team_id": 66,
    "user_id": 118,
    "created_at": "2017-11-22T13:41:37.187Z",
    "validated": true,
    "leader": true,
    "occurrence": 0,
    "team": {
      "id": 66,
      "name": "jarbink2's group",
      "url": "https://api.intra.42.fr/v2/teams/66",
      "final_mark": null,
      "project_id": 1,
      "created_at": "2017-11-22T13:41:37.174Z",
      "updated_at": "2017-11-22T13:41:37.263Z",
      "status": "waiting_for_correction",
      "terminating_at": null,
      "users": [
        {
          "id": 118,
          "login": "padamida",
          "url": "https://api.intra.42.fr/v2/users/padamida",
          "leader": true,
          "occurrence": 0,
          "validated": true,
          "projects_user_id": 66
        }
      ],
      "locked?": true,
      "validated?": null,
      "closed?": true,
      "repo_url": null,
      "repo_uuid": "intra-uuid-5f077c0e-351b-4d77-8334-dac656e42798-66",
      "locked_at": "2017-11-22T13:41:37.238Z",
      "closed_at": "2017-11-22T13:41:37.262Z",
      "project_session_id": 1
    },
    "user": {
      "id": 118,
      "login": "jarbink2",
      "url": "https://api.intra.42.fr/v2/users/jarbink2"
    }
  }
]
curl  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" "https://api.intra.42.fr/v2/teams_users"

[
  {
    "id": 68,
    "team_id": 68,
    "user_id": 125,
    "created_at": "2017-11-22T13:41:37.430Z",
    "validated": true,
    "leader": true,
    "occurrence": 0,
    "team": {
      "id": 68,
      "name": "sebulseb's group",
      "url": "https://api.intra.42.fr/v2/teams/68",
      "final_mark": null,
      "project_id": 1,
      "created_at": "2017-11-22T13:41:37.418Z",
      "updated_at": "2017-11-22T13:42:09.246Z",
      "status": "waiting_for_correction",
      "terminating_at": null,
      "users": [
        {
          "id": 125,
          "login": "sebulseb",
          "url": "https://api.intra.42.fr/v2/users/sebulseb",
          "leader": true,
          "occurrence": 0,
          "validated": true,
          "projects_user_id": 68
        }
      ],
      "locked?": true,
      "validated?": null,
      "closed?": true,
      "repo_url": null,
      "repo_uuid": "intra-uuid-5af5ca8d-e0dc-4791-9cfc-ed657e1984e0-68",
      "locked_at": "2017-11-22T13:41:37.471Z",
      "closed_at": "2017-11-22T13:41:37.496Z",
      "project_session_id": 1
    },
    "user": {
      "id": 125,
      "login": "sebulseb",
      "url": "https://api.intra.42.fr/v2/users/sebulseb"
    }
  },
  {
    "id": 67,
    "team_id": 67,
    "user_id": 119,
    "created_at": "2017-11-22T13:41:37.310Z",
    "validated": true,
    "leader": true,
    "occurrence": 0,
    "team": {
      "id": 67,
      "name": "hasolo's group",
      "url": "https://api.intra.42.fr/v2/teams/67",
      "final_mark": null,
      "project_id": 1,
      "created_at": "2017-11-22T13:41:37.298Z",
      "updated_at": "2017-11-22T13:41:37.386Z",
      "status": "waiting_for_correction",
      "terminating_at": null,
      "users": [
        {
          "id": 119,
          "login": "hasolo",
          "url": "https://api.intra.42.fr/v2/users/hasolo",
          "leader": true,
          "occurrence": 0,
          "validated": true,
          "projects_user_id": 67
        }
      ],
      "locked?": true,
      "validated?": null,
      "closed?": true,
      "repo_url": null,
      "repo_uuid": "intra-uuid-4c9b8f90-9b63-4b8a-b919-4e0d664544c2-67",
      "locked_at": "2017-11-22T13:41:37.358Z",
      "closed_at": "2017-11-22T13:41:37.385Z",
      "project_session_id": 1
    },
    "user": {
      "id": 119,
      "login": "hasolo",
      "url": "https://api.intra.42.fr/v2/users/hasolo"
    }
  },
  {
    "id": 66,
    "team_id": 66,
    "user_id": 118,
    "created_at": "2017-11-22T13:41:37.187Z",
    "validated": true,
    "leader": true,
    "occurrence": 0,
    "team": {
      "id": 66,
      "name": "jarbink2's group",
      "url": "https://api.intra.42.fr/v2/teams/66",
      "final_mark": null,
      "project_id": 1,
      "created_at": "2017-11-22T13:41:37.174Z",
      "updated_at": "2017-11-22T13:41:37.263Z",
      "status": "waiting_for_correction",
      "terminating_at": null,
      "users": [
        {
          "id": 118,
          "login": "padamida",
          "url": "https://api.intra.42.fr/v2/users/padamida",
          "leader": true,
          "occurrence": 0,
          "validated": true,
          "projects_user_id": 66
        }
      ],
      "locked?": true,
      "validated?": null,
      "closed?": true,
      "repo_url": null,
      "repo_uuid": "intra-uuid-5f077c0e-351b-4d77-8334-dac656e42798-66",
      "locked_at": "2017-11-22T13:41:37.238Z",
      "closed_at": "2017-11-22T13:41:37.262Z",
      "project_session_id": 1
    },
    "user": {
      "id": 118,
      "login": "jarbink2",
      "url": "https://api.intra.42.fr/v2/users/jarbink2"
    }
  }
]
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"=>68, "team_id"=>68, "user_id"=>125, "created_at"=>"2017-11-22T13:41:37.430Z", "validated"=>true, "leader"=>true, "occurrence"=>0, "team"=>{"id"=>68, "name"=>"sebulseb's group", "url"=>"https://api.intra.42.fr/v2/teams/68", "final_mark"=>nil, "project_id"=>1, "created_at"=>"2017-11-22T13:41:37.418Z", "updated_at"=>"2017-11-22T13:42:09.246Z", "status"=>"waiting_for_correction", "terminating_at"=>nil, "users"=>[{"id"=>125, "login"=>"sebulseb", "url"=>"https://api.intra.42.fr/v2/users/sebulseb", "leader"=>true, "occurrence"=>0, "validated"=>true, "projects_user_id"=>68}], "locked?"=>true, "validated?"=>nil, "closed?"=>true, "repo_url"=>nil, "repo_uuid"=>"intra-uuid-5af5ca8d-e0dc-4791-9cfc-ed657e1984e0-68", "locked_at"=>"2017-11-22T13:41:37.471Z", "closed_at"=>"2017-11-22T13:41:37.496Z", "project_session_id"=>1}, "user"=>{"id"=>125, "login"=>"sebulseb", "url"=>"https://api.intra.42.fr/v2/users/sebulseb"}}, {"id"=>67, "team_id"=>67, "user_id"=>119, "created_at"=>"2017-11-22T13:41:37.310Z", "validated"=>true, "leader"=>true, "occurrence"=>0, "team"=>{"id"=>67, "name"=>"hasolo's group", "url"=>"https://api.intra.42.fr/v2/teams/67", "final_mark"=>nil, "project_id"=>1, "created_at"=>"2017-11-22T13:41:37.298Z", "updated_at"=>"2017-11-22T13:41:37.386Z", "status"=>"waiting_for_correction", "terminating_at"=>nil, "users"=>[{"id"=>119, "login"=>"hasolo", "url"=>"https://api.intra.42.fr/v2/users/hasolo", "leader"=>true, "occurrence"=>0, "validated"=>true, "projects_user_id"=>67}], "locked?"=>true, "validated?"=>nil, "closed?"=>true, "repo_url"=>nil, "repo_uuid"=>"intra-uuid-4c9b8f90-9b63-4b8a-b919-4e0d664544c2-67", "locked_at"=>"2017-11-22T13:41:37.358Z", "closed_at"=>"2017-11-22T13:41:37.385Z", "project_session_id"=>1}, "user"=>{"id"=>119, "login"=>"hasolo", "url"=>"https://api.intra.42.fr/v2/users/hasolo"}}, {"id"=>66, "team_id"=>66, "user_id"=>118, "created_at"=>"2017-11-22T13:41:37.187Z", "validated"=>true, "leader"=>true, "occurrence"=>0, "team"=>{"id"=>66, "name"=>"jarbink2's group", "url"=>"https://api.intra.42.fr/v2/teams/66", "final_mark"=>nil, "project_id"=>1, "created_at"=>"2017-11-22T13:41:37.174Z", "updated_at"=>"2017-11-22T13:41:37.263Z", "status"=>"waiting_for_correction", "terminating_at"=>nil, "users"=>[{"id"=>118, "login"=>"padamida", "url"=>"https://api.intra.42.fr/v2/users/padamida", "leader"=>true, "occurrence"=>0, "validated"=>true, "projects_user_id"=>66}], "locked?"=>true, "validated?"=>nil, "closed?"=>true, "repo_url"=>nil, "repo_uuid"=>"intra-uuid-5f077c0e-351b-4d77-8334-dac656e42798-66", "locked_at"=>"2017-11-22T13:41:37.238Z", "closed_at"=>"2017-11-22T13:41:37.262Z", "project_session_id"=>1}, "user"=>{"id"=>118, "login"=>"jarbink2", "url"=>"https://api.intra.42.fr/v2/users/jarbink2"}}]